Repository navigation
feat(wrangler): add support for experimental code splitting - #9240
ItsWendell wants to merge 1 commit into
Conversation
🦋 Changeset detectedLatest commit: dd8c646 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 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 |
219da67 to
170d3ed
Compare
170d3ed to
ec43022
Compare
ec43022 to
dd8c646
Compare
|
@vicb would love to get your thoughts on this. Currently we load in the additional / code split modules exported by esbuild as I'm unsure about properly resolving the source maps for these additional code split modules too, in an initial test that I ran, it isn't resolving properly, would love to get some pointers there too. Where runAction = await import("./module");
runAction.default(); |
I commented on the linked feature request. We probably do not want to add code (test and maintenance burden) if there is no clear pros. |
|
Fair enough, I didn't realize that in cloudflare/workerd#2372 someone ran a benchmark for code / bundle split workers / pages, and that work needs to happen still to improve performance there. It sounds like it would still be beneficial to have those perf optimizations in workerd, but until that time, this PR is less relevant! |
|
Closing this until we start working on the feature request (#7344) when the new module registry is around. |

Implements #7344
Describe your change...
Add support for experimental code splitting for workers during build / deploy, this allows for dynamic imports and such
await import("./module")to be code split using esbuid's built-in experimental code splitter. Optimizing performance of the worker, potentially memory-usage and worker startup time.The following feature request clearly indicates benefits of having this: #7344
Resources:
https://esbuild.github.io/api/#splitting
Before:

After:
