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

[infra] Upgrade and standardize TypeScript to ~4.7.4 #3116

Merged
merged 6 commits into from
Jul 9, 2022

Conversation

aomarks
Copy link
Member

@aomarks aomarks commented Jul 4, 2022

  • All packages now depend on TypeScript ~4.7.4.
  • ~ is used instead of ^ because TypeScript doesn't follow semver.
  • I took typescript out of the devDependencies for most packages, so that they just rely on the one in the top-level package.json. This is to make it more likely we'll upgrade all packages at once in the future, instead of one at a time.
  • @lit/ts-transformers, @lit/localize-tools, and @lit-labs/analyzer include typescript in their production dependencies, so those get a changeset and will get releases.
  • @lit/ts-transformers needed a fix in the tests so that the "legacy" output emits ES2021 instead of ESNext, since it will include static class initializer blocks otherwise.
  • A @lit-labs/analyzer test had to be upgraded to due some minor change in the way a generated type union was formatted.
  • This drops 800MB off our total npm install size, if you can believe that, since each typescript version is ~65MB, and we had a bunch of versions which needed to get duplicated into multiple sub-package node_modules/ folders.

@changeset-bot
Copy link

changeset-bot bot commented Jul 4, 2022

🦋 Changeset detected

Latest commit: 509382d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@lit-labs/analyzer Patch
@lit/localize-tools Patch
@lit/ts-transformers Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Contributor

github-actions bot commented Jul 4, 2022

📊 Tachometer Benchmark Results

Summary

nop-update

  • lit-html-kitchen-sink: unsure 🔍 -1% - +3% (-0.38ms - +0.76ms)
    this-change vs tip-of-tree

render

  • lit-element-list: 73.90ms - 78.21ms
  • lit-html-kitchen-sink: unsure 🔍 -2% - +2% (-0.46ms - +0.46ms)
    this-change vs tip-of-tree
  • lit-html-repeat: unsure 🔍 -2% - +2% (-0.20ms - +0.25ms)
    this-change vs tip-of-tree
  • lit-html-template-heavy: unsure 🔍 -0% - +2% (-0.23ms - +1.11ms)
    this-change vs tip-of-tree
  • reactive-element-list: unsure 🔍 -1% - +2% (-0.33ms - +1.19ms)
    this-change vs tip-of-tree

update

  • lit-element-list: 737.69ms - 749.26ms
  • lit-html-kitchen-sink: unsure 🔍 -3% - +2% (-2.12ms - +1.23ms)
    this-change vs tip-of-tree
  • lit-html-repeat: unsure 🔍 -1% - +2% (-3.01ms - +4.69ms)
    this-change vs tip-of-tree
  • lit-html-template-heavy: unsure 🔍 -1% - +1% (-1.42ms - +1.03ms)
    this-change vs tip-of-tree
  • reactive-element-list: unsure 🔍 -0% - +1% (-2.57ms - +8.62ms)
    this-change vs tip-of-tree

update-reflect

  • lit-element-list: 750.16ms - 759.93ms
  • reactive-element-list: unsure 🔍 -1% - +2% (-5.37ms - +20.54ms)
    this-change vs tip-of-tree

Results

lit-element-list

render

VersionAvg timevs
73.90ms - 78.21ms-

update

VersionAvg timevs
737.69ms - 749.26ms-

update-reflect

VersionAvg timevs
750.16ms - 759.93ms-
lit-html-kitchen-sink

render

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
28.72ms - 29.60ms-unsure 🔍
-2% - +2%
-0.46ms - +0.46ms
unsure 🔍
-1% - +2%
-0.41ms - +0.59ms
tip-of-tree
tip-of-tree
29.02ms - 29.31msunsure 🔍
-2% - +2%
-0.46ms - +0.46ms
-unsure 🔍
-1% - +1%
-0.19ms - +0.38ms
previous-release
previous-release
28.82ms - 29.32msunsure 🔍
-2% - +1%
-0.59ms - +0.41ms
unsure 🔍
-1% - +1%
-0.38ms - +0.19ms
-

