Repository navigation
Rename sourcemap-codec libdef to .js.flow - #2164
Conversation
flow-typed/sourcemap-codec.js uses declare module, which Flow only allows in a library file. OSS Flow loads flow-typed/*.js as libdefs, but internal Flow only treats .flow files as libdefs, so the file errors internally with unsupported-syntax and the metro-transform-worker import falls back to untyped-import. Renaming to .js.flow makes Flow treat it as a library file in both.
Metro review: Looks goodRisk: low · Commit: This renames the No findings. Verified
Not run: Internal Flow: its library-file handling and the flow-check-land errors the PR targets can't be reproduced here, including why other Automated review by Claude. Advisory only: it never approves or blocks, and a maintainer makes the call. |
Follow-up to #1984, which added flow-typed/sourcemap-codec.js with a declare module block.
declare module is only allowed in a library file. OSS Flow loads flow-typed/*.js as libdefs, so this passed OSS CI. Internal Flow only treats .flow files as library files, so the same file fails internally with unsupported-syntax, and the metro-transform-worker import of @jridgewell/sourcemap-codec falls back to untyped-import. Those two errors block landing the #1984 DiffTrain stack internally (flow-check-land on D129410423).
Renaming the file to flow-typed/sourcemap-codec.js.flow makes Flow treat it as a library file in both. No content change.
Validation on this branch:
Changelog: [Internal]