zodern / melte

Svelte compiler for Meteor with built in tracker integration and HMR
MIT License
33 stars 14 forks source link

Trackers not working as intended #25

Open tbelmar opened 1 year ago

tbelmar commented 1 year ago

Hey!

I'm working on a meteor project that makes use of zodern/melte's $m functionality. We use Meteor sessions to set and get information about toasts so the app can appropriately display them. We have the following reactive block, which from my understanding should keep track of when the session variables change, but does not.

image

This reactive block does not run when the session variables change as intended.

When I change the reactive block to a Tracker.autorun block, it works completely fine and as intended. My understanding was that $m and Tracker.autorun should have the exact same behavior.

Additionally, if I self-reference the above variables like so it also fixes the issue: image

It's worth pointing out that this has happened in other places in our app, namely with subscriptions to Meteor publications, but this was the simplest example I could come by.

These reactive blocks were not causing this issue a couple of months ago (I remember them working around the middle of September, but I'm unsure of when they stopped working).

Please let me know if you need any more information. Thanks!

tosinek commented 1 year ago

Same issue for me. I am migrating a Blaze app (maybe that is important to say?). At first it was working fine I think, but eventually the reactivity stopped working. Zodern told me to investigate the transpiled code in .meteor/local/build/programs/web.browser/app/app.js . I haven't had time to do it yet. Re-referencing the variable in the block helps. I ended up using svelte-meteor-data's useTracker instead (not as nice syntax though).

tosinek commented 1 year ago

Removing svelte-meteor-data seems to be fixing the issue. Could you please try that?

csellis commented 1 year ago

Removing svelte-meteor-data seems to be fixing the issue. Could you please try that?

This worked for me. 👍 meteor remove rdb:svelte-meteor-data

vpalos commented 1 year ago

Also confirming that this works for me!