Skip to content
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

Hoist exports to allow circular dependencies #9024

Merged
merged 8 commits into from May 19, 2023

Conversation

AGawrys
Copy link
Contributor

@AGawrys AGawrys commented May 18, 2023

🤒 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
Member

Please remove the comments and the debugger call

Copy link
Member

@mischnic mischnic left a comment

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
14 of 16 checks passed
@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.

None yet

2 participants