-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
[Meteor 3] Stop loading packages in pararel #13074
Conversation
✅ Deploy Preview for v3-meteor-api-docs canceled.
|
WebApp uses top level await. This error indicates that the ddp-server starts loading before webapp finished loading. How core runtime works is:
The client is similar, except in development queueing the packages isn't synchronous since each package loads in a separate script. The core runtime still needs to ensure each package loads at the correct time. Instead of only waiting for its deps, it needs to wait for all of the previously queued packages (it's now a simple queue that runs one at a time). |
}); | ||
}); | ||
}) | ||
// TODO it looks like this function doesn't need to exist anymore |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function is still important for Meteor to know when packages and the app finished loading, including any async modules they have.
`Package["core-runtime"].queue("${options.name}", [`, | ||
orderedDeps.join(', '), | ||
'], function () {' | ||
`Package["core-runtime"].queue("${options.name}",`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should be able to completely remove the deps
option from fullLink, and replace it with a hasRuntime
option instead. This would also help with the linker cache so it isn't invalidated as often.
For more context: https://forums.meteor.com/t/order-of-loading-packages/61112.
We are getting error reports about the order in the packages that are being imported.
There isn't a bug. The code works by design, but the new brings some issues.
Solution
As @zodern suggested, I'm removing all deps code from
code-runtime
andlinker
.But It's not working correctly. I'm getting this error:
Inside
ddp-server
,Webapp
object is not being found, even though thewebapp
package loads first.I'll contact @zodern, and hopefully, they can set us on the right path.
Reproduction: https://github.com/plbkbx/testLoadingPackages (run this app with your local Meteor at this branch).