Skip to content

Conversation

@karlseguin
Copy link
Collaborator

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_blocking flag. 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

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_blocking` flag. 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
Copy link
Member

@krichprollsch krichprollsch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks simpler this way.

@karlseguin karlseguin merged commit 33d737f into main Oct 6, 2025
10 checks passed
@karlseguin karlseguin deleted the blocking_scripts branch October 6, 2025 07:57
@github-actions github-actions bot locked and limited conversation to collaborators Oct 6, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants