I started working on a (currently very simple) demo of using SolidJS as an alternative rendering engine for Meteor. Here’s the repo: GitHub - edemaine/solid-meteor-demo: Simple demo of SolidJS in Meteor
SolidJS was mentioned here previously but a quick summary: SolidJS code looks a lot like React, but builds fine-grained reactivity somewhat similar to Meteor’s Tracker, and runs component functions only once and reactively updates the template contents by treating {...}
in JSX as reactive closures. The result is clean code (e.g. <div/>
returns a DOM element — there is no virtual DOM) and extremely fast code. A lot of great ideas from React, Svelte, and Meteor.
The good news is that it’s relatively easy to enable SolidJS in Meteor, by modifying the Babel settings to use the SolidJS JSX compiler. There’s now also a plugin, edemaine:solid
, to do this automatically and more carefully. It’s also really easy to combine Meteor reactivity and SolidJS reactivity, though it should get even easier with some helpers along the lines of react-meteor-data, which I’m thinking about writing and there’s now a library solid-meteor-data
that makes this easy and efficient.
Some bad news (hopefully temporary):
-
To get SSR working, I think we need to modify the Meteor compiler to support different Babel options when compiling server vs. client-side code. If someone knows a way, let me know. Alternatively, it might be possible to make an alternative to theSSR works now, thanks toecmascript
plugin.edemaine:solid
. See below. -
I haven’t been able to get HMR working, I think because Meteor thinks the code looks like React so it’s automatically accepting the update; but I’m confused because all I get is “SSR connected” but no apparent updates.Basic HMR works now, thanks to Meteor 2.5.2! See below. - I can’t get the development mode of SolidJS to load (which offers some helpful checks/warnings). Related to this feature request.