webcomponents / webcomponents/template-shadowroot

Build legacy script for use as polyfill that hydrates shadow roots on page

Aperta
#12 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
TypeScript
Stelle
39
Fork
6
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

Task to build a legacy script for use as polyfill that hydrates shadow roots on page, without needing to import modules and call `hydrateShadowRoots` in user code.

We may want one or more options on how this would work:
* Use `MutationObserver` to hydrate shadow roots as they are encountered, for better streaming support (as noted in the `mutation-observer.ts` implementation, this likely needs to be more sophisticated to avoid hydrating partially-parsed templates
* To confirm: Does the parser actually yield in the middle of a large template? If so, may need more sophisticated logic around e.g. detecting that the next element after the `` has opened before hydrating a given template
* What is the perf impact of using `MutationObserver` over one-shot `DOMContentLoaded`?
* Wait until `DOMContentLoaded` and upgrade all in one shot

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Direzione di ricerca

Inizia leggendo mutation-observer.ts e l’attuale punto di ingresso hydrateShadowRoots. Confronta gli approcci MutationObserver e DOMContentLoaded, incluse le questioni indicate relative a streaming e prestazioni, quindi definisci test che dimostrino che lo script legacy idrata gli shadow root senza import o codice dell’utente.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
typescript
Ambito
frontend, web-dev
Tipo di issue
Funzionalità
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
25/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.