alloc / alloc/saus

[RFC] Server only components

Aperta
#73 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
proposal roadmap
Lingua principale
TypeScript
Stelle
38
Fork
1
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

- All components are server-only when the nearest [route layout](https://github.com/alloc/saus/issues/70) has no `hydrator` defined.
- For component subtrees to opt-in to client-side rendering, they need to attach some special `data-` attributes to the subtree's root element.
- One attribute will tell Saus which component module to import and which export specifier points to the component (eg: `data-import="/path/to/module.js#MyComponent"`).
- The 2nd attribute will tell Saus which hydrator module to import (eg: `data-hydrate="/path/to/module.js"`).
- The final attribute is optional, and it will tell Saus when to hydrate (eg: `data-when="visible"`). If undefined, Saus will hydrate the subtree immediately after its modules are loaded.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.