Skip to content

Hoist exports to allow circular dependencies#9024

Merged
mischnic merged 8 commits into
v2from
circular-import-devpackager-bug
May 19, 2023
Merged

Hoist exports to allow circular dependencies#9024
mischnic merged 8 commits into
v2from
circular-import-devpackager-bug

Conversation

@AGawrys

@AGawrys AGawrys commented May 18, 2023

Copy link
Copy Markdown
Contributor

🤒 Pull Request

This PR aims to fix an issue where circular dependencies with a exported function is not defined at runtime. Both anonymous and named export default function should be hoisted, where as export default class should not as it is not supported by node.

😶‍🌫️ Examples

Without the fix, the test cases added below would result in a function is not defined or b1() is not defined type error.

✔️ PR Todo

  • Added/updated unit tests for this change
  • Verified this behavior is supported by Node ESM
  • Verified that this behavior with export default class is not supported by Node ESM

@AGawrys AGawrys requested a review from mischnic May 18, 2023 00:11
@mischnic

Copy link
Copy Markdown
Member

Please remove the comments and the debugger call

@mischnic mischnic left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

(I also renamed the tests to be more inline with the existing test/integration/js-export-default-* fixture folders)

@mischnic mischnic merged commit 3554866 into v2 May 19, 2023
@mischnic mischnic deleted the circular-import-devpackager-bug branch May 19, 2023 08:04
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.

2 participants