-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
ModernJS async boundary #3279
Draft
ScriptedAlchemy
wants to merge
57
commits into
master
Choose a base branch
from
vmok-async-boundary
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
ModernJS async boundary #3279
Changes from 9 commits
Commits
Show all changes
57 commits
Select commit
Hold shift + click to select a range
9df3cf5
use lerna 6 and uninstall any newer
ScriptedAlchemy 33e7ec5
Merge branch 'master' into lerna-v6
ScriptedAlchemy 6b30bf9
lerna 7 repair attempt
ScriptedAlchemy 2e01049
lerna 7 repair attempt
ScriptedAlchemy 8ceaca8
lerna 7 repair attempt
ScriptedAlchemy 2fa8001
vmok async startup
ScriptedAlchemy d7f30c1
vmok async startup
ScriptedAlchemy acc7833
improve await boundary
ScriptedAlchemy 8a1dd2f
improve await boundary
ScriptedAlchemy bf350aa
use lerna cmds
ScriptedAlchemy 73b82ab
Merge branch 'master' into nested-workspace
ScriptedAlchemy 3cef347
Merge branch 'master' into nested-workspace
ScriptedAlchemy 54df9e8
Merge branch 'master' into nested-workspace
ScriptedAlchemy 346c13d
private workspaces
ScriptedAlchemy d9699c3
Merge remote-tracking branch 'origin/nested-workspace' into nested-wo…
ScriptedAlchemy eeb0c86
private workspaces
ScriptedAlchemy d736cf2
private workspaces
ScriptedAlchemy 1e8def2
private workspaces
ScriptedAlchemy 54285f1
private workspaces
ScriptedAlchemy 1a37363
private workspaces
ScriptedAlchemy 1ef4a8c
cache yarn global cache always
ScriptedAlchemy 08fc9b7
cache yarn global cache always
ScriptedAlchemy 6dd8f88
cache yarn global cache always
ScriptedAlchemy 61bbe17
cache yarn global cache always
ScriptedAlchemy e4c237c
cache yarn global cache always
ScriptedAlchemy cb15351
parallel cache ci
ScriptedAlchemy 0c3c9f6
parallel cache ci
ScriptedAlchemy 4c94bc2
parallel cache ci
ScriptedAlchemy 8c25cc7
parallel cache ci
ScriptedAlchemy e1d7613
parallel cache ci
ScriptedAlchemy 250f39c
install cache restore global
ScriptedAlchemy a9df88f
install cache restore global
ScriptedAlchemy a6c885a
install cache restore global
ScriptedAlchemy 2e6b943
install cache restore global
ScriptedAlchemy d3bcdf0
install cache restore global
ScriptedAlchemy 8dc1b84
install cache restore global
ScriptedAlchemy a420f80
Merge branch 'master' into nested-workspace
ScriptedAlchemy a8b2fcf
install cache restore global
ScriptedAlchemy 9e5c70a
improve await boundary
ScriptedAlchemy dd97d66
improve await boundary
ScriptedAlchemy cfa2c2c
fix e2e in CI
ScriptedAlchemy e587b7b
fix e2e in CI
ScriptedAlchemy 9cf819e
cache node module on yarn hash
ScriptedAlchemy 6805da4
Merge branch 'master' into vmok-async-boundary
ScriptedAlchemy 5926135
cache node module on yarn hash
ScriptedAlchemy cc17c3b
cache node module on yarn hash
ScriptedAlchemy c110c49
cache node module on yarn hash
ScriptedAlchemy 7a10003
cache node module on yarn hash
ScriptedAlchemy c6d6497
feat: ModernJS implement async boundary.
ScriptedAlchemy 391df91
Merge branch 'modernjs-async-boundary' into vmok-async-boundary
ScriptedAlchemy db8ed3d
Merge branch 'master' into vmok-async-boundary
ScriptedAlchemy 279d86c
feat: ModernJS implement async boundary.
ScriptedAlchemy 4411093
improve await boundary
ScriptedAlchemy 5f3cb5c
Merge remote-tracking branch 'origin/vmok-async-boundary' into vmok-a…
ScriptedAlchemy 5b0028d
fix next quirks
ScriptedAlchemy 5f308e4
fix next issues
ScriptedAlchemy 6ac1e2f
Merge remote-tracking branch 'origin/vmok-async-boundary' into vmok-a…
ScriptedAlchemy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,12 @@ | ||
import('./bootstrap.js'); | ||
const promises = [] | ||
__webpack_require__.f.remotes('main',promises); | ||
await Promise.all(promises); | ||
console.log(promises) | ||
const thing = await new Promise((r)=>r('test')) | ||
console.log(thing); | ||
require('./bootstrap'); | ||
if(globalThis.neverTrue) { | ||
// dynamic import data uri | ||
import('data:text/javascript,export default 42'); | ||
} | ||
export default {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"version": "0.0.0", | ||
"npmClient": "yarn", | ||
"useWorkspaces": true | ||
"$schema": "node_modules/lerna/schemas/lerna-schema.json" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,4 +39,5 @@ testem.log | |
Thumbs.db | ||
|
||
# Next.js | ||
.next | ||
.next | ||
.nx/cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,5 @@ | |
|
||
/dist | ||
/coverage | ||
|
||
/.nx/cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
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.
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.
hardcoded to main as proof of concept, in reality this would be part of codegen, injected into all entrypoint modules, each passing their own chunkID to the handlers.
effectively making startup asynchronous.
You can also export require(bootstrap) back out, however - the entrypoint will always export a promise. If webpack is handling this entrpoint loading, then async modules will resolve their inner promises. If not, your entrypoint will always export Promise.resolve(module.exports).
In most cases this should not be a problem, as the act of loading an entrypoint is async in ietslf so much should not experience an issue.
The other option involves replacing entrypoint startup code with a promise based export
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.
not required if we use the AsyncBoundaryPlugin from modernjs example