Comments (5)
Take a look at my old PR when I was adding the Apollo skeleton, just follow the same pattern: meteor/meteor#11119
from blaze.
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.
from blaze.
To make this work, the best way would be to replace internals of Meteor Tracker with Solid reactivity in a backwards-compatible way.
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 setTimeout
), so it would be cool to move Meteor over. I'm not sure how practical that is, but it would be neat to explore.
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 Tracker.autorun
, so in your example you could replace the Tracker.autorun
with
createEffect(() => {
console.log('meteor count is: ', meteorCount.get())
// map the Meteor reactive var to the Solid signal
setSolidCount(meteorCount.get());
})
And you also don't really need to synchronize Tracker and Solid state in this way, with autoTracker
on; you can just use Tracker state within Solid JSX like so:
function MySolidComponent() {
// Solid's JSX
return <div>The count is {meteorCount.get()}</div>
}
I don't think autoTracker
is as efficient as if we replaced Tracker with Solid, but this "workaround" lets us explore the original idea — Handlerbars → Solid JSX conversion — without needing to completely replace Tracker.
from blaze.
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?
from blaze.
Wow, yeah, autoTracker
really makes the integration magically easy, makes it feel as if Solid came with Meteor (although not as optimized).
(On the side that's quite amazing in general actually: it means we can write autoMobX
, autoKnockout
, etc, for all the dependency-tracking reactivity libs)
from blaze.
Related Issues (20)
- Move codebase to ES6 HOT 15
- spacebars-tests packages still uses removed code
- Blaze.remove() destroys DOM before calling onDestroyed() HOT 8
- Error handling, callbacks and DOMRange HOT 9
- Errors in onCreated callback cause a complete stop for rendering further Templates
- Bootstrap select picker is not correctly removed / disposed during Template descruction HOT 6
- Add benchmarks to tests
- SSR is broken in 2.6.0 HOT 4
- Add ts types HOT 3
- Be able to have more contentBlock in template HOT 1
- Non-primitives not fully reactive in 2.7
- Complete GitHub community standards HOT 7
- CI/CD for documentaiton
- observe-sequence has a bug when _ids have a period HOT 11
- Possibility of a release for people wanting to update to be able to migrate their templates to ASYNC? HOT 4
- Support for async dynamic attributes HOT 3
- Measure performance impact of recent async changes HOT 1
- TypeError: `Cannot convert undefined or null to object` in `waitForAllAttributesAndContinue` HOT 3
- Allowing arbitrary expressions
- Async Helpers are not reactive after the first "await" HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from blaze.