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

Make ts-types transformer work with TS >= 4.8 #8661

Merged
merged 7 commits into from
Nov 27, 2022
Merged

Conversation

mischnic
Copy link
Member

Closes #8419

Just moving to the new AST functions fixed everything I can reproduce (so not sure about #8494), so the deprecation warnings and Unhandled SyntaxKind: ImportClause

API Changes:

  1. use context.factory.(create|update)* instead of ts.(create|update)*
  2. TS used the opportunity in (1) to change the parameters, so there are a few more isTypeOnly parameters and no decorators parameters anymore.
  3. getMutableClone is deprecated

I've written a script to generate wrappers for the changing parameter orderings: https://github.com/mischnic/tsc-version-wrapper which was used for packages/transformers/typescript-types/src/wrappers.js. The integration tests pass with 4.0.0 (going even further makes Typescript complain about some library typings)

Problems:

  • Just removing the (deprecated) node = ts.getMutableClone(node); line didn't break any tests, so I'm not sure why it was needed in the first place. Might be related to prevent TS from removing unused imports.

@parcel-benchmark
Copy link

parcel-benchmark commented Nov 26, 2022

Benchmark Results

Kitchen Sink ✅

Timings

Description Time Difference
Cold 1.54s -15.00ms
Cached 377.00ms +36.00ms ⚠️

Cold Bundles

Bundle Size Difference Time Difference
dist/legacy/parcel.7cdb0fad.webp 102.94kb +0.00b 260.00ms +178.00ms ⚠️
dist/legacy/parcel.7cdb0fad.webp 102.94kb +0.00b 261.00ms +179.00ms ⚠️
dist/modern/parcel.7cdb0fad.webp 102.94kb +0.00b 262.00ms +180.00ms ⚠️
dist/modern/index.31cedca9.css 94.00b +0.00b 267.00ms +14.00ms ⚠️

Cached Bundles

No bundle changes detected.

React HackerNews ✅

Timings

Description Time Difference
Cold 10.12s +87.00ms
Cached 499.00ms +30.00ms ⚠️

Cold Bundles

No bundle changes detected.

Cached Bundles

No bundle changes detected.

AtlasKit Editor ✅

Timings

Description Time Difference
Cold 1.77m -1.71s
Cached 2.38s +36.00ms

Cold Bundles

No bundle changes detected.

Cached Bundles

No bundle changes detected.

Three.js ✅

Timings

Description Time Difference
Cold 7.28s -142.00ms
Cached 285.00ms +5.00ms

Cold Bundles

No bundle changes detected.

Cached Bundles

No bundle changes detected.

Click here to view a detailed benchmark overview.

Copy link
Member

@devongovett devongovett left a comment

Choose a reason for hiding this comment

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

Thanks!

@devongovett devongovett merged commit c0f5351 into v2 Nov 27, 2022
@devongovett devongovett deleted the ts-types-updates branch November 27, 2022 16:31
lettertwo added a commit that referenced this pull request Dec 8, 2022
* upstream/v2:
  Make sure we're compiling on ubuntu-20.04
  v2.8.1
  Add mjs and cjs to resolver extensions (#8667)
  Fix transformer-svg-react not finding .svgrrc's (#7741)
  Fix overriding single export of a `export *` (#8653)
  chore: spelling fix (#8614)
  Parse shortcut icons in web app manifests (#8660)
  Make ts-types transformer work with TS >= 4.8 (#8661)
  Don't retarget dependencies with `*` (#8645)
  fix: remove @parcel/utils dep in @parcel/graph (#8630)
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.

@parcel/transformer-typescript-types: Debug Failure. Unhandled SyntaxKind: ImportClause.
3 participants