Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@augustjk
Copy link
Member

Split out from #4000 (comment)

The problem with a monorepo using npm workspaces is that all shared node_modules are hoisted to the monorepo root, including any @types/ packages. Some of these types packages can have global declarations that conflict with another package's, or get included in compiled output unnecessarily.

In the PR linked above, I found that @types/react adds TrustedHTML interface to the global which was conflicting with @types/trusted-types and also ends up adding itself as a reference to the .d.ts file where TrustedHTML is used, for example, lit-html.d.ts.

Setting https://www.typescriptlang.org/tsconfig#types makes it explicit which global types are used and included. This does not affect types of any packages that are imported, only those added implicitly by their global usage.

@changeset-bot
Copy link

changeset-bot bot commented Jul 18, 2023

πŸ¦‹ Changeset detected

Latest commit: 2d57aa6

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

This PR includes changesets to release 0 packages

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

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 18, 2023

πŸ“Š Tachometer Benchmark Results

Summary

nop-update

  • lit-html-kitchen-sink: unsure πŸ” -2% - +21% (-0.30ms - +4.29ms)
    this-change vs tip-of-tree

render

  • lit-element-list: 67.81ms - 71.00ms
  • lit-html-kitchen-sink: unsure πŸ” -8% - +6% (-2.40ms - +1.67ms)
    this-change vs tip-of-tree
  • lit-html-repeat: unsure πŸ” -3% - +2% (-0.31ms - +0.25ms)
    this-change vs tip-of-tree
  • lit-html-template-heavy: unsure πŸ” -2% - +4% (-0.84ms - +2.10ms)
    this-change vs tip-of-tree
  • reactive-element-list: unsure πŸ” -2% - +1% (-0.89ms - +0.49ms)
    this-change vs tip-of-tree

update

  • lit-element-list: 694.54ms - 711.07ms
  • lit-html-kitchen-sink: unsure πŸ” -4% - +6% (-3.37ms - +4.35ms)
    this-change vs tip-of-tree
  • lit-html-repeat: unsure πŸ” -6% - +3% (-14.72ms - +6.78ms)
    this-change vs tip-of-tree
  • lit-html-template-heavy: unsure πŸ” -1% - +3% (-0.82ms - +3.37ms)
    this-change vs tip-of-tree
  • reactive-element-list: unsure πŸ” -1% - +1% (-6.83ms - +9.20ms)
    this-change vs tip-of-tree

update-reflect

  • lit-element-list: 665.51ms - 677.07ms
  • reactive-element-list: unsure πŸ” -1% - +1% (-5.28ms - +9.51ms)
    this-change vs tip-of-tree

Results

lit-element-list

render

VersionAvg timevs
67.81ms - 71.00ms-

update

VersionAvg timevs
694.54ms - 711.07ms-

update-reflect

VersionAvg timevs
665.51ms - 677.07ms-
lit-html-kitchen-sink

render

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
27.84ms - 30.90ms-unsure πŸ”
-8% - +6%
-2.40ms - +1.67ms
unsure πŸ”
-13% - +2%
-4.17ms - +0.66ms
tip-of-tree
tip-of-tree
28.39ms - 31.08msunsure πŸ”
-6% - +8%
-1.67ms - +2.40ms
-unsure πŸ”
-12% - +3%
-3.69ms - +0.91ms
previous-release
previous-release
29.26ms - 32.99msunsure πŸ”
-2% - +14%
-0.66ms - +4.17ms
unsure πŸ”
-3% - +13%
-0.91ms - +3.69ms
-

update

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
73.99ms - 78.81ms-unsure πŸ”
-4% - +6%
-3.37ms - +4.35ms
unsure πŸ”
-6% - +3%
-4.84ms - +2.32ms
tip-of-tree
tip-of-tree
72.89ms - 78.93msunsure πŸ”
-6% - +4%
-4.35ms - +3.37ms
-unsure πŸ”
-7% - +3%
-5.76ms - +2.26ms
previous-release
previous-release
75.01ms - 80.31msunsure πŸ”
-3% - +6%
-2.32ms - +4.84ms
unsure πŸ”
-3% - +8%
-2.26ms - +5.76ms
-

nop-update

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
20.74ms - 24.56ms-unsure πŸ”
-2% - +21%
-0.30ms - +4.29ms
unsure πŸ”
-15% - +6%
-3.51ms - +1.54ms
tip-of-tree
tip-of-tree
19.37ms - 21.93msunsure πŸ”
-18% - +1%
-4.29ms - +0.30ms
-faster βœ”
4% - 21%
0.89ms - 5.07ms
previous-release
previous-release
21.98ms - 25.29msunsure πŸ”
-7% - +16%
-1.54ms - +3.51ms
slower ❌
4% - 25%
0.89ms - 5.07ms
-
lit-html-repeat

render

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
9.77ms - 10.19ms-unsure πŸ”
-3% - +2%
-0.31ms - +0.25ms
unsure πŸ”
-1% - +5%
-0.13ms - +0.48ms
tip-of-tree
tip-of-tree
9.83ms - 10.20msunsure πŸ”
-3% - +3%
-0.25ms - +0.31ms
-unsure πŸ”
-1% - +5%
-0.08ms - +0.49ms
previous-release
previous-release
9.59ms - 10.03msunsure πŸ”
-5% - +1%
-0.48ms - +0.13ms
unsure πŸ”
-5% - +1%
-0.49ms - +0.08ms
-

update

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
249.88ms - 263.60ms-unsure πŸ”
-6% - +3%
-14.72ms - +6.78ms
unsure πŸ”
-5% - +2%
-14.29ms - +4.12ms
tip-of-tree
tip-of-tree
252.43ms - 268.98msunsure πŸ”
-3% - +6%
-6.78ms - +14.72ms
-unsure πŸ”
-4% - +4%
-11.42ms - +9.18ms
previous-release
previous-release
255.69ms - 267.96msunsure πŸ”
-2% - +6%
-4.12ms - +14.29ms
unsure πŸ”
-4% - +4%
-9.18ms - +11.42ms
-
lit-html-template-heavy

render

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
48.64ms - 51.09ms-unsure πŸ”
-2% - +4%
-0.84ms - +2.10ms
unsure πŸ”
-1% - +5%
-0.30ms - +2.63ms
tip-of-tree
tip-of-tree
48.43ms - 50.05msunsure πŸ”
-4% - +2%
-2.10ms - +0.84ms
-unsure πŸ”
-1% - +3%
-0.60ms - +1.68ms
previous-release
previous-release
47.89ms - 49.50msunsure πŸ”
-5% - +1%
-2.63ms - +0.30ms
unsure πŸ”
-3% - +1%
-1.68ms - +0.60ms
-

update

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
105.72ms - 108.48ms-unsure πŸ”
-1% - +3%
-0.82ms - +3.37ms
unsure πŸ”
-1% - +2%
-1.34ms - +2.37ms
tip-of-tree
tip-of-tree
104.25ms - 107.40msunsure πŸ”
-3% - +1%
-3.37ms - +0.82ms
-unsure πŸ”
-3% - +1%
-2.76ms - +1.25ms
previous-release
previous-release
105.34ms - 107.82msunsure πŸ”
-2% - +1%
-2.37ms - +1.34ms
unsure πŸ”
-1% - +3%
-1.25ms - +2.76ms
-
reactive-element-list

render

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
43.50ms - 44.32ms-unsure πŸ”
-2% - +1%
-0.89ms - +0.49ms
unsure πŸ”
-2% - +1%
-1.07ms - +0.26ms
tip-of-tree
tip-of-tree
43.56ms - 44.66msunsure πŸ”
-1% - +2%
-0.49ms - +0.89ms
-unsure πŸ”
-2% - +1%
-0.97ms - +0.56ms
previous-release
previous-release
43.79ms - 44.84msunsure πŸ”
-1% - +2%
-0.26ms - +1.07ms
unsure πŸ”
-1% - +2%
-0.56ms - +0.97ms
-

update

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
686.58ms - 697.67ms-unsure πŸ”
-1% - +1%
-6.83ms - +9.20ms
unsure πŸ”
-1% - +1%
-9.41ms - +6.59ms
tip-of-tree
tip-of-tree
685.16ms - 696.72msunsure πŸ”
-1% - +1%
-9.20ms - +6.83ms
-unsure πŸ”
-2% - +1%
-10.76ms - +5.57ms
previous-release
previous-release
687.77ms - 699.30msunsure πŸ”
-1% - +1%
-6.59ms - +9.41ms
unsure πŸ”
-1% - +2%
-5.57ms - +10.76ms
-

update-reflect

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
684.37ms - 694.58ms-unsure πŸ”
-1% - +1%
-5.28ms - +9.51ms
unsure πŸ”
-0% - +2%
-2.34ms - +12.86ms
tip-of-tree
tip-of-tree
682.01ms - 692.72msunsure πŸ”
-1% - +1%
-9.51ms - +5.28ms
-unsure πŸ”
-1% - +2%
-4.63ms - +10.91ms
previous-release
previous-release
678.59ms - 689.85msunsure πŸ”
-2% - +0%
-12.86ms - +2.34ms
unsure πŸ”
-2% - +1%
-10.91ms - +4.63ms
-

tachometer-reporter-action v2 for Benchmarks

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.

Awesome! Just a question on the usage of skipLibCheck. Thank you!

}
]
],
"types": ["mocha"]
Copy link
Contributor

Choose a reason for hiding this comment

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

Are explicit types required on starter packages?

Copy link
Member Author

Choose a reason for hiding this comment

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

It might not be needed when it's cloned to its own template repo but it's needed for the build and test to run within the monorepo.

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.

nvm – noticed that all skipLibCheck was in testdata directories.
I like this change!

@augustjk
Copy link
Member Author

The original commit was cherry-picked from when I was testing in the React update branch, adding configs until build and test scripts were passing. But I figured if we're going this route we should add this to every tsconfig.json we have and be explicit all the way.

@augustjk augustjk merged commit 14f2a2f into main Jul 18, 2023
@augustjk augustjk deleted the explicit-global-types branch July 18, 2023 16:59
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.

3 participants