`nanoc` recursively executes itself to make another recursive call to bundler
The mean time for docs build over the last 10 runs is 16.87 minutes.
✗ curl -sSL https://gitlab.com/gitlab-org/gitlab-docs/-/pipelines.json | jq ".pipelines[].details.duration"
1109
935
1040
949
1115
868
1063
969
1076
1039
916
925
1064
1039
1074
From which processing of .js
with rollup
takes more that 2 minutes (154.21s).
I tried to see if I can replace it with esbuild
and spent few days researching how the rollup
here is invoked. In pipeline config there is no separate minification step. At first I though that maybe I am looking at the wrong pipeline, because it looked like bundle nanoc
should invoke bundle
"script" from package.json
, which redefines bundle
command (which looks like a hack to me). I've just proved that I was right, but it required quite a lot of time to discover the nanoc frontend
custom command that does this. I hoped to just swap nanoc
to esbuild
and see at least 1 minute of JS minification gone, but it is not that simple. I documenting it here, to improve the contributors experience (@nick_vh) by simplifying the pipeline.
Right now GitLab pipelines invokes bundle
, which invokes nanoc
, which invokes nanoc frontend
, which invokes command/frontend.rb
, which invokes yarn bundle
, which invokes package.json:bundle
script, which finally invokes rollup
.
graph LR
bundle --> nanoc --> n[nanoc frontend] --> y[yarn bundle] --> p[package.json:bundle] --> rollup
The proposal is make GitLab pipelines invoke bundle
, which will invoke nanoc
. Then execute rollup
as a separate command from the pipeline.
graph LR
bundle --> nanoc
rollup
Will that break anything?