Comment

Comment by pyentropy

The implementation involves unsafe monkey-patching:

1. For React, a hook is injected into every single component (!) regardless of whether it uses signals or not via __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.

2. For React, React.createElement is patched so that it can render signal values as Text nodes.

3. For Preact, they claim it's using a "pluggable renderer", yet they monkey-patch the global shouldComponentUpdate (and they don't call the old one so they break other patchy libraries)

[1] - https://github.com/preactjs/signals/blob/d25e8bac09c94ed3bad...

[2] - https://github.com/preactjs/signals/blob/d25e8bac09c94ed3bad...

[3] - https://github.com/preactjs/signals/blob/d25e8bac09c94ed3bad...

parent pyentropy 4 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton