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

fix: ensure valid output for import the same cjs twice #323

Merged

Conversation

hyf0
Copy link
Member

@hyf0 hyf0 commented Nov 18, 2023

@hyf0 hyf0 changed the title WIP: fix: ensure valid output for import the same cjs twice fix: ensure valid output for import the same cjs twice Nov 18, 2023
@hyf0 hyf0 force-pushed the 11-18-fix_ensure_valid_output_for_import_the_same_cjs_twice branch 3 times, most recently from b207cd9 to 3650c1e Compare November 18, 2023 16:08
self.idx,
self
.symbol_table
.create_symbol(format!("import_{importee_repr}").into(), self.scope.root_scope_id()),
Copy link
Contributor

Choose a reason for hiding this comment

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

Here is better if check the symbol is already created, it will reduce one symbol deconfilct.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah. I saw that. Currently, we would create symbol for each ImportReocrd, this is how esbuild does it too. I'm thinking how to optimize it, but that's another story :).

@hyf0 hyf0 force-pushed the 11-18-refactor_create_wrapper_ref_after_wrapping branch from 4ad5249 to 916105e Compare November 19, 2023 11:43
@underfin
Copy link
Contributor

Cool!

Base automatically changed from 11-18-refactor_create_wrapper_ref_after_wrapping to main November 19, 2023 11:44
@hyf0 hyf0 force-pushed the 11-18-fix_ensure_valid_output_for_import_the_same_cjs_twice branch from 3650c1e to 18c85da Compare November 19, 2023 11:45
@hyf0
Copy link
Member Author

hyf0 commented Nov 19, 2023

Merge activity

  • Nov 19, 7:13 AM: @hyf0 started a stack merge that includes this pull request via Graphite.
  • Nov 19, 7:13 AM: @hyf0 merged this pull request with Graphite.

@hyf0 hyf0 merged commit 87b5000 into main Nov 19, 2023
6 checks passed
@hyf0 hyf0 deleted the 11-18-fix_ensure_valid_output_for_import_the_same_cjs_twice branch November 19, 2023 12:13
hyf0 added a commit that referenced this pull request Nov 22, 2023
…#351)

<!-- Thank you for contributing! -->

### Description

Rendering imports from external modules has same problem in #323, but the problem is hidden by the old merging behavior.

<!-- Please insert your description here and provide especially info about the "what" this PR is solving -->

### Test Plan

<!-- e.g. is there anything you'd like reviewers to focus on? -->

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