update

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
78.62ms - 81.17ms-unsure 🔍
-3% - +2%
-2.12ms - +1.23ms
unsure 🔍
-10% - +2%
-8.37ms - +1.65ms
tip-of-tree
tip-of-tree
79.25ms - 81.43msunsure 🔍
-2% - +3%
-1.23ms - +2.12ms
-unsure 🔍
-9% - +2%
-7.88ms - +2.05ms
previous-release
previous-release
78.41ms - 88.10msunsure 🔍
-2% - +10%
-1.65ms - +8.37ms
unsure 🔍
-3% - +10%
-2.05ms - +7.88ms
-

nop-update

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
25.26ms - 26.21ms-unsure 🔍
-1% - +3%
-0.38ms - +0.76ms
unsure 🔍
-1% - +3%
-0.26ms - +0.84ms
tip-of-tree
tip-of-tree
25.23ms - 25.86msunsure 🔍
-3% - +1%
-0.76ms - +0.38ms
-unsure 🔍
-1% - +2%
-0.33ms - +0.51ms
previous-release
previous-release
25.17ms - 25.73msunsure 🔍
-3% - +1%
-0.84ms - +0.26ms
unsure 🔍
-2% - +1%
-0.51ms - +0.33ms
-
lit-html-repeat

render

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
10.11ms - 10.44ms-unsure 🔍
-2% - +2%
-0.20ms - +0.25ms
unsure 🔍
-3% - +2%
-0.30ms - +0.16ms
tip-of-tree
tip-of-tree
10.10ms - 10.40msunsure 🔍
-2% - +2%
-0.25ms - +0.20ms
-unsure 🔍
-3% - +1%
-0.31ms - +0.12ms
previous-release
previous-release
10.19ms - 10.50msunsure 🔍
-2% - +3%
-0.16ms - +0.30ms
unsure 🔍
-1% - +3%
-0.12ms - +0.31ms
-

update

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
290.22ms - 296.52ms-unsure 🔍
-1% - +2%
-3.01ms - +4.69ms
unsure 🔍
-1% - +2%
-2.77ms - +4.51ms
tip-of-tree
tip-of-tree
290.31ms - 294.74msunsure 🔍
-2% - +1%
-4.69ms - +3.01ms
-unsure 🔍
-1% - +1%
-2.84ms - +2.89ms
previous-release
previous-release
290.68ms - 294.32msunsure 🔍
-2% - +1%
-4.51ms - +2.77ms
unsure 🔍
-1% - +1%
-2.89ms - +2.84ms
-
lit-html-template-heavy

render

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
51.99ms - 53.18ms-unsure 🔍
-0% - +2%
-0.23ms - +1.11ms
unsure 🔍
-1% - +2%
-0.55ms - +0.86ms
tip-of-tree
tip-of-tree
51.85ms - 52.44msunsure 🔍
-2% - +0%
-1.11ms - +0.23ms
-unsure 🔍
-1% - +0%
-0.76ms - +0.19ms
previous-release
previous-release
52.06ms - 52.80msunsure 🔍
-2% - +1%
-0.86ms - +0.55ms
unsure 🔍
-0% - +1%
-0.19ms - +0.76ms
-

update

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
111.52ms - 113.20ms-unsure 🔍
-1% - +1%
-1.42ms - +1.03ms
unsure 🔍
-2% - +0%
-1.95ms - +0.39ms
tip-of-tree
tip-of-tree
111.67ms - 113.44msunsure 🔍
-1% - +1%
-1.03ms - +1.42ms
-unsure 🔍
-2% - +1%
-1.79ms - +0.62ms
previous-release
previous-release
112.32ms - 113.95msunsure 🔍
-0% - +2%
-0.39ms - +1.95ms
unsure 🔍
-1% - +2%
-0.62ms - +1.79ms
-
reactive-element-list

render

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
55.83ms - 56.92ms-unsure 🔍
-1% - +2%
-0.33ms - +1.19ms
unsure 🔍
-2% - +1%
-0.89ms - +0.56ms
tip-of-tree
tip-of-tree
55.41ms - 56.48msunsure 🔍
-2% - +1%
-1.19ms - +0.33ms
-unsure 🔍
-2% - +0%
-1.32ms - +0.12ms
previous-release
previous-release
56.07ms - 57.03msunsure 🔍
-1% - +2%
-0.56ms - +0.89ms
unsure 🔍
-0% - +2%
-0.12ms - +1.32ms
-

update

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
743.61ms - 752.07ms-unsure 🔍
-0% - +1%
-2.57ms - +8.62ms
unsure 🔍
-1% - +1%
-4.41ms - +6.74ms
tip-of-tree
tip-of-tree
741.15ms - 748.47msunsure 🔍
-1% - +0%
-8.62ms - +2.57ms
-unsure 🔍
-1% - +0%
-7.02ms - +3.30ms
previous-release
previous-release
743.04ms - 750.30msunsure 🔍
-1% - +1%
-6.74ms - +4.41ms
unsure 🔍
-0% - +1%
-3.30ms - +7.02ms
-

update-reflect

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
845.09ms - 862.24ms-unsure 🔍
-1% - +2%
-5.37ms - +20.54ms
unsure 🔍
-1% - +2%
-7.36ms - +15.92ms
tip-of-tree
tip-of-tree
836.37ms - 855.79msunsure 🔍
-2% - +1%
-20.54ms - +5.37ms
-unsure 🔍
-2% - +1%
-15.80ms - +9.20ms
previous-release
previous-release
841.51ms - 857.26msunsure 🔍
-2% - +1%
-15.92ms - +7.36ms
unsure 🔍
-1% - +2%
-9.20ms - +15.80ms
-

tachometer-reporter-action v2 for Benchmarks

Copy link
Member

@augustjk augustjk left a comment

Choose a reason for hiding this comment

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

Just a couple non-blocking comments.

@@ -2001,17 +2001,17 @@ const tests = (test: uvu.Test<uvu.Context>, options: ts.CompilerOptions) => {

const baseOptions = () => {
const options = ts.getDefaultCompilerOptions();
options.target = ts.ScriptTarget.ESNext;
options.module = ts.ModuleKind.ESNext;
Copy link
Member

Choose a reason for hiding this comment

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

Is it okay that we're resorting to default module kind here?

Copy link
Member Author

Choose a reason for hiding this comment

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

In both places where we call this (right below), we now set the module kind, so I think it's fine.

Copy link
Member Author

Choose a reason for hiding this comment

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

I haven't yet investigated - but when running npm run test locally, got a non blocking message ❌ [packages/labs/cli:test:actual] Failed with exit status 1.

Hmm, I'm not able to reproduce this right now. I'm doing the following, does this repro for you the same way? Anything else in the log?

cd lit
git clean -dffx
npm ci
cd packages/labs/cli
npm test

@@ -14,7 +14,7 @@
},
"devDependencies": {
"@vitejs/plugin-vue": "^2.3.1",
"typescript": "^4.6.4",
"typescript": "^4.7.4",
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: Should this be ~ instead of ^.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done, thanks

Copy link
Contributor

@AndrewJakubowicz AndrewJakubowicz left a comment

Choose a reason for hiding this comment

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

LGTM! Thank you!

I haven't yet investigated - but when running npm run test locally, got a non blocking message ❌ [packages/labs/cli:test:actual] Failed with exit status 1.

@aomarks
Copy link
Member Author

aomarks commented Jul 9, 2022

I haven't yet investigated - but when running npm run test locally, got a non blocking message ❌ [packages/labs/cli:test:actual] Failed with exit status 1.

I've tried this a number of times recently on 2 machines, and still can't repro. CI hasn't been affected either. It's possible there is some race condition, but I'm just going to merge and keep an eye out.

@aomarks aomarks merged commit 7d185b4 into main Jul 9, 2022
@aomarks aomarks deleted the standardize-typescript branch July 9, 2022 17:56
This was referenced Jul 21, 2022
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

4 participants