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

Add support for context #18

Merged
merged 22 commits into from
Oct 3, 2023
Merged

Add support for context #18

merged 22 commits into from
Oct 3, 2023

Conversation

patricknelson
Copy link
Owner

@patricknelson patricknelson commented Sep 30, 2023

Addresses #10 by implementing context support at the custom element level. Also, supersedes #12 since requestAnimationFrame() is already part of the implementation. 😎

Tasks:

…instantiating them outside of their context (before it's parent has initialized it or not inside of parent).
…ment tag definitions) to facilitate testing of context.
…hadow DOM rendering, ensuring components are rendered/initialized from the top down (at least in light DOM, WIP for shadow).
…re querySelectorAll() for compatibility across both light DOM and shadow DOM (since that always returns document order, per spec). Cleaning up some console logs and debug code.
…te-retag-render', as it's only necessary for render. Cleans final rendered HTML (leaves no extra attribs behind).
…up unnecessary mutex/semaphor for requestAnimationFrame. Refactoring queueForRender() for simplicity and reducing redundancy there, too.
@vercel
Copy link

vercel bot commented Sep 30, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
svelte-retag ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 3, 2023 8:42am

…ll need to optimize heavily (without breaking context).
…ng of element attributes to component props without having to instantiate it any extra times (which not only can break context but also is likely unexpected in many situations). So, 1.) We can pass case-sensitive props at FIRST instantiation and then 2.) Retain them for mapping back if/when attributeChangedCallback() is called later.
…to ensure immediate results. Also ensuring we wrap with <svelte-retag> for now in Shadow DOM tests instead of <div>; it was replaced since it potentially adds extra formatting that we may not want.
…mock that ensures each queued callback runs to completion AND runs in sequential order (i.e. preventing nesting). Found quirk after first unit test made for validating context that couldn't be resolved (parent didn't complete initialization before child attempted to render).
@patricknelson patricknelson marked this pull request as ready for review October 3, 2023 08:44
@patricknelson patricknelson merged commit 759e333 into main Oct 3, 2023
3 checks passed
@patricknelson patricknelson changed the title WIP: Add support for context Add support for context Oct 3, 2023
@patricknelson patricknelson deleted the issue-10-context-support branch November 17, 2023 23:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant