Skip to content

Comments

feat(semantic): add SymbolFlags::Export to exported bindings#12355

Closed
Boshen wants to merge 1 commit intomainfrom
add-export-to-semantic
Closed

feat(semantic): add SymbolFlags::Export to exported bindings#12355
Boshen wants to merge 1 commit intomainfrom
add-export-to-semantic

Conversation

@Boshen
Copy link
Member

@Boshen Boshen commented Jul 17, 2025

The minifier needs to know whether a symbol is exported or not.

e.g.

export var x;
x = 1; // cannot remove this write.

This PR reverts #7414 and fixes #7338

The minifier needs to know whether a symbol is exported or not.

e.g.

```js
export var x;
x = 1; // cannot remove this write.
```
@graphite-app
Copy link
Contributor

graphite-app bot commented Jul 17, 2025

How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

@github-actions github-actions bot added A-semantic Area - Semantic A-transformer Area - Transformer / Transpiler C-enhancement Category - New feature or request labels Jul 17, 2025
@codspeed-hq
Copy link

codspeed-hq bot commented Jul 17, 2025

CodSpeed Instrumentation Performance Report

Merging #12355 will not alter performance

Comparing add-export-to-semantic (16eedcb) with main (a55b970)

Summary

✅ 34 untouched benchmarks

AstKind::LabeledStatement(_) => self.unused_labels.mark_unused(self.current_node_id),
AstKind::ExportDefaultDeclaration(d) => {
// Add `SymbolFlags::Export` to referenced symbols.
if let ExportDefaultDeclarationKind::Identifier(ident) = &d.declaration {
Copy link
Member Author

Choose a reason for hiding this comment

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

This fails for export default expression where expression contains some references

var foo;
export default { foo }

@Boshen Boshen closed this Jul 17, 2025
@Boshen Boshen deleted the add-export-to-semantic branch August 30, 2025 05:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-semantic Area - Semantic A-transformer Area - Transformer / Transpiler C-enhancement Category - New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

semantic: missing Export flag in exported variable declaration

1 participant