Meteor Tracker.autorun 在代码结构更改后不会更新
我们即将放弃后端的流星(因为构建时间越来越长以及其他原因),并且刚刚将大量核心代码(共享类型等)移动到我们存储库中的“共享”文件夹中,以便也在新后端中使用类型定义。
经过三周的开发,我现在想测试旧版流星后端是否仍然有效。嗯,确实如此,但是同样由 Meteor 构建的遗留客户端突然不会做任何反应性的事情。
以下代码仅打印“Tacker Update 0”和多次“Interval”
let i = 0;
dep = new Tracker.Dependency()
Tracker.autorun(() => {
dep.depend()
console.log(`Tracker Update ${i++}`)
})
Meteor.setInterval(() => {
dep.changed();
console.log("Interval")
}, 1000);
当执行
Meteor.setInterval(() => Tracker.flush(), 100)
跟踪器时,跟踪器似乎“工作”,但这不是必需的,代码中存在一些明显的问题,导致跟踪器无法正常工作,但我不知道如何找到它,因为 git-bisect 在这里不起作用(首先使新后端起作用,同时忽略具有导入路径等的旧后端)。
有什么想法我可以看吗?
We are just about moving away from meteor in the backend (as the builds take longer and longer and other reasons) and have just moved a lot of core code (shared types, etc.) to a "shared" folder within our repository in order to use the type definitions in the new backend as well.
After three weeks of developing, I now wanted to test if the legacy meteor backend still worked. well, it does, however the legacy client which is also built by meteor suddenly wont do anything reactive.
The following code just prints "Tacker Update 0" and multiple times "Interval"
let i = 0;
dep = new Tracker.Dependency()
Tracker.autorun(() => {
dep.depend()
console.log(`Tracker Update ${i++}`)
})
Meteor.setInterval(() => {
dep.changed();
console.log("Interval")
}, 1000);
When doing a
Meteor.setInterval(() => Tracker.flush(), 100)
the tracker seems to "work", however that shouldn't be necessary, there is some obviously problem in the code that makes the Tracker non-functional, but I have no clue how to find it as git-bisect won't work here (made the new backend functional first while ignoring the old one with import paths etc).
Any ideas where I could look?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论