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

Components #4

Closed
estrattonbailey opened this issue Jan 8, 2018 · 1 comment
Closed

Components #4

estrattonbailey opened this issue Jan 8, 2018 · 1 comment

Comments

@estrattonbailey
Copy link
Owner

estrattonbailey commented Jan 8, 2018

So mount() and unmount() are much trickier than they would appear at first glance. I think that's the main barrier to having "components" as you would think about them in something like React.

As filed here, on-load correctly fires onunload when replaceChild(next, prev) is fired, because for a short period of time (I assume one tick, but a setTimeout(() => {}, 0) does not work) the DOM node is actually not present in the DOM. on-load is doing its job correctly. Since there is no reference to the node for a split second during that time, I'm having trouble finding a good way to tell if the node removal was in the act of morphing the DOM, or actually a valid unmounting, like from a route change.

Other issues

A good outline (from Choo) is here. It also references a few issues that I'll also need to ensure are addressed and tested and added to docs:

Additionally:

Other ideas

Questions

  1. On global state updates, they're currently morphing on a local level, and returning the morphed ref. How does this affect the top-level morph operation? Does it essentially morph twice (I don't think so) or does it result in the same node? (this should be what happens)
  2. How can I better utilize .isSameNode() or expose it for users?
@estrattonbailey
Copy link
Owner Author

No longer needed after #5 🤓

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

No branches or pull requests

1 participant