-
Notifications
You must be signed in to change notification settings - Fork 394
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
fix: ensure valid output for import the same cjs twice #323
Conversation
b207cd9
to
3650c1e
Compare
self.idx, | ||
self | ||
.symbol_table | ||
.create_symbol(format!("import_{importee_repr}").into(), self.scope.root_scope_id()), |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 :).
4ad5249
to
916105e
Compare
Cool! |
3650c1e
to
18c85da
Compare
…#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? --> ---
Description
https://hyrious.me/esbuild-repl/?version=0.18.19&b=e%00entry.js%00import+%7B+a+%7D+from+%27.%2Ffile%27%0Aconsole.log%28a%29%0Aimport+%7B+a+as+a2+%7D+from+%27.%2Ffile%27%0Aconsole.log%28a2%29&b=%00file.js%00module.exports.a+%3D+1&o=--bundle+--outdir%3D%22%2F%22+--format%3Desm+--splitting
This PR also remove concept
ReExport
. AReExport
is a combination ofLocalExport
andNamedExport
. This reduces complexity of dealing withReExport
.Test Plan