fresh
fresh copied to clipboard
Nested Layouts && Error Boundaries?
Hey Luca, fantastic work, thanks a lot 🙏
I was wondering how you feel about nested layouts and error boundaries or if it's already somehow possible?
Nested layouts are great to group certain pages and with error boundaries I can keep errors for example only within the content and have the group layout unaffected, which could be more granular than a general _404.tsx
route. Also I can't get a custom _404.tsx
working, I basically copied from fixtures
and customized the text but it's still just rendering the text from
return new Response("404 Page not found", {
status: 404,
});
Or how am I supposed to trigger a 404?
Uh I guess the example here can be an alternative to separate error boundaries, though I just realized that this would be too late to send the proper HTTP status code 🤔
Ok so seams like the custom _404.tsx
only renders if there's no route file at all for the requested URL.
Also, out of curiosity, as you're active in Remix, especially Deno support, as well, what are you're plans with Fresh, vs Remix with much better Deno integration?
Ok so seams like the custom _404.tsx only renders if there's no route file at all for the requested URL.
Yup. I should have probably used error boundaries + nested routes... The infra is actually all there (middlewares), I just need to plumb it through.
I kind of want to get the 1.0 release out soon, and then this is something I can tackle for a 1.1 (if I can make it work backwards compatibly), or a 2.0 release soon.
Great than I'll keep my eyes open 👀
Closing as recent Fresh versions support nested layouts + error boundaries.