webcomponents / webcomponents/custom-elements-everywhere

New test: custom elements should not cause infinite reactivity loops in signals-based libraries

Open
#2,324 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
1.3k
Forks
108
PR merge metrics
No merged PRs in 30d

Description

This test is namely for signals-based libraries. We need a test that shows that when a custom elements is rendered, none of its life cycle methods (`constructor`, `connectedCallback`, `adoptedCallback`, `disconnectedCallback`, and `attributeChangedCallback`) cause an infinite loop when reading the framework's reactive state.

Here's an example (and a good sample test case we can write) in Solid.js where it will infinite-loop and eventually crash by simply reading a signal in a custom element life cycle method:

- https://github.com/solidjs/solid/issues/2039

Besides this, we may want to include more libs, or lib combos, that use signals-and-effects patterns:

- Solid.js
- Preact with Preact Signals
- Lit with its wrapper around Preact Signals, `@lit-labs/preact-signals`
- React + MobX and others
- Vue with `ref()` API and `setup` mode
- Svelte 5 with its new Runes API
- etc

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.