-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Standard Signals #39
Standard Signals #39
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hell yeah!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor suggestions
Hello @justinfagnani n.n Nice to meet you. So, when In that sense, |
Co-authored-by: Augustine Kim <ajk830@gmail.com>
Co-authored-by: Augustine Kim <ajk830@gmail.com>
Co-authored-by: Peter Burns <rictic@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
my suggestions have been addressed
@redfox-mx the mention of support for other signals packages in the Preact signals RFC is acknowledging the interop problem of having many incompatible userland signals implementations. Standard signals would solve this problem. In that sense, this RFC would be the right way forward and However, they would both be labs packages for some time, and the underlying signals implementations aren't compatible, so if you're already using Preact signals elsewhere, you'd want to use |
Thanks y'all. Merging RFC |
@justinfagnani glad I searched before starting to write a For others looking for the referenced PR: lit/lit#4615 |
Fixes #39 This PR: - adds `signal-polyfill` as a dependency - replaces our signals implementation with the native signals proposal polyfill - introduces a vanilla browser bundle via esbuild **Background**: It looks likely that [reactive signals will become a language feature](https://github.com/proposal-signals/proposal-signals). TC39 signals are meant to be a lower-level primitive that is wrapped in a library. We're going to adopt signals by wrapping these low-level features in a higher-level API. The library API for Spellcaster will not change. Using native signals has some significant advantages: - Standard signals act as a Schelling point for the ecosystem. - Many libraries are contributing to the spec and/or adopting. - For example, [Lit is implementing signal support](lit/rfcs#39), so adopting native signals would mean Spellcaster *just works* with Lit. - It seems plausible that future platform APIs may use them as well. - All libraries that use TC39 signals under the hood will share the same signal graph, even if they expose different surface-level APIs. - Spellcaster becomes even smaller.
Getting an RFC up before I put up a PR for the
@lit-labs/signals
package. Copied and edited from the Preact signals RFC.