GithubHelp home page GithubHelp logo

Comments (5)

StorytellerCZ avatar StorytellerCZ commented on June 6, 2024 4

Take a look at my old PR when I was adding the Apollo skeleton, just follow the same pattern: meteor/meteor#11119

from blaze.

StorytellerCZ avatar StorytellerCZ commented on June 6, 2024 2

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.

edemaine avatar edemaine commented on June 6, 2024 1

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.

edemaine avatar edemaine commented on June 6, 2024

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.

trusktr avatar trusktr commented on June 6, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.