Repository navigation
fix(node): allow fetch override on runtime plugin - #2603
Conversation
🦋 Changeset detectedLatest commit: 71b0887 The changes in this PR will be included in the next version bump. This PR includes changesets to release 26 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
✅ Deploy Preview for module-federation-docs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
| return callback(null, emptyChunk); | ||
| } | ||
| fetch(url) | ||
| const fetchFunction = globalThis.webpackChunkLoad || fetch; |
There was a problem hiding this comment.
core/packages/runtime/src/core.ts
Line 105 in 05c43f3
Maybe we can set fetch through fetch hook instead of using global variables
There was a problem hiding this comment.
@zhoushaw do you have a sample of how to use the fetch hook?
I do not think it is bound to script loader, only json manifest loader
This provides backward compat for user, but i am happy to look at better solution for future and deprecate this usage
quantum-1986
left a comment
There was a problem hiding this comment.
Thank you! The fix works: #2534 (comment) 👏
Co-authored-by: Matteo Pietro Dazzi <matteopietro.dazzi@gmail.com>
Co-authored-by: Matteo Pietro Dazzi <matteopietro.dazzi@gmail.com>
…erride' into fix/allow-node-runtime-plugin-override
|
@quantum-1986 - im working on integrating the chunk load cycle on the server with our runtime apis, so you can now do the following: You can do this as a hook from the runtime plugins docs. |
db0f648 to
3ed5ffb
Compare
3ed5ffb to
b121e85
Compare
fb9f6f5 to
433985c
Compare
433985c to
48625ef
Compare
|
|
||
| // @ts-ignore | ||
| const hook = (url: RequestInfo | URL, init: RequestInit) => { | ||
| debugger; // Add debugger for hook |
48625ef to
71b0887
Compare


Description
Allow internal fetch method to be overriden
Related Issue
fixes: #2534
Types of changes
Checklist