Closed pdehaan closed 3 years ago
Actually, I'm using npm@7, so I can use the nifty npm diff trick I learned the other day to debug the difference between two package versions…
npm diff --diff=@11ty/eleventy@1.0.0-canary.21 --diff=@11ty/eleventy@1.0.0-canary.22 --diff-name-only
src/EleventyServe.js
package.json
api-docs/@11ty/eleventy/1.0.0-canary.22/styles/darkstrap.css
api-docs/@11ty/eleventy/1.0.0-canary.22/styles/prettify-tomorrow.css
api-docs/@11ty/eleventy/1.0.0-canary.22/styles/site.cerulean.css
api-docs/@11ty/eleventy/1.0.0-canary.22/styles/site.cosmo.css
api-docs/@11ty/eleventy/1.0.0-canary.22/styles/site.cyborg.css
api-docs/@11ty/eleventy/1.0.0-canary.22/styles/site.darkly.css
api-docs/@11ty/eleventy/1.0.0-canary.22/styles/site.darkstrap.css
api-docs/@11ty/eleventy/1.0.0-canary.22/styles/site.dibs-bootstrap.css
api-docs/@11ty/eleventy/1.0.0-canary.22/styles/site.flatly.css
api-docs/@11ty/eleventy/1.0.0-canary.22/styles/site.journal.css
api-docs/@11ty/eleventy/1.0.0-canary.22/styles/site.lumen.css
api-docs/@11ty/eleventy/1.0.0-canary.22/styles/site.paper.css
api-docs/@11ty/eleventy/1.0.0-canary.22/styles/site.readable.css
api-docs/@11ty/eleventy/1.0.0-canary.22/styles/site.sandstone.css
api-docs/@11ty/eleventy/1.0.0-canary.22/styles/site.simplex.css
api-docs/@11ty/eleventy/1.0.0-canary.22/styles/site.slate.css
api-docs/@11ty/eleventy/1.0.0-canary.22/styles/site.spacelab.css
api-docs/@11ty/eleventy/1.0.0-canary.22/styles/site.superhero.css
api-docs/@11ty/eleventy/1.0.0-canary.22/styles/site.united.css
api-docs/@11ty/eleventy/1.0.0-canary.22/styles/site.yeti.css
api-docs/@11ty/eleventy/1.0.0-canary.22/styles/sunlight.dark.css
api-docs/@11ty/eleventy/1.0.0-canary.22/styles/sunlight.default.css
api-docs/@11ty/eleventy/1.0.0-canary.22/fonts/glyphicons-halflings-regular.eot
api-docs/@11ty/eleventy/1.0.0-canary.22/classes.list.html
api-docs/@11ty/eleventy/1.0.0-canary.22/index.html
api-docs/@11ty/eleventy/1.0.0-canary.22/module-11ty_eleventy_Eleventy-Eleventy.html
api-docs/@11ty/eleventy/1.0.0-canary.22/module-11ty_eleventy_Eleventy.html
api-docs/@11ty/eleventy/1.0.0-canary.22/module-11ty_eleventy_EventBus.html
api-docs/@11ty/eleventy/1.0.0-canary.22/module-11ty_eleventy_TemplateConfig-EleventyConfigError.html
api-docs/@11ty/eleventy/1.0.0-canary.22/module-11ty_eleventy_TemplateConfig-TemplateConfig.html
api-docs/@11ty/eleventy/1.0.0-canary.22/module-11ty_eleventy_TemplateConfig.html
api-docs/@11ty/eleventy/1.0.0-canary.22/modules.list.html
api-docs/@11ty/eleventy/1.0.0-canary.22/scripts/docstrap.lib.js
api-docs/@11ty/eleventy/1.0.0-canary.22/scripts/fulltext-search-ui.js
api-docs/@11ty/eleventy/1.0.0-canary.22/scripts/fulltext-search.js
api-docs/@11ty/eleventy/1.0.0-canary.22/scripts/prettify/jquery.min.js
api-docs/@11ty/eleventy/1.0.0-canary.22/scripts/prettify/lang-css.js
api-docs/@11ty/eleventy/1.0.0-canary.22/scripts/lunr.min.js
api-docs/@11ty/eleventy/1.0.0-canary.22/scripts/prettify/prettify.js
api-docs/@11ty/eleventy/1.0.0-canary.22/scripts/sunlight.js
api-docs/@11ty/eleventy/1.0.0-canary.22/scripts/toc.js
api-docs/@11ty/eleventy/1.0.0-canary.22/img/glyphicons-halflings-white.png
api-docs/@11ty/eleventy/1.0.0-canary.22/img/glyphicons-halflings.png
api-docs/@11ty/eleventy/1.0.0-canary.22/fonts/glyphicons-halflings-regular.svg
api-docs/@11ty/eleventy/1.0.0-canary.22/fonts/glyphicons-halflings-regular.ttf
api-docs/@11ty/eleventy/1.0.0-canary.22/scripts/prettify/Apache-License-2.0.txt
api-docs/@11ty/eleventy/1.0.0-canary.22/fonts/glyphicons-halflings-regular.woff
api-docs/@11ty/eleventy/1.0.0-canary.22/fonts/glyphicons-halflings-regular.woff2
So it looks like the new api-docs (and it's fonts and minified libs) is getting bundled into the builds and we might need to add "api-docs" to the .npmignore file.
Now running npm run doc locally will build the API docs locally and increase the bundle size with roughly 3.6 MB of API documentation:
npm notice === Tarball Details ===
npm notice name: @11ty/eleventy
npm notice version: 1.0.0-canary.38
npm notice filename: @11ty/eleventy-1.0.0-canary.38.tgz
npm notice package size: 790.0 kB
npm notice unpacked size: 4.0 MB
npm notice shasum: b778dfb33a11fd4b80b2927c4ac0fde94b929a12
npm notice integrity: sha512-PzU14p7lrhKAn[...]5zTBrrclf3NBw==
npm notice total files: 125
npm notice
11ty-eleventy-1.0.0-canary.38.tgz
npm run doc
du -sh api-docs
# 3.6M api-docs
Alternatively, use the files
and explicity put the files to include on an allowlist.
I learnt some Bash today! This will log out all the files in the ./api-docs/ folder, sorting them by file size (in descending order). So it looks like we're including around 2.7 MB of CSS files (so it wasn't the fonts causing the bloat like I was originally expecting).
/giphy "the more you know"
ls -ld $(find api-docs -type f) | sort -r | awk '{print $5 "\t" $9}'
348534 api-docs/@11ty/eleventy/1.0.0-canary.38/scripts/docstrap.lib.js
172866 api-docs/@11ty/eleventy/1.0.0-canary.38/styles/site.dibs-bootstrap.css
167516 api-docs/@11ty/eleventy/1.0.0-canary.38/styles/site.paper.css
165118 api-docs/@11ty/eleventy/1.0.0-canary.38/styles/site.slate.css
157135 api-docs/@11ty/eleventy/1.0.0-canary.38/styles/site.lumen.css
154866 api-docs/@11ty/eleventy/1.0.0-canary.38/styles/site.spacelab.css
153783 api-docs/@11ty/eleventy/1.0.0-canary.38/styles/site.yeti.css
153458 api-docs/@11ty/eleventy/1.0.0-canary.38/styles/site.darkly.css
153054 api-docs/@11ty/eleventy/1.0.0-canary.38/styles/site.flatly.css
152640 api-docs/@11ty/eleventy/1.0.0-canary.38/styles/site.superhero.css
152386 api-docs/@11ty/eleventy/1.0.0-canary.38/styles/site.cerulean.css
151980 api-docs/@11ty/eleventy/1.0.0-canary.38/styles/site.simplex.css
150819 api-docs/@11ty/eleventy/1.0.0-canary.38/styles/site.cosmo.css
150758 api-docs/@11ty/eleventy/1.0.0-canary.38/styles/site.cyborg.css
150635 api-docs/@11ty/eleventy/1.0.0-canary.38/styles/site.sandstone.css
149895 api-docs/@11ty/eleventy/1.0.0-canary.38/styles/site.readable.css
149558 api-docs/@11ty/eleventy/1.0.0-canary.38/styles/site.journal.css
147815 api-docs/@11ty/eleventy/1.0.0-canary.38/styles/site.united.css
137683 api-docs/@11ty/eleventy/1.0.0-canary.38/styles/site.darkstrap.css
108738 api-docs/@11ty/eleventy/1.0.0-canary.38/fonts/glyphicons-halflings-regular.svg
83095 api-docs/@11ty/eleventy/1.0.0-canary.38/scripts/prettify/jquery.min.js
45404 api-docs/@11ty/eleventy/1.0.0-canary.38/fonts/glyphicons-halflings-regular.ttf
35095 api-docs/@11ty/eleventy/1.0.0-canary.38/module-11ty_eleventy_Eleventy-Eleventy.html
33618 api-docs/@11ty/eleventy/1.0.0-canary.38/scripts/sunlight.js
23733 api-docs/@11ty/eleventy/1.0.0-canary.38/styles/darkstrap.css
23424 api-docs/@11ty/eleventy/1.0.0-canary.38/fonts/glyphicons-halflings-regular.woff
20127 api-docs/@11ty/eleventy/1.0.0-canary.38/fonts/glyphicons-halflings-regular.eot
18732 api-docs/@11ty/eleventy/1.0.0-canary.38/scripts/prettify/prettify.js
18028 api-docs/@11ty/eleventy/1.0.0-canary.38/fonts/glyphicons-halflings-regular.woff2
17523 api-docs/@11ty/eleventy/1.0.0-canary.38/module-11ty_eleventy_TemplateConfig-TemplateConfig.html
15426 api-docs/@11ty/eleventy/1.0.0-canary.38/scripts/lunr.min.js
12799 api-docs/@11ty/eleventy/1.0.0-canary.38/img/glyphicons-halflings.png
11358 api-docs/@11ty/eleventy/1.0.0-canary.38/scripts/prettify/Apache-License-2.0.txt
8777 api-docs/@11ty/eleventy/1.0.0-canary.38/img/glyphicons-halflings-white.png
8306 api-docs/@11ty/eleventy/1.0.0-canary.38/styles/sunlight.dark.css
8173 api-docs/@11ty/eleventy/1.0.0-canary.38/styles/sunlight.default.css
7652 api-docs/@11ty/eleventy/1.0.0-canary.38/index.html
5794 api-docs/@11ty/eleventy/1.0.0-canary.38/scripts/toc.js
5100 api-docs/@11ty/eleventy/1.0.0-canary.38/module-11ty_eleventy_EventBus.html
5028 api-docs/@11ty/eleventy/1.0.0-canary.38/module-11ty_eleventy_TemplateConfig-EleventyConfigError.html
5011 api-docs/@11ty/eleventy/1.0.0-canary.38/modules.list.html
5011 api-docs/@11ty/eleventy/1.0.0-canary.38/classes.list.html
4900 api-docs/@11ty/eleventy/1.0.0-canary.38/module-11ty_eleventy_TemplateConfig.html
4723 api-docs/@11ty/eleventy/1.0.0-canary.38/module-11ty_eleventy_Eleventy.html
2845 api-docs/@11ty/eleventy/1.0.0-canary.38/scripts/fulltext-search-ui.js
2018 api-docs/@11ty/eleventy/1.0.0-canary.38/styles/prettify-tomorrow.css
980 api-docs/@11ty/eleventy/1.0.0-canary.38/scripts/fulltext-search.js
932 api-docs/@11ty/eleventy/1.0.0-canary.38/scripts/prettify/lang-css.js
ls -lash api-docs/@11ty/eleventy/1.0.0-canary.38/styles | grep -E "site\..*?\.css" | awk '{print $6 "\t" $10}'
149K site.cerulean.css
147K site.cosmo.css
147K site.cyborg.css
150K site.darkly.css
134K site.darkstrap.css
169K site.dibs-bootstrap.css
149K site.flatly.css
146K site.journal.css
153K site.lumen.css
164K site.paper.css
146K site.readable.css
147K site.sandstone.css
148K site.simplex.css
161K site.slate.css
151K site.spacelab.css
149K site.superhero.css
144K site.united.css
150K site.yeti.css
I'm confused.
api-docs
is generated via JSDoc: https://github.com/11ty/eleventy/blob/36713b3af81b08530fac532ceef24f5dde8acb36/package.json#L45 (introduced by me like two years ago).
cosmo
is the default theme.
It is on .gitignore
. I can't imagine, that the version bump caused the spike: https://github.com/11ty/eleventy/compare/v1.0.0-canary.21...v1.0.0-canary.22
:shrug: Maybe @zachleat always purged the local API documentation before deploying to npm previously.
I only know what npm tells me. Although I could try a clean folder and doing npm i @11ty/eleventy@canary and confirming which files are bundled. I didn't think this would possibly be Eleventy Serverless related. This all seems very npm specific, which is why I was suspecting it being related to something on his local machine making its way into the bundles.
So … perhaps it's worth to let CI create the builds and publish it? Can GitHub Actions do that?
I realize this is probably going to be contentious but in the interest of time and maintenance ease for me I’m going to remove the jsdoc stuff, at least for now. ink-docstrap
has some npm audit violations and hasn’t had a release in 4 years https://www.npmjs.com/package/ink-docstrap
We can reinvestigate something a bit more integrated with 11ty.dev a bit later if there is enough demand for it! (sorry @Ryuno-Ki!)
This will also solve https://github.com/11ty/eleventy/issues/1785 Related: #1375
To answer the previous comments, I’m guessing between the 1.0.0-canary.21
and 1.0.0-canary.22
is when I ran the jsdoc command locally to generate those files (as part of the investigation into https://github.com/11ty/eleventy/issues/1785)
Would you still accept PRs to add more JSDoc strings? (and go with JSDoc's default theme)
Yeah for sure!
Re-added the jsdoc command in #3060
Was playing w/ pacote and noticed that the recent canary builds (after canary.21) are 3.8 MB (vs expected ~314 KB). Not sure why they're big yet. I did a git pull on the master branch and then npm pack --dry-run and my local canary.38 build summary says:
I'll have to see if I can scrape npm's canary.38 and compare it to my local version to see what files are missing/added. Curious indeed. @zachleat, it might be something from your local system (docs) that is sneakily getting bundled into the builds, which I'm not reproducing locally here on a semi-fresh clone.