This repository has been archived by the owner on Aug 29, 2021. It is now read-only.
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.
This resolves #63 and #64 by implementing two architectural changes:
Instead of changing
InnerModuleEvaluation
, it is left exactly as it was. Then we create a newInnerModuleEvaluationAsync
that acts specifically on async module graphs. We then separately collect "asyncDependencies" and "syncDependencies", where the new algorithm is to wait on the async dependencies, then execute the sync dependencies in order, immediately followed by synchronously executing the module itself, thus retaining the property that sync chains remain sync even when a new async dependency is added (exactly supporting the case described in #64 (comment)).That still leaves the following case:
A.js
B.js
c.js
D.js
Where in the above the logs will appear in order, with synchronous execution happening between "two" and "three", but not "three" and "four".
To get synchonous execution between "three" and "four" in the above, we need to ensure that an AsyncModule with a synchonous module body importing a synchronous module remains synchronous. And to do this, we update the dependency fulfillment to use execution task handlers over promises.