Skip to content

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

@trusktr

Description

@trusktr

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:

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions