-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
[WIP] Try caching compiled JavaScript when building packages #13124
Conversation
4adee78
to
d16cc2a
Compare
@youknowriad: Do you think this is worth continuing with? I added caching to Pros:
Cons:
A compromise could be to only enable caching on Travis CI. |
cc. @gziolo as well 🙂 |
There is also a concurrent effort started by @aduth where packages are built async. #8093 was merged and reverted not that long ago. I would like to learn what went wrong, so we could better evaluate the proposed changes. Also this from @talldan:
It looks like you all have more expertise in this area than I do. I'm fine with all proposals which makes builds faster. With this PR in place we wouldn't have to see packages to be rebuilt every time you run |
d16cc2a
to
5caf40e
Compare
I've refreshed this this PR. I think it's worth continuing with. The only real concern I have is that it means that we're dumping build artefacts into a hidden directory ( (Mind you, running |
See https://github.com/WordPress/gutenberg/blob/master/.travis.yml#L15-L19 This is what it is, I wouldn't worry about it :) |
@omarreiss is it something that was ever discussed in the context of WordPress core? To cache build artifacts? Well, it might be specific to packages only... |
What's the status of this pull request? Will you plan to revisit it? For what it's worth, I've created a separate tracking issue for general Travis build performance ideas at #15159 . There were similar optimizations at #14860 which leverage Babel cache which seems to be similar in impact to what's been proposed here. |
@gziolo I somehow missed your question. We didn't consider this yet for WordPress core, but definitely seems like we should consolidate solutions like this one to WordPress core. The optimizations for core so far focused primarily on improving the efficiency of rebuilds on grunt watch. The setup there is still quite behind on the Gutenberg one. cc @herregroen. |
This was a quick proof of concept for an idea that I think still has merit. I'll close the PR though as I am not able to give it the time it deserves. |
Continuing on from yesterday's experimentation (#13103) into improving some of our build times.
This changes
npm run build:packages
to cache the compiled JavaScript that Babel generates. Doing so makesnpm install
,npm run dev
, andnpm run build
run significantly quicker.To test, run
npm run build:packages
. The first run will take a while but subsequent runs will be quicker.