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 scope resolution for TS enums #7057

Merged
merged 2 commits into from
Oct 12, 2021
Merged

Fix scope resolution for TS enums #7057

merged 2 commits into from
Oct 12, 2021

Conversation

devongovett
Copy link
Member

TypeScript pass needs to be called before the resolver. This matches how SWC core does it: swc-project/swc@edc4cb4#diff-b0ba3e54b6f5ef1fa6aed8075e352a68fda66067fbafa8421042a2347801338aL251-R304

@height
Copy link

height bot commented Oct 12, 2021

Link Height tasks by mentioning a task ID in the pull request title or commit messages, or description and comments with the keyword link (e.g. "Link T-123").

💡Tip: You can also use "Close T-X" to automatically close a task when the pull request is merged.

@parcel-benchmark
Copy link

parcel-benchmark commented Oct 12, 2021

Benchmark Results

Kitchen Sink ✅

Timings

Description Time Difference
Cold 1.95s +3.00ms
Cached 286.00ms -34.00ms 🚀

Cold Bundles

Bundle Size Difference Time Difference
dist/legacy/parcel.7cdb0fad.webp 102.94kb +0.00b 600.00ms +44.00ms ⚠️
dist/legacy/parcel.7cdb0fad.webp 102.94kb +0.00b 600.00ms +44.00ms ⚠️
dist/modern/parcel.7cdb0fad.webp 102.94kb +0.00b 600.00ms +43.00ms ⚠️

Cached Bundles

No bundle changes detected.

React HackerNews ✅

Timings

Description Time Difference
Cold 10.06s +219.00ms
Cached 475.00ms +18.00ms

Cold Bundles

No bundle changes detected.

Cached Bundles

Bundle Size Difference Time Difference
dist/logo.c5bb83f1.png 246.00b +0.00b 4.61s -798.00ms 🚀

AtlasKit Editor 🚨

Timings

Description Time Difference
Cold FAILED -0.00ms
Cached FAILED -0.00ms

Cold Bundles

No bundles found, this is probably a failed build...

Cached Bundles

No bundles found, this is probably a failed build...

Three.js ✅

Timings

Description Time Difference
Cold 6.86s -137.00ms
Cached 392.00ms -18.00ms

Cold Bundles

No bundle changes detected.

Cached Bundles

No bundle changes detected.

Click here to view a detailed benchmark overview.

@devongovett devongovett changed the title Call SWC passes in the correct order Fix scope resolution for TS enums Oct 12, 2021
@devongovett devongovett merged commit 2c83842 into v2 Oct 12, 2021
@devongovett devongovett deleted the swc-resolver branch October 12, 2021 21:25
@@ -253,10 +253,9 @@ pub fn transform(config: Config) -> Result<TransformResult, std::io::Error> {

let global_mark = Mark::fresh(Mark::root());
let ignore_mark = Mark::fresh(Mark::root());
module = module.fold_with(&mut resolver_with_mark(global_mark));

Choose a reason for hiding this comment

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

We just ran into this issue too. I think you can use ts_resolver here instead, which seemed to fix our issues (but maybe I'm wrong). I believe resolver_with_mark doesn't have any knowledge of typescript nodes.

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.

4 participants