luisherranz / deepsignal

DeepSignal 🧶 - Preact signals, but using regular JavaScript objects

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Mixing usage of deepsignal entrypoints leads to unexpected results

wittjosiah opened this issue · comments

Behaviour:

I don't have time to make a standalone reproduction, but wanted to make you aware of this issue.

  1. Import from deepsignal in one part of application code.
  2. Import from deepsignal/react in another part of application code.
  3. Have those two pieces of code interact with each other.
  4. Lose reactivity.

Observation:

Each entrypoint for deepsignal is bundled entirely separately and has their own WeakMap rather than the react entrypoint depending on the core entrypoint, which seems to make them incompatible with each other.

Expected behaviour:

I would have expected react to be a thin layer on top of core and for the two to be interoperable with each other within an application.

There's no benefit to using deepsignal when you also need deepsignal/react. My recommendation is always to use the react one. If you want to import an external package that uses deepsignal, you can alias it to deepsignal/react.

Closing now as not planned, but feel free to reopen if more issues arise 🙂