Skip to content
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

Restore Babel cache invalidation #1817

Closed
novemberborn opened this issue May 27, 2018 · 0 comments
Closed

Restore Babel cache invalidation #1817

novemberborn opened this issue May 27, 2018 · 0 comments
Assignees
Milestone

Comments

@novemberborn
Copy link
Member

novemberborn commented May 27, 2018

#1798 caused drastic regressions in our ability to invalidate the precompilation cache. This was intentional, as we wanted to upgrade to newer Babel 7 betas.

There's a few TODO comments in lib/babel-pipeline.js with pointers on how to improve our cache invalidation:

// TODO: Check for `partialTestConfig.config` and include a hash of the file

// TODO: Take resolved plugin and preset files and compute package hashes for

With regards to plugins & presets, we should figure out what package the resolved plugin / preset is from, and then use package-hash to compute a hash. If the plugin / preset is a file in the current project (and not a dependency) we should just hash the file. The same if it's from outside of the current project.

We're now resolving Babel options for every file that's being compiled. We should therefore have a lookup of resolved plugins / presets and config files to previously computed hashes.

package-hash has an asynchronous mode which we could use, though we'd have to change the pipeline to be asynchronous itself, so that'd be a bit more work.

userOptions may come from an ava.config.js file (at least when #1761 lands). Consequently they may include non-serializable values. Perhaps we should serialize it using Concordance before taking the hash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant