-
Notifications
You must be signed in to change notification settings - Fork 5
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
Bundle size #151
Comments
No, I put this library out as a trap. My intention is to increase everyone's bundles and make their code slow.
🍎 and 🟠. You're comparing a bundle with a function call. Very fair. If you're referring to the global |
Feel free to drop constructive feedback here. Spin up a bundle analyzer and inspect why our abstraction is so much bigger than the original lib. |
😃
Yes I know
Well, I think it is because |
Hmm, the biggest squares is for |
Is this a trick question again? Of course it's needed, otherwise we'd remove it 🙊 |
I mean REALLY ) |
So what would you suggest? Remove the check, hope for the best and have someone debug it if 💩 hits the fan? |
Use regexp for example. Or simple split by "." of version string. |
Or maybe use another, less size package like https://www.npmjs.com/package/compare-versions |
Difference about 7.3Kb |
We should update the event bus here and re-evaluate because of nextcloud-libraries/nextcloud-event-bus#107. The new bundle size might be a lot smaller. |
Let me tag a release so we have 3ba2249 published |
That didn't help much according to https://bundlephobia.com/result?p=@nextcloud/[email protected]. But that also shows that core-js takes the much bigger share of bundle size, the event bus is minor compared to that. |
Is not typescript can compile to specified target (ES5 for example) ? |
Yes, but just es5. So the apps that use this lib would have to transpile the code again. We use babel and https://www.npmjs.com/package/@nextcloud/browserslist-config instead and pit out something that is already processable by the supported browsers (minus linking the chunks to one bundle). |
Well, let's compare.
https://caniuse.com/#search=es5 |
Awesome. But in that case I'm wondering why core-js is still inserted in so many place. Shouldn't it just have 0 |
Maybe it is just habit caused by harsh past of javascript 😄
When using typescript it is definetly strange |
The https://bundlephobia.com/package/@nextcloud/[email protected] |
vs
35kb minified js code just for setting header... are you serious ?
BTW
jQuery.post('/some/url')
- size24 bytes
😄The text was updated successfully, but these errors were encountered: