Skip to content

Change lifecycle #24

@tomalec

Description

@tomalec

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)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions