Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change lifecycle #24

Open
tomalec opened this issue Jul 4, 2016 · 0 comments
Open

Change lifecycle #24

tomalec opened this issue Jul 4, 2016 · 0 comments

Comments

@tomalec
Copy link
Member

tomalec commented Jul 4, 2016

Currently we do all the work (importing, fetching and stamping elements, attaching the model) on attachedCallback.

What if we:

  1. Import nodes on createdCallback and every content attributeChangeCallback even when detached
  2. Attach model on createdCallback, every model attributeChangeCallback, once new content is imported, before it's (re-)stamped.
  3. Attach nodes after element is atached
  4. Detach nodes once element is detached (keeping the reference)

@warpech @miyconst WDYT?

Benefits:

  • we could start importing content sooner => improve FOUC
  • we could access the imported content before stamping in more gently way (default layouts for juicy-composition)
  • we could easier move imported-template-scope magic to separate component, that will plug-in to this

Risks/Doubts:

  • imported elements will be created before attached to main document, so if they well created with such assumption they mail fail (however it is a bad practice anyway)
  • flow may seem more tangled (however, I believe that with proper explanation in may be easy to get)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants