-
Notifications
You must be signed in to change notification settings - Fork 234
fix: do not include yarn-related files in released bundle #379
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
fix: do not include yarn-related files in released bundle #379
Conversation
|
Oh my - thanks for spotting that and posting a PR |
mikehardy
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.
Ok - all looks good. Thanks again
Appears it's time to test the re-automation of releases here in combo with NPM Trusted Publish. All pretty fresh. Hope it works! If not I'll have some fixups to do but I'll get this shipped
| .idea | ||
| yarn/ | ||
| .yarn | ||
| .yarnrc.yml |
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's a chance in the future this module may need patches or be typescript (requiring a post-install build step), and I usually like to make sure that in all normal cases you could run a yarn in the node_modules installed directory of a module in order to do patch-package style in-place development
But I can't see a way to ship .yarnrc.yml and the .yarn/plugins contents without bloating the normal build by at least 1.7kb already (the postinstall plugin) even though 99.9999% of people will never ever want or use it.
So, on balance I considered asking for the yarnrc and the plugins to stay in place, but I agree with leaving them - it wasn't just casually approved though, I did think about it - in case I or someone in the future looks through this and is curious about the thought process.
Cheers
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 for the quick merge and providing your POV on that. I agree that .yarnrc.yml and the .yarn/plugins parts can be left in, they do not that that much space, and their overall contribution to the package size is ~1%, which should not be a problem., we are not taking several MBs here. 🙂
|
altered to I think this is more than a chore, it's a real benefit to folks |
|
@Simek you noticed this - so you'll probably be able to verify correctness faster than anyone else. It merged and seemingly published correctly as 2.5.1 - https://github.com/invertase/react-native-apple-authentication/releases/tag/v2.5.1 - if you see problems still with 2.5.1 please let me know. Thanks again |

Why
While browsing through React Native Directory using Bundle Size sort I have spotted that
@invertase/react-native-apple-authenticationpackage have unusual large bundle (106 MB).How
Explore the current bundle on npm to find the root cause:
It ended up being a
.yarnwith publisher local cache and yarn bin file, which is a part of the repository.To fix that problem, and prevent similar accidents to happen on publish, I have modified the
.npmignorefile to exclude all Yarn-related files, the second example app (example-other), ReleaseIt config file and all archives created by runningnpm packlocally (*.tgz).Currently published package on npm (
latest)npm packbefore changes (no additional local files)npm packafter changes