-
-
Notifications
You must be signed in to change notification settings - Fork 97
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
Implement Effect, Computed and Signal classes as ES5 classes #160
Conversation
|
eb85073
to
6e3bdbd
Compare
✅ Deploy Preview for preact-signals-demo ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
Size Change: -180 B (0%) Total Size: 67.5 kB
ℹ️ View Unchanged
|
The test failure is caused by a bug in babel's typescript plugin. Filed an issue there: babel/babel#14945 |
@jviide This should be ready to be merged once rebased. CI passes locally 🎉 |
Doesn't this reveal a problem with Node v18 though? Seems very strange and not at all what I'd expect. @mcollina this make sense at all to you? |
This pull request implements the Effect, Computed and Signal classes as ES5 classes.
Added a workaround for a weird performance cliff that I encountered with Node.js 18.9.0. The workaround itself is in commit 64d0ab0. For some reason the TypeScript compiled version was faster than the hand-rolled ES5 classes when running this benchmark:
In the end it turned out that TypeScript wrapped the Computed prototype definitions into an IIFE. Adding that same IIFE to the hand-rolled ES5 version boosted the performance back to TypeScript-compiled levels 🫠