Remove the single-blocking-import restrictions #1123
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Remove the is_blocking variable (and checks) from the ScriptManager. This is a holdover to when blocking imports had a dedicated connections, and thus couldn't be loaded concurrently.
This changes two obvious things (and probably a few subtle ones). The first is that plain async scripts are now free to be executed as soon as they are completed. As far as I can tell, this is a safe behavior, is simpler and should be a bit faster.
More importantly, it allows for chains of imports. normal import (A) -> dynamic import (B) -> normal import (C). This would previously fail an assertion. The superficial issue was that dynamic import handling didn't respect the
is_blockingflag. But if we did respect it, than module B would never be able to load module C, which would block module A from ever completing. By removing the flag, module C will now be properly evaluated, which unblocks module B which allows module A to unblock.(1) I believe this is the issue seen here:
#1121