Open RobertLowe opened 9 years ago
Hi Robert - what bad behavior did you observe as a result of this?
On Feb 12, 2015, at 4:28 AM, Robert Lowe notifications@github.com wrote:
Just ran into this.
https://github.com/Differential/polymer-demo/blob/master/client/init.coffee#L3
https://github.com/meteor/meteor/blob/devel/packages/session/session.js#L1 https://github.com/meteor/meteor/blob/devel/packages/reactive-dict/migration.js
ReactiveVars are not automatically migrated across hot code pushes, whereas Session state is.
http://docs.meteor.com/#/full/reactivevar
— Reply to this email directly or view it on GitHub.
Yea reactive var is probably a better way to do it. One of the issues that all this is attempting to fix could return. The goal of this little dance is to wait until polymer is ready before we even attempt to render our meteor templates via IR, which contain polymer elements. If polymer is not ready by the time they render, helpers and events on them could attempt to use polymer functionality on those elements before they have been upgraded. On a related note, we need to render IR to a child element due to an apparent incompatibility between some polymer interaction with the <body>
tag and the way a default IR configuration uses blaze's event delegation. By default, Blaze delegates all events to the parent of the template the event map is defined on. IR overrides this behavior a bit by passing <body>
as the parent element whenever it instantiates a new template instance, which delegates all events up to <body>
. At some point, polymer seems to clobber this setup. By setting a child element as the root for IR we can avoid all that.
Reactive variables are being used now instead of Session which does make sense to me.
Yea, that's what I did in the application I'm working on. ReactiveVar
ftw
Just ran into this.
https://github.com/Differential/polymer-demo/blob/master/client/init.coffee#L3
https://github.com/meteor/meteor/blob/devel/packages/session/session.js#L1 https://github.com/meteor/meteor/blob/devel/packages/reactive-dict/migration.js
http://docs.meteor.com/#/full/reactivevar