-
Notifications
You must be signed in to change notification settings - Fork 26
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
feat: setup bundlesize #914
Conversation
Huuzaaah. |
I added the token to our CI variables. I'm not sure if anything is missing 🤔 |
bundlesize.config.json
Outdated
"files": [ | ||
{ | ||
"path": "./dist/ui-kit.esm.js", | ||
"maxSize": "175 kB" |
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.
Hmm are you sure this is correct?
https://bundlephobia.com/result?p=@commercetools-frontend/[email protected]
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.
Can you give more information? What is correct? The max size?
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.
Yes the max size...currently it's like >700KB
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.
No, it's correct. When I run bundlesize it gives ~165.
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.
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.
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.
In fact I think we should lower this. It should be maybe ~5%
@@ -122,6 +122,7 @@ | |||
"babel-plugin-transform-rename-import": "2.3.0", | |||
"babel-preset-jest": "24.6.0", | |||
"browserslist": "4.6.3", | |||
"bundlesize": "0.18.0", |
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.
We also need to trigger the bundlesize on CI...
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.
how do we do this? I can't find instructions
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 added the token to our env vars
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.
Just add a step on CI to execute bundlesize
. That's it.
After this:
Line 36 in 20cd7a4
- run: yarn build |
Just add
- run: yarn run bundlesize
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.
done
.circleci/config.yml
Outdated
@@ -131,6 +135,12 @@ jobs: | |||
- install_dependencies | |||
- restore_workspace | |||
- bundle_test | |||
bundle_size_test: |
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.
No new job please, just keep it simple: #914 (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.
Thanks, this looks good now! 💯
Should I add this to app kit as well? 🤔 |
5888156
to
ad2cff1
Compare
Summary
Adds
bundlesize
to track our bundlesize in PRsCloses #829