-
Notifications
You must be signed in to change notification settings - Fork 774
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
DO NOT MERGE maintenance: bundle miniflare #342
Conversation
🦋 Changeset detectedLatest commit: ce2a2dd The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
252f2d2
to
cb57836
Compare
Just for information... Before this PR:
After this PR:
|
@@ -1,6 +1,7 @@ | |||
.DS_Store | |||
node_modules/ | |||
wrangler-dist/ | |||
miniflare-dist/ |
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.
Could we change this so that the outputs all go into dist
? E.g.
dist
wrangler
cli.js
cli.js.map
miniflare
cli.js
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.
Then we only need to ignore dist
whatever else we decide to put in there.
More interesting info... main
This PR
So the size on disk is almost identical. But you can see that for this PR we download about a quarter as many items. |
So all-in-all, this looks like a good improvement. I think we should definitely consider bundling the miniflare library separately from the miniflare CLI, so we can reduce the duplication there (see the size increase in the bundle, above). Or alternatively work out a way to kick off miniflare for |
Unfortunately, calling the CLI is necessary so we can attach a debugger :( That's also why we're manually invoking the cli with |
Hey! 👋 This is a good idea. However, I looked into this and remember having a few issues with |
Thanks for the headsup! Aight, I'll make sure I handle |
I think a simple fix should be to just mark |
I not too sure, it either happened every time when returning a |
Ok thank you @mrbbot, I'm able to reproduce the issue. I'll park this PR until I fix it. Thanks for the assist, I appreciate you! |
This bundles miniflare into the wrangler package. We already bundled most other dependencies, this adds miniflare as well. Of note, it's actually bundling miniflare _twice_, once into the main bundle, and once separately as a cli to be called with `wrangler dev` as local mode. We could optimise this in the future as a separate package. Regardless, I expect this to anyway install fewer dependencies (naturally, because it's not a nested dep anymore) and roughly be the same size for download, so it should be a faster install.
cb57836
to
ce2a2dd
Compare
This PR has got a bit stale and is not crucial to getting to 2.0.0. |
This bundles miniflare into the wrangler package. We already bundled most other dependencies, this adds miniflare as well. Of note, it's actually bundling miniflare twice, once into the main bundle, and once separately as a cli to be called with
wrangler dev
as local mode. We could optimise this in the future as a separate package. Regardless, I expect this to anyway install fewer dependencies (naturally, because it's not a nested dep anymore) and roughly be the same size for download, so it should be a faster install.I don't think this should break anything else. This would've been a good usecase for the arbitrary npm publishes, haha. Anyway, we can test the alpha after we land this.
Closes #66