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
Respect Babel's addExternalDependency #7820
Conversation
|
Benchmark ResultsKitchen Sink ✅
Timings
Cold BundlesNo bundle changes detected. Cached Bundles
React HackerNews ✅
Timings
Cold Bundles
Cached BundlesNo bundle changes detected. AtlasKit Editor ✅
Timings
Cold Bundles
Cached Bundles
Three.js ✅
Timings
Cold Bundles
Cached BundlesNo bundle changes detected. |
010943c
to
02a800d
Compare
02a800d
to
c841f43
Compare
Actually, it looks like the file path isn't necessarily absolute. Babel CLI's watcher first resolves the each dependency https://github.com/babel/babel/blob/7d63d2f8337065a000d80da3282fba91f10fc6c2/packages/babel-cli/src/babel/watcher.ts#L74-L76
I'm not even sure how Parcel's |
Turns out it's not even necessarily a file:
|
@@ -82,6 +82,11 @@ export default async function babel7( | |||
remapAstLocations(babelCore.types, res.ast, map); | |||
} | |||
} | |||
if (res.externalDependencies) { | |||
for (let f of res.externalDependencies) { | |||
asset.invalidateOnFileChange(f); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And I guess Babel also doesn't differentiate between onFileChange
and onFileCreate
, so we'd have to do both (or check if the file exists)
What do we want to do with this one? |
It's still somehow "undefined behaviour" to pass non-absolute paths (be it relative or "virtual") to EDIT: done |
c841f43
to
32e02ef
Compare
32e02ef
to
ea6526b
Compare
Also, what should we do about #7820 (comment) ? |
ea6526b
to
372d431
Compare
↪️ Pull Request
babel/babel#14065
Just forward
api.addExternalDependency(f)
toasset.invalidateOnFileChange(f)
Currently blocked by Incorrect js file extension with --no-scope-hoist #7813 (comment)