Skip to content

Commit

Permalink
[flow][tests] Repro for broken get-def for esm module ref
Browse files Browse the repository at this point in the history
Summary:
It has never really worked 100% of the time, because get-def for module ref depends on reasons, and the reason of namespaced export points to module ref itself.

Recent change of `module.system.haste.module_ref_prefix.standard_cjs_esm_interop` under `experimental.module.automatic_require_default=true` has pushed the case of esm module with default export into the non-working case.

This diff first documents the behavior that it's not working for esm modules with default exports without `experimental.module.automatic_require_default=true`, with fixes coming later in the stack.

Changelog: [internal]

Reviewed By: panagosg7

Differential Revision:
D67869373

------------------------------------------------------------------------
(from 4791ddced87b1518a3251b67f999fdccd16c8799)

fbshipit-source-id: 626da3c3a63b2a392f778937123df4bf3df1fbd3
  • Loading branch information
SamChou19815 authored and facebook-github-bot committed Jan 7, 2025
1 parent e1444d8 commit 0a3673d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/get_def2/ParentESM.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// @flow

const ParentFoo = {foo: 'bar'};
export default {ParentFoo}
4 changes: 4 additions & 0 deletions tests/get_def2/get_def2.exp
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,10 @@ module_ref.js:3:4
Flags:
Parent.js:4:18,4:28

module_ref.js:5:4
Flags:
module_ref.js:5:1,5:15

refinements.js:10:4
Flags:
refinements.js:4:7,4:9
Expand Down
2 changes: 2 additions & 0 deletions tests/get_def2/module_ref.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@

'm#./Parent';
// ^
'm#./ParentESM';
// ^

0 comments on commit 0a3673d

Please sign in to comment.