-
Notifications
You must be signed in to change notification settings - Fork 1.1k
refactor(wrangler): add metafile flag, pass to build functions, adjus… #8716
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
Conversation
🦋 Changeset detectedLatest commit: 37250ad 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 |
emily-shen
left a comment
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.
Hey, thanks for putting this PR up, sorry its been sitting a while - dev week has been a bit hectic :)
Couple of things:
- can you rebase on main? the original pr was from quite a while ago, and there's been some refactoring in the deploy command.
- can you add a changeset?
ad64979 to
8a71cb7
Compare
9d79b21 to
c8cc2be
Compare
|
@emily-shen I added a changeset, rebased, cleaned up and adjusted the PR to point to main. If there's any adjustments I can make let me know! |
|
A Wrangler prerelease is available for testing. You can install this latest build in your project with: npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/14973160571/npm-package-wrangler-8716Prereleases for other packages:
wget https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/14973160571/npm-package-cloudflare-workers-bindings-extension-8716 -O ./cloudflare-workers-bindings-extension.0.0.0-v20eb42421.vsix && code --install-extension ./cloudflare-workers-bindings-extension.0.0.0-v20eb42421.vsix
npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/14973160571/npm-package-create-cloudflare-8716 --no-auto-update
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/14973160571/npm-package-cloudflare-kv-asset-handler-8716
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/14973160571/npm-package-miniflare-8716
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/14973160571/npm-package-cloudflare-pages-shared-8716
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/14973160571/npm-package-cloudflare-unenv-preset-8716
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/14973160571/npm-package-cloudflare-vite-plugin-8716
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/14973160571/npm-package-cloudflare-vitest-pool-workers-8716
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/14973160571/npm-package-cloudflare-workers-editor-shared-8716
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/14973160571/npm-package-cloudflare-workers-shared-8716
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/14973160571/npm-package-cloudflare-workflows-shared-8716Note that these links will no longer work once the GitHub Actions artifact expires. |
|
Here's something cool that we can explore potentially after this patch too, with an --analyze flag for example, if I link the latest version of this PR to a simple hono project and add the following script to my pacakge.json: Using esbuild-visualiser since it runs locally and was easy to add to the command here, but there's alternatives like https://github.com/filipsobol/sonda too. I get the following when I run |
6463630 to
edaf351
Compare
|
@emily-shen Thanks for the review, I've done the changes you requested and simplified the flag description. |
|
@ItsWendell Thanks for the PR and sorry for the delay. Could you please work on a doc PR (https://github.com/cloudflare/cloudflare-docs) or at least create an issue there. Please mention me ( |
emily-shen
left a comment
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.
lgtm pending some minor changes! let me know if you need a hand with docs, and thanks so much for the contribution 🧡
|
Congratulations @ItsWendell, the maintainer of this repository has issued you a holobyte! Here it is: https://holopin.io/holobyte/cmal7025c09130djsl1bsd50u This badge can only be claimed by you, so make sure that your GitHub account is linked to your Holopin account. You can manage those preferences here: https://holopin.io/account. |
|
Many many thanks @ItsWendell for implementing this 🔥 |
|
Awesome feature, thanks to @ItsWendell and @emily-shen 🙏 |
|
As a potential follow-up, it would be cool if wrangler had a built-in bundle analyzer.
Or something similar, are you open to discussing this and how it would fit within the repository? E.g. by using CLI-based output or potentially one of the few open source projects / dependencies that take an esbuild metafile and shows a GUI web interface for it, as a optional dependency, or something self built? |
|
@ItsWendell feel free to start a discussion (ping me there so that I get notified). IMO we don't want to add this to the workers-sdk because that it something we would have to maintain. There is also https://esbuild.github.io/analyze/ already and improving that is probably is better idea rather than duplicating. But again if you start a discussion, we can discuss internally to see if others have a different opinion. |

Additionally adds a --metafile flag and adjusts tests and added it to all build flows.
fixes #4633
(first attempyt #7927)
--metafileflag topages functions buildandwrangler deploycloudflare-docs#22349