Conversation
MattIPv4
left a comment
There was a problem hiding this comment.
Files: all
.js,.mapand.jsonfiles, exceptpackage.json:
library, plugins, themes, locales and lazy-loaded dependencies: about 18 MB
geodata/: map files as JS (about 170 MB) and as JSON ingeodata/json/(about 170 MB). Our docs load the JSON versions on demand, e.g. for map drill-downs.
fonts/: fonts for the PDF export, about 27 MBAbout 383 MB per version in total. We release about 25 times a year. Only one tagged version exists (
5.20.8), so the initial import is a single version. That version doesn't have the JSON geodata yet (about 214 MB); later versions will.We include geodata so that cdnjs URLs mirror our CDN's
/geodata/paths. Most of the geodata size comes from the High and Ultra detail maps. If the size is a concern, we're happy to leave those out (about 132 MB per version)
All of that feels incredibly large, and I imagine our CI will have issues with it 😓
18MB alone for just the library itself seems excessive, equally 27MB of bundled fonts seems like a lot when fonts are already available online (cdnjs itself, Google Fonts, etc.).
I can understand the geodata being so large, but I suspect that will also present a problem for the CI due to its size. It may be pertinent to do what you've suggested and drop the higher-detail versions if they're not required.
Comparing to amcharts4 on cdnjs, it does not appear to have this bloat at all.
| "**/*.@(js|map)", | ||
| "**/!(package).json" |
There was a problem hiding this comment.
We do not like to introduce globstars in new configs, as it can result in files being introduced that should not be on cdnjs. Please can we list the specific directories that files need to be pulled from?
… and high-detail maps
|
Thanks for the review! Updated in 07fc0ec:
Total is now 764 files, about 48 MB per version (down from 383 MB). The largest single file is 1.8 MB ( Compared to |
Adds amCharts 5, the current major version of amCharts. amCharts 3 (
amcharts) and amCharts 4 (amcharts4) are already on cdnjs.Popularity:
@amcharts/amcharts5has about 1.26M npm downloads per month.Source: amcharts/amcharts5-dist is a public repo that our release process updates automatically, with one plain semver tag per release (starting at
5.20.8). It holds the pre-built browser (script tag) files in the same layout as our own CDN (cdn.amcharts.com/lib/5/). The npm package can't be used as the source, because it only contains ES module source for bundlers.Files: each directory is listed explicitly (no globstars):
*.js,deps/,plugins/,themes/,locales/): 93 files, about 4.1 MB*Low.jsingeodata/and its region directories), plus the smallgeodata/data/andgeodata/lang/filesIn total 764 files, about 48 MB per version. The largest single file is 1.8 MB. Source maps, fonts for the PDF export, JSON geodata and high-detail maps are left out; they stay available from our own CDN.
Optimization:
js: false, because the files are already minified.License: free under the amCharts linkware license (a small branding link on charts), or commercial. Same as
amchartsandamcharts4.Updated after review: the first version used globstars and included everything (about 383 MB per version).