-
-
Notifications
You must be signed in to change notification settings - Fork 115
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
Handlebars syntax is not bad at all, we can make it faster than React, Vue, or Svelte #361
Comments
I think this is a very interesting direction; Solid's reactive system is extremely close to Tracker, but IMO is slightly better and modern (e.g. it doesn't rely on As an alternative for this part, though, I wrote a function called autoTracker that (thanks to recent interoperability features in Solid) integrates Tracker and Solid so that Solid's reactivity behaves like it's also wrapped in
And you also don't really need to synchronize Tracker and Solid state in this way, with function MySolidComponent() {
// Solid's JSX
return <div>The count is {meteorCount.get()}</div>
} I don't think |
I have just looked on Solid today after the results of State of JS. Looks interesting and I like the ideas here. Though I think the first step should be to create a Meteor skeleton to make it super easy for people to get started with Solid & Meteor. Next if we can improve Tracker with inspiration from Solid that would be a great benefit to all Meteor users. As for migrating Blaze to use Solid, I think we can first gain a lot from the above mentioned steps as they will more people to explore Solid and what it brings to table which in turn will give us more insight into this. |
I was also thinking a version of the tutorial for Meteor + Solid would be helpful. I started this a bit. Is there a pointer for how to add a template to Meteor? |
Take a look at my old PR when I was adding the Apollo skeleton, just follow the same pattern: meteor/meteor#11119 |
Wow, yeah, (On the side that's quite amazing in general actually: it means we can write |
Summary
The new component system Solid.js looks like React (because it uses JSX syntax), but it compiles to something way better using dependency-tracking reactivity just like Meteor's reactive variables and tracker autoruns (called "signals" and "effects" in Solid).
This makes Solid.js an excellent pairing for Meteor because the paradigms match perfectly.
I believe we can use a package like https://www.npmjs.com/package/handlebars-to-jsx to compile Blaze templates into super fast Solid.js runtime equivalent to what Solid.js compiles JSX to.
Background
To give a brief example, here's how to use Solid inside of Meteor:
MySolidComponent
compiles to something like the following (simplified, this hand written version is less optimized):How
To make this work, the best way would be to replace internals of Meteor Tracker with Solid reactivity in a backwards-compatible way. Then, with a handlebars-to-JSX transformation convert HTML to the JSX output (possibly optimized to avoid a JSX step, and just go straight to equivalent output).
Why
Solid has gained popularity because of its simplicity, and performance. It beats well-known libs in some benchmarks, without sacrificing dev experience (actually improving it in various cases, for example compared to React). The JS Framework Benchmark is one example benchmark.
(@ryansolid @edemaine)
The text was updated successfully, but these errors were encountered: