-
Notifications
You must be signed in to change notification settings - Fork 140
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
feat(plugin-asset-retry): support async chunk retry #2086
Conversation
✅ Deploy Preview for rsbuild ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
052a17e
to
9bc1df7
Compare
6be522b
to
c9221b5
Compare
066c791
to
4788b75
Compare
00cbe76
to
628e05d
Compare
|
||
// If the requested failed chunk is async chunk,skip it, because async chunk will be retried by asyncChunkRetry runtime | ||
if ( | ||
window && |
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.
When will the window be undefined here
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.
when target is web-worker? I don't know.
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.
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.
Also window && xxx
is not a valid way to judge, usually we use typeof window !== 'undefined' && xx
e8dba37
to
7b488a4
Compare
@SoonIter |
Summary
Design
We will rewrite
__webpack_require__.ensureChunk
and__webpack_require.loadScript
to achieve this feature.__webpack_require__.ensureChunk
is a way how webpack loads async chunks and it returns a promise. We intercepted the error of this Promise.__webpack_require__.loadScript
is to calculate the request url and it defines thesrc
of<script>
and we intercepted the url calculationRelated Links
close #91
Checklist