-
Notifications
You must be signed in to change notification settings - Fork 20
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
Add bundlewatch/bundlewatch
to dev dependencies.
#819
Conversation
to monitor our progress in reducing bundle size. Fixes #818.
Small research for
|
I think the above gives us precedence to trust the |
@tomalec , I love the analysis you posted, good stuff 🙂 👍
That got me curious. I looked into both
I tried to google for comparisons between the two to find out which is better, but there isn't any helpful info on this. So my question here is: given its popularity, should we consider using |
AFAIK
Check the latest release dates:
|
Thanks @tomalec for looking into this and especially for searching around in this comment to look for existing usages within Woo/A8C
I think both BundleSize and BundleWatch area already approved for the Woo org. I like the idea of using Actions (especially now the repo is public) - we'll likely use more - but happy for us to try BundleWatch and revisit it and see if the previous areas of concern have improved. I leave @ecgan and @eason9487 to comment/feedback/review before merging |
@tomalec ,
Hey, thanks for that! I didn't notice that. Google search should have shown me that 😆
And I did not notice that too. I did notice that on https://www.npmjs.com/package/bundlesize, the latest release is With all the above said (including your good findings), I think I would lean towards bundlewatch now. Just hoping that it can do everything that |
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.
Tested as per instruction, working good, LGTM 👍
package.json
Outdated
"bundlewatch": { | ||
"files": [ | ||
{ | ||
"path": "./js/build/*.js", | ||
"maxSize": "2 kB" | ||
}, | ||
{ | ||
"path": "./js/build/index.js", | ||
"maxSize": "1 mB" | ||
}, | ||
{ | ||
"path": "./js/build/*.css", | ||
"maxSize": "1 kB" | ||
}, | ||
{ | ||
"path": "./js/build/index.css", | ||
"maxSize": "8 kB" | ||
}, | ||
{ | ||
"path": "./google-listings-and-ads.zip", | ||
"maxSize": "12 mB", | ||
"compression": "none" | ||
} | ||
] |
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.
💅 Personally I would prefer to put these into a separate file like .bundlewatch.config.js
and have bundlewatch to automatically read the file, unfortunately currently bundlewatch requires us to specify it in the command line like bundlewatch --config .bundlewatch.config.js
(see the documentation), which is an unnecessary friction in my opinion. Hopefully they can support that in the future.
So with that said, good to have this bundlewatch
section here in this package.json
so that we can just run npx bundlewatch
. 👍
I tried adding GitHub action for bundlewatch, for example below. So I fall back to running it on Travis-CI, where it works out of the box. name: bundlewatch
on: [push]
jobs:
build:
if: "!contains(github.event.commits[0].message, '[skip ci]')"
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v2
- name: Install npm dependencies
run: npm ci
- name: Build
run: npm run build
- name: Run bundlewatch
run: npx bundlewatch
env:
BUNDLEWATCH_GITHUB_TOKEN: ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}
CI_COMMIT_SHA: ${{ github.event.pull_request.head.sha }}
CI_BRANCH_BASE: ${{ github.base_ref || 'trunk' }} |
GitHub Actions are a bit too problematic, see #819 (comment)
1487571
to
490c980
Compare
GitHub Actions are a bit too problematic, see #819 (comment) Remove redundant `npm ci` from `Coding standard check`. Increase maxSizes of bundles.
163c4b1
to
ed9cbc7
Compare
"ci": { | ||
"trackBranches": ["trunk", "develop"] | ||
} |
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.
@tomalec , just noticed this, really minor nitpick: the three lines here are using space indentation instead of tabs like other lines. 😄
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.
I'd address it in #869
Changes proposed in this Pull Request:
Add
bundlewatch/bundlewatch
to dev dependencies.to monitor our progress in reducing bundle size.
Fixes #818.
Screenshots:
Detailed test instructions:
npm install
npx bundlewatch
To be done:
Changelog entry