We're working on a way to write a Lit html template that will automatically handle signals. The core of the implementation is:
values.map((v) => v instanceof Signal ? watch(v) : v)
However, this will not work properly if a user has multiple versions of @preact/signals-core in their node_modules tree, as it will only detect whatever version of Signal was imported in our library. Ideally, people wouldn't end up with multiple versions of signals in their node_modules of course, but in practice we find that users end up with multiple versions in their node_modules even within a single major version.
We're working on a way to write a Lit html template that will automatically handle signals. The core of the implementation is:
However, this will not work properly if a user has multiple versions of
@preact/signals-core
in their node_modules tree, as it will only detect whatever version of Signal was imported in our library. Ideally, people wouldn't end up with multiple versions of signals in their node_modules of course, but in practice we find that users end up with multiple versions in their node_modules even within a single major version.What we'd like is something like this to work: