[RFC] Nested routes
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 35/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- typescript
Direzione di ricerca
Inizia tracciando il modulo routes, getMatchedRoutes, renderRoute e il comportamento del layout indicato da #70. Definisci le primitive condivise e i componenti Route specifici della UI-library, in modo che il matching delle route annidate e il rendering annidato funzionino come descritto, preservando al contempo le dichiarazioni delle route per il pre-rendering e il bundling.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
For nested routes to be fully supported, we'll need a component for each UI library, but we can provide primitives to make implementation easy and share the common logic between them.
-
getMatchedRoutes
This returns an array ofRouteobjects, ordered parent-first.
Its result is injected before each page starts rendering.
TheRoutecomponent can use this to know if it should render. -
renderRoute
Given aRouteobject, it will load its route props and route module.
Then the route's layout (see #70) has itsrendermethod called, but withoptions.nestedset to true (which signals to the layout that it should produce a result supported by its associated UI library, rather than plain HTML).
So the expected flow goes like this:
- developer uses
Routecomponent specific to UI library of choice - component checks if any routes returned by
getMatchedRouteshave a route pattern identical to its own - component calls
renderRoute(if it finds a matching route) and does whatever with the result
Note that nested routes still need to be declared within the routes module, because that's where the route props, module, layout, and more are defined. That declaration is also used when pre-rendering and (eventually) bundling.
What's so great about nested routes?
Nested routes let you tell Saus that certain route props don't need to delay rendering until a certain point in the component tree. This means you can stream HTML to the browser before all data is loaded, which can vastly improve TTFP (time to first paint) and therefore make your site feel faster.
- Lingua principale
- TypeScript
- Stelle
- 38
- Fork
- 1
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di alloc/saus
-
enhancement
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
-
package idea
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
-
Supertokens plugin Apertahelp wanted package idea
Difficoltà 5/5 Più di una settimana Idoneità per principianti 20/100
-
enhancement plugin:aws saus deploy
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
-
bug saus deploy
Difficoltà 4/5 3-5 giorni Idoneità per principianti 42/100
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
mksglu/context-mode#1200 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
jaegertracing/jaeger-ui#4506 ·
-
area:desktop area:ui bug platform:macos
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
anthropics/claude-code#96687 ·
-
good first issue
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 95/100
AOSSIE-Org/DebateAI#582 · 2 commenti ·