Skip to content

A component loader that loads and renders a component completely before displaying it. Prototype that might die....

Notifications You must be signed in to change notification settings

saabi/svelte-background-loader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

svelte-background-loader

This is a WIP component testing a potential approach towards loading and fully rendering components in the background prior to displaying them live.

For the moment it is meant only as a test. Do not use in production as it might be completely discarded later!

It's surely not correct , as it will probably need some support from Svelte that does not exist now.

This is what I have so far:

  • A BackgroundLoader component that accepts a prop referencing a Svelte component and a placeholder slot (for now)
  • when the prop changes, it instantiates the component and renders inside a <iframe style='display:none'>
  • upon a MutationEvent it installs load handlers for all s (for now... missing are handlers for any other resources that it might need to load)
  • When they're all loaded, it prunes the iframe and transfers the nodes to the live document. (This is where Svelte should finish tying up bindings and probably needs some core coding, missing for now)

Also missing right now is setting properties passed from the parent

About

A component loader that loads and renders a component completely before displaying it. Prototype that might die....

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published