Skip to content

Conversation

@liuxingbaoyu
Copy link
Member

Compilation results are not cached, which ensures that Babel changes are reflected in a timely manner.
There is a simple list to skip caching for tests that use other files.

@liuxingbaoyu
Copy link
Member Author

I realized that we were actually not running some module tests correctly because the imported modules were not transformed.

We may be able to merge this PR to facilitate adding a CI for Babel 8.

@liuxingbaoyu liuxingbaoyu mentioned this pull request May 12, 2025
const cacheKey = sha1(JSON.stringify({ attrs, file }));

try {
contents = transpile(contents, { features: attrs.features, isModule, isStrict: false });
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isStrict: false Is this a bug?

Comment on lines +16 to +35
function buildCacheHash(test) {
let { phase = "", type = "" } = test.attrs.negative || {};
if ((phase === "early" || phase === "parse") && type === "SyntaxError") {
return sha1(test.contents);
}
const sources = dependencies
.getDependencies(test.file)
.sort()
.map(function (file) {
if (file === path.basename(test.file)) {
return;
}
return dependencies.rawSource.get(path.basename(file));
})
.filter(Boolean);

sources.push(test.contents);

return sha1(sources.join("\n"));
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now it uses the same method as eshost to get dependencies, which is safe enough to merge. :)

@nicolo-ribaudo nicolo-ribaudo merged commit 8063883 into main May 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants