-
-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error handling, callbacks and DOMRange #375
Comments
Hey @jankapunkt, thanks for your work and time. I'm a bit puzzled with all the back and forth and it helps me to have a specific problem to fix instead of thinking abstractly, so I pulled @distalx reproduction repository, and implemented the two proposed solutions in a locally cloned Blaze package: https://github.com/meteor/blaze/pull/366/files
So, would I be mistaken to assume that the current PR doesn't fix the aforementioned problem? Here's the repo I tested with in case you want to give it a spin too. Or the 'Must be attached' problem is completely indifferent to the #372? as @michaelcbrook seems adamant about adding the change. |
@harryadel yes the problem in #213 is not solved by #366 and is not directly related to #372, however the current PR #374 is intended only to fix #372 while #213 is not affected by it. I currently check out the example repo and see what I can find regarding the issue there. |
For better understanding: The error The error Now const _BlazeRemove = function (view) {
try {
Blaze.remove(view);
} catch (_e) {
try {
Blaze._destroyView(view);
view._domrange.destroy();
} catch (__e) {
view._domrange.destroy();
}
}
}; And this is also called when the yielded Template is destroyed: Template.yield.onDestroyed(function () {
if (self.old.template.view) {
_BlazeRemove(self.old.template.view);
self.old.template.view = null;
self.old.materialized = false;
}
self.yield = null;
}); plus on two other lines:
In my opinion we need to use a fork of |
Huh, that makes sense #366 was not an immediate fix to #213 but basically a solution to a problem you found along the way.
I agree with you. Maybe @dr-dimitru can chime in? Though, this insinuates if I removed the monkey patch from ostrio in my test repo, I'm bound to get different results? Let me see. Some side note, but it's unacceptable to merge in PRs with zero testing as in the case of #366 or #374. A regression test must be added for both. Finally, to get things moving instead of theorizing further, it may beneficial to merge in #374 (with tests ofc) according to #372 (comment) and release 2.6.1 then come up with 2.6.2 for #213 where we can include additional stuff like #373. Again, I really appreciate your efforts pushing this through and sorry for dipping on you. |
Not necessarily but I think we need to get rid of side-effects before testing to make sure this is not a bug introduced by the monkey-patch AND we can then also create a solution that may makes the monkey-patch obsolete.
I agree partially. It is not easy for people to setup a local Blaze project and link it to their current projects, which is why I though the RC-releases to be a good solution since they will never automatically get update but require explicit adding via
I also partially agree here. I think we should continue doing RC releases until we got it all tested with some running apps and if it's stable we can make
No offense taken here. I think we need to be very careful in this current situation to also keep the good name of Meteor and Blaze up. |
@jankapunkt @harryadel thank you for mentioning me. Sure, I'll run tests on my end and study this thread in detail this week. And update package if necessary to get it compatible with latest Meteor and Blaze releases |
@jankapunkt @harryadel I'm working on update. Closed most of the issues. Can you post here proposed changes or come up with PR? |
- 🧹 Codebase cleanup - 🔗 Related: meteor/blaze#372 - 🔗 Related: meteor/blaze#375 - 👷♂️ Removed unnecessary "monkey patching" around `Blaze.remove()`, thanks to @jankapunkt
__Major Changes:__ -⚠️ It is recommended to set `decodeQueryParamsOnce` to `true`, fixing #78, pr #92, thanks to @michaelcbrook -⚠️ By default use `{decodeQueryParamsOnce : true}` in tests -⚠️ Deprecated `staringatlights:inject-data`, in favor of `communitypackages:inject-data` -⚠️ Deprecated `staringatlights:fast-render`, in favor of `communitypackages:fast-render` __Changes:__ - 👷♂️ Merged #92, thanks to @michaelcbrook and @Pitchlyapp, fix #78 - 👨💻 Fix #93, thanks to @drone1 - 🤝 Support and compatibility with `communitypackages:inject-data` - 🤝 Support and compatibility with `communitypackages:fast-render` - 🤝 Compatibility with `meteor@2.7.3` __Other changes:__ - 📔 Overall documentation update and minor refinement - 👨🔬 Update test-suite to cover #93 - 🧹 Overall codebase cleanup - 👷♂️ Removed unnecessary "monkey patching" around `Blaze.remove()`, thanks to @jankapunkt - 🔗 Related: meteor/blaze#372 - 🔗 Related: meteor/blaze#375 __Dependencies:__ - 📦 `qs@6.10.3`, *was `v6.5.2`*
Thank you for your work @dr-dimitru. I see you already pushed a new version removing the monkey patch. I've reached out to Jan and we're going to look into it and try push things through in the next couple of days. |
This is now covered by release 2.6.1 so I'm closing this. |
After I investigated a bit further on #372 and #213 I found that my PR #366 is not a real solution:
onDestroyed
callback available, which is basically the same issue as in Blaze.remove() destroys DOM before calling onDestroyed() #372onDestroyed
which in the end prevented the DOMRange to be removedBlaze.remove
DOMRange must be attached
old:
new:
This together with #374 should be the right fix for issues relateded to #372 and #213
Note: I moved too quick with #366 so I thought we discuss this first, before moving on and creating a PR, since I don't like to add PRs that have to be reverted later on. Any thoughts on this @StorytellerCZ @harryadel
The text was updated successfully, but these errors were encountered: