-
Notifications
You must be signed in to change notification settings - Fork 71
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
175 kb size? #650
Comments
I guess it depends of how much polyfill you want to have in it. |
Thanks for the feedback! I agree that packaging could be improved, especially to get rid of babel from dependencies. The codebase is not big at all and it only relies on And now that modern browsers support natively async/await, the only transformation could be CommonJS modules for browsersify. I can't spend much time to work on this those days, but we'd be happy to help if you start something in a PR |
That's the point. I think that a library should not contain any polyfills. The consuming environment should make sure that everything is available at runtime. A library should have as few as possible dependencies. For example In my project I don't include the huge
Thats true. Same here: if the library writes code in the shiny new I try to make a work in progress pull request these days for all that. I hope I've got enough time 😉 |
I agree with you let's improve that 👍 |
I just released kinto-http.js v3.0 which gets rid of the isomorphic-fetch polyfill |
Oh that was quick 👍 Currently I am thinking about if it would make sense to just publish the "raw" ES2015 code as it's written to npm and not the transpiled one. Advantages
DisadvantagesOnly one: the consuming project must use a transpiler to use Hmmm... 🤔 |
I think we could publish the "src" directory to npm along the "lib" one, so
people could build (or import) from sources if they want.
Le 9 févr. 2017 12:45 PM, "screendriver" <[email protected]> a
écrit :
… Oh that was quick 👍
Currently I am thinking about if it would make sense to just publish the
"raw" ES2015 code as it's written to npm and not the transpiled one.
Advantages
1. the consuming project has full control over how it gets transpiled
(Babel, TypeScript, Webpack, Brunch, Rollup.js, SystemJS and so on)
2. Tree Shaking would then be possible
3. kinto.js shrinks to just a few bytes
4. Debugging with source maps would be much more easier because the
module bundler of the consuming project can generate it
Disadvantages
Only one: the consuming project *must* use a transpiler to use kinto.js
Hmmm... 🤔
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#650 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AACiSzunNO9cYX0GXm9RNNBQrfYIbRruks5ravxKgaJpZM4L75SI>
.
|
But when we publish the At the moment I am searching for best practices / design patterns for library authors that have the same problem like |
With v13, our bundle size has now dropped to ~15 KB gzipped! 🎉 |
I added
kinto.js
to my project (see also #649) as anpm
dependency and saw that it increased my final bundle file size about 175 kb in size 😳Is there anything I can do to reduce it's size? It seems a little bit too large in my eyes compared to other libraries / frameworks.
The text was updated successfully, but these errors were encountered: