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

Skip to content

Conversation

@justinfagnani
Copy link
Collaborator

This PR fixes a few cases where the analyzer was relying on Node-specific behavior, so that the analyzer can now run cleanly in browsers.

To test this the PR creates separate test:server and test:browser scripts where the browser test uses a Rollup-built JS module for typescript and a copy of the server tests' InMemoryAnalyzer itself with some fixes for running outside node.

The InMemoryAnalyzer code is a bit messy, but it's test code. I think we should probably offer a supported InMemoryAnalyzer at some point, derived from out test versions.

The test changes are in the first two commits, the fixes in the third.

@changeset-bot
Copy link

changeset-bot bot commented Oct 23, 2023

🦋 Changeset detected

Latest commit: 44270f9

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

This PR includes changesets to release 7 packages
Name Type
@lit-labs/analyzer Minor
@lit-labs/cli Patch
@lit-labs/gen-manifest Patch
@lit-labs/gen-utils Patch
@lit-labs/gen-wrapper-angular Patch
@lit-labs/gen-wrapper-react Patch
@lit-labs/gen-wrapper-vue 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 Oct 23, 2023

📊 Tachometer Benchmark Results

Summary

nop-update

  • this-change, tip-of-tree, previous-release: unsure 🔍 -7% - +6% (-1.09ms - +0.97ms)
    this-change vs tip-of-tree

render

  • this-change: 65.03ms - 67.94ms
  • this-change, tip-of-tree, previous-release: unsure 🔍 -5% - +5% (-1.19ms - +1.41ms)
    this-change vs tip-of-tree
  • this-change, tip-of-tree, previous-release: unsure 🔍 -1% - +4% (-0.48ms - +1.86ms)
    this-change vs tip-of-tree
  • this-change, tip-of-tree, previous-release: unsure 🔍 -3% - +1% (-1.56ms - +0.40ms)
    this-change vs tip-of-tree

update

  • this-change: 705.67ms - 716.19ms
  • this-change, tip-of-tree, previous-release: slower ❌ 0% - 8% (0.19ms - 4.46ms)
    this-change vs tip-of-tree
  • this-change, tip-of-tree, previous-release: unsure 🔍 -0% - +3% (-0.28ms - +2.56ms)
    this-change vs tip-of-tree
  • this-change, tip-of-tree, previous-release: unsure 🔍 -1% - +0% (-8.61ms - +1.98ms)
    this-change vs tip-of-tree

update-reflect

  • this-change: 690.03ms - 698.44ms
  • this-change, tip-of-tree, previous-release: unsure 🔍 -0% - +1% (-2.91ms - +10.02ms)
    this-change vs tip-of-tree

Results

this-change

render

VersionAvg timevs
65.03ms - 67.94ms-

update

VersionAvg timevs
705.67ms - 716.19ms-

update-reflect

VersionAvg timevs
690.03ms - 698.44ms-
this-change, tip-of-tree, previous-release

render

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
25.67ms - 27.41ms-unsure 🔍
-5% - +5%
-1.19ms - +1.41ms
unsure 🔍
-5% - +5%
-1.22ms - +1.31ms
tip-of-tree
tip-of-tree
25.46ms - 27.40msunsure 🔍
-5% - +4%
-1.41ms - +1.19ms
-unsure 🔍
-5% - +5%
-1.40ms - +1.27ms
previous-release
previous-release
25.57ms - 27.41msunsure 🔍
-5% - +5%
-1.31ms - +1.22ms
unsure 🔍
-5% - +5%
-1.27ms - +1.40ms
-

update

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
57.42ms - 60.55ms-slower ❌
0% - 8%
0.19ms - 4.46ms
unsure 🔍
-4% - +4%
-2.10ms - +2.36ms
tip-of-tree
tip-of-tree
55.20ms - 58.12msfaster ✔
0% - 7%
0.19ms - 4.46ms
-faster ✔
0% - 7%
0.03ms - 4.36ms
previous-release
previous-release
57.26ms - 60.45msunsure 🔍
-4% - +4%
-2.36ms - +2.10ms
unsure 🔍
-0% - +8%
+0.03ms - +4.36ms
-

nop-update

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
15.66ms - 17.40ms-unsure 🔍
-7% - +6%
-1.09ms - +0.97ms
unsure 🔍
-5% - +7%
-0.77ms - +1.21ms
tip-of-tree
tip-of-tree
16.03ms - 17.15msunsure 🔍
-6% - +7%
-0.97ms - +1.09ms
-unsure 🔍
-3% - +6%
-0.45ms - +1.01ms
previous-release
previous-release
15.84ms - 16.78msunsure 🔍
-7% - +5%
-1.21ms - +0.77ms
unsure 🔍
-6% - +3%
-1.01ms - +0.45ms
-
this-change, tip-of-tree, previous-release

render

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
47.48ms - 49.40ms-unsure 🔍
-1% - +4%
-0.48ms - +1.86ms
unsure 🔍
-2% - +4%
-0.91ms - +1.72ms
tip-of-tree
tip-of-tree
47.07ms - 48.43msunsure 🔍
-4% - +1%
-1.86ms - +0.48ms
-unsure 🔍
-3% - +2%
-1.42ms - +0.85ms
previous-release
previous-release
47.13ms - 48.94msunsure 🔍
-4% - +2%
-1.72ms - +0.91ms
unsure 🔍
-2% - +3%
-0.85ms - +1.42ms
-

update

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
101.42ms - 103.88ms-unsure 🔍
-0% - +3%
-0.28ms - +2.56ms
unsure 🔍
-1% - +2%
-0.73ms - +2.46ms
tip-of-tree
tip-of-tree
100.80ms - 102.22msunsure 🔍
-2% - +0%
-2.56ms - +0.28ms
-unsure 🔍
-1% - +1%
-1.51ms - +0.97ms
previous-release
previous-release
100.77ms - 102.81msunsure 🔍
-2% - +1%
-2.46ms - +0.73ms
unsure 🔍
-1% - +1%
-0.97ms - +1.51ms
-
this-change, tip-of-tree, previous-release

render

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
43.79ms - 45.10ms-unsure 🔍
-3% - +1%
-1.56ms - +0.40ms
unsure 🔍
-5% - +1%
-2.25ms - +0.39ms
tip-of-tree
tip-of-tree
44.29ms - 45.75msunsure 🔍
-1% - +4%
-0.40ms - +1.56ms
-unsure 🔍
-4% - +2%
-1.71ms - +1.00ms
previous-release
previous-release
44.23ms - 46.52msunsure 🔍
-1% - +5%
-0.39ms - +2.25ms
unsure 🔍
-2% - +4%
-1.00ms - +1.71ms
-

update

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
718.28ms - 725.40ms-unsure 🔍
-1% - +0%
-8.61ms - +1.98ms
unsure 🔍
-1% - +1%
-6.05ms - +5.76ms
tip-of-tree
tip-of-tree
721.24ms - 729.08msunsure 🔍
-0% - +1%
-1.98ms - +8.61ms
-unsure 🔍
-0% - +1%
-2.96ms - +9.30ms
previous-release
previous-release
717.28ms - 726.70msunsure 🔍
-1% - +1%
-5.76ms - +6.05ms
unsure 🔍
-1% - +0%
-9.30ms - +2.96ms
-

update-reflect

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
719.72ms - 729.41ms-unsure 🔍
-0% - +1%
-2.91ms - +10.02ms
unsure 🔍
-1% - +1%
-5.68ms - +8.85ms
tip-of-tree
tip-of-tree
716.73ms - 725.29msunsure 🔍
-1% - +0%
-10.02ms - +2.91ms
-unsure 🔍
-1% - +1%
-8.87ms - +4.93ms
previous-release
previous-release
717.57ms - 728.40msunsure 🔍
-1% - +1%
-8.85ms - +5.68ms
unsure 🔍
-1% - +1%
-4.93ms - +8.87ms
-

tachometer-reporter-action v2 for Benchmarks

@github-actions
Copy link
Contributor

The size of lit-html.js and lit-core.min.js are as expected.

Copy link
Collaborator

@rictic rictic left a comment

Choose a reason for hiding this comment

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

Do we want to remove NodeJS typings from the analyzer package? Or only make them available in specific files?

That wouldn't help with typescript.sys but hopefully we won't run into that again

"noImplicitOverride": true,
"skipLibCheck": true,
"types": ["node"]
"types": ["node", "mocha"]
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think ultimately the safest thing here would be to have separate tsconfigs:

  1. The main library code, no node typings
  2. The node test code and package-analyzer function, with node typings
  3. Maybe a third with browser typings if they were needed in browser tests.

Not having Node typings would have caught the place where we imported path.

Copy link
Member

@kevinpschaaf kevinpschaaf left a comment

Choose a reason for hiding this comment

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

LGTM

@justinfagnani justinfagnani merged commit 2896209 into main Oct 27, 2023
@justinfagnani justinfagnani deleted the analyzer-browser-tests branch October 27, 2023 21:32
This was referenced Oct 27, 2023
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