denoland / fresh

The next-gen web framework.
https://fresh.deno.dev
MIT License
12.39k stars 639 forks source link

Feature: Nested Layouts and top-level GET/POST/DELETE declarations for nested components #950

Open mohsinalipro opened 1 year ago

mohsinalipro commented 1 year ago

A feature to Fresh: the ability to define layouts for nested routes and top-level export GET/POST/DELETE declarations, similar to how it is done in SolidJS.

Nested Layouts: Just like _app.tsx for entry point of the app, it can be entry point for the requested route.

Top-level export GET/POST/DELETE In order to fetch data directly in the nested component rather than passing from the route level component the nested component.

egmaleta commented 1 year ago

Hello, you might want to check this. Top level handlers (LayoutHandler) are implemented but don't even tested with an example or documented. They should work tho, they're basically nested wrappers of page route handlers

marvinhagemeister commented 1 year ago

@mohsinalipro I have trouble understanding what the feature should look like.

In order to fetch data directly in the nested component rather than passing from the route level component the nested component.

Can you elaborate on what this means?