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
Prebuilt packages are quite large in file size #124
Comments
Hi @jkillian , thanks for using js-joda and reporting the issue. The problem is that for the js-joda-locale package we need to implement parsing and formatting not only for month abbreviations but for all available patterns. We depend on data from cldr that provide some packaging of available localisation strings. There are strings in these packages that we do not need but the packages are as they are. So i'm afraid at the moment i don't know how to help you reduce the bundle size ... we could think about providing something like "core" packages that only contain some localisation functionality in the future but that is not on the roadmap currently :/ I'll close the issue because of this, feel free to reopen/ comment if you feel there is some way to address this. Regards, Pattrick |
Thanks for the response @phueper! Just a couple notes below I wrote up when I was looking at things: I was first curious about is how much of each locale is actual logic related to parsing and how much is data. When looking at As a (somewhat unfair comparison, but a comparison nonetheless), the data for a moment locale appears to be about 4KB. In the js-joda locale, it looks like the biggest consumers of space are:
@phueper I'm curious how this data overlaps with Another question I have is what the use of And then these are the remaining data files:
Any thoughts on the above comments? I'm mostly just trying to get a grasp here of what it causing the size bloat and on what data is truly necessary vs. what is extraneous. It seems like time timezone data here is what's the biggest offender. |
First off, js-joda is great! It makes me actually happy when working with dates/times in TypeScript. So thanks for the work!
However, I recently noticed that our
@js-joda/locale_en-us
package we're using is quite large. It's one module, as of version 2.0.1, is 302KB which unfortunately bloats our bundle quite a lot. (Of course this filesize will get smaller when uglified and gzipped, but it still adds up to be quite a lot)In our use case, all we want to be able to do is parse/output a few simple things like month abbreviations and 'am'/'pm'.
I admit I don't fully understand how these packages are built or what's in them. Do you have any recommendations for reducing bundle size in this case? Thanks!
The text was updated successfully, but these errors were encountered: