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

Change window to globalThis in Virtualizer.ts for SSR #4564

Open
wants to merge 17 commits into
base: main
Choose a base branch
from

Conversation

IMinchev64
Copy link

Fixes #4557

Copy link

changeset-bot bot commented Feb 27, 2024

🦋 Changeset detected

Latest commit: 3c45d20

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

This PR includes changesets to release 1 package
Name Type
@lit-labs/virtualizer Major

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

Copy link

google-cla bot commented Feb 27, 2024

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Copy link
Contributor

github-actions bot commented Feb 27, 2024

📊 Tachometer Benchmark Results

Summary

⏳ Benchmarks are currently running. Results below are out of date.

nop-update

  • this-change, tip-of-tree, previous-release: slower ❌ 1% - 10% (0.12ms - 1.03ms)
    this-change vs tip-of-tree

render

  • this-change: 45.47ms - 47.02ms
  • this-change, tip-of-tree, previous-release: slower ❌ 1% - 8% (0.26ms - 1.39ms)
    this-change vs tip-of-tree
  • this-change, tip-of-tree, previous-release: unsure 🔍 -1% - +3% (-0.40ms - +0.94ms)
    this-change vs tip-of-tree
  • this-change, tip-of-tree, previous-release: unsure 🔍 -2% - +1% (-0.75ms - +0.33ms)
    this-change vs tip-of-tree

update

  • this-change: 483.17ms - 492.40ms
  • this-change, tip-of-tree, previous-release: slower ❌ 2% - 15% (0.90ms - 5.66ms)
    this-change vs tip-of-tree
  • this-change, tip-of-tree, previous-release: unsure 🔍 -2% - +3% (-1.67ms - +1.90ms)
    this-change vs tip-of-tree
  • this-change, tip-of-tree, previous-release: unsure 🔍 -2% - +1% (-7.89ms - +3.03ms)
    this-change vs tip-of-tree

update-reflect

  • this-change: 490.59ms - 499.82ms
  • this-change, tip-of-tree, previous-release: unsure 🔍 -1% - +1% (-5.82ms - +4.47ms)
    this-change vs tip-of-tree

Results

⏳ Benchmarks are currently running. Results below are out of date.
this-change

render

VersionAvg timevs
45.47ms - 47.02ms-

update

VersionAvg timevs
483.17ms - 492.40ms-

update-reflect

VersionAvg timevs
490.59ms - 499.82ms-
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
18.70ms - 19.63ms-slower ❌
1% - 8%
0.26ms - 1.39ms
unsure 🔍
-3% - +4%
-0.54ms - +0.76ms
tip-of-tree
tip-of-tree
18.03ms - 18.66msfaster ✔
1% - 7%
0.26ms - 1.39ms
-faster ✔
1% - 7%
0.16ms - 1.26ms
previous-release
previous-release
18.60ms - 19.51msunsure 🔍
-4% - +3%
-0.76ms - +0.54ms
slower ❌
1% - 7%
0.16ms - 1.26ms
-

update

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
39.90ms - 43.43ms-slower ❌
2% - 15%
0.90ms - 5.66ms
unsure 🔍
-1% - +12%
-0.51ms - +4.70ms
tip-of-tree
tip-of-tree
36.78ms - 39.99msfaster ✔
2% - 13%
0.90ms - 5.66ms
-unsure 🔍
-9% - +3%
-3.69ms - +1.32ms
previous-release
previous-release
37.65ms - 41.49msunsure 🔍
-11% - +1%
-4.70ms - +0.51ms
unsure 🔍
-4% - +10%
-1.32ms - +3.69ms
-

nop-update

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
11.14ms - 11.74ms-slower ❌
1% - 10%
0.12ms - 1.03ms
slower ❌
0% - 10%
0.06ms - 1.04ms
tip-of-tree
tip-of-tree
10.52ms - 11.21msfaster ✔
1% - 9%
0.12ms - 1.03ms
-unsure 🔍
-5% - +5%
-0.54ms - +0.50ms
previous-release
previous-release
10.50ms - 11.27msfaster ✔
1% - 9%
0.06ms - 1.04ms
unsure 🔍
-5% - +5%
-0.50ms - +0.54ms
-
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
33.08ms - 34.01ms-unsure 🔍
-1% - +3%
-0.40ms - +0.94ms
unsure 🔍
-2% - +2%
-0.67ms - +0.73ms
tip-of-tree
tip-of-tree
32.80ms - 33.76msunsure 🔍
-3% - +1%
-0.94ms - +0.40ms
-unsure 🔍
-3% - +1%
-0.94ms - +0.47ms
previous-release
previous-release
33.00ms - 34.04msunsure 🔍
-2% - +2%
-0.73ms - +0.67ms
unsure 🔍
-1% - +3%
-0.47ms - +0.94ms
-

update

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
68.00ms - 70.14ms-unsure 🔍
-2% - +3%
-1.67ms - +1.90ms
unsure 🔍
-2% - +3%
-1.19ms - +1.91ms
tip-of-tree
tip-of-tree
67.53ms - 70.38msunsure 🔍
-3% - +2%
-1.90ms - +1.67ms
-unsure 🔍
-2% - +3%
-1.57ms - +2.05ms
previous-release
previous-release
67.60ms - 69.83msunsure 🔍
-3% - +2%
-1.91ms - +1.19ms
unsure 🔍
-3% - +2%
-2.05ms - +1.57ms
-
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
31.54ms - 32.19ms-unsure 🔍
-2% - +1%
-0.75ms - +0.33ms
unsure 🔍
-2% - +1%
-0.72ms - +0.29ms
tip-of-tree
tip-of-tree
31.65ms - 32.51msunsure 🔍
-1% - +2%
-0.33ms - +0.75ms
-unsure 🔍
-2% - +2%
-0.58ms - +0.57ms
previous-release
previous-release
31.70ms - 32.47msunsure 🔍
-1% - +2%
-0.29ms - +0.72ms
unsure 🔍
-2% - +2%
-0.57ms - +0.58ms
-

update

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
514.87ms - 522.33ms-unsure 🔍
-2% - +1%
-7.89ms - +3.03ms
unsure 🔍
-2% - +1%
-8.85ms - +2.87ms
tip-of-tree
tip-of-tree
517.04ms - 525.02msunsure 🔍
-1% - +2%
-3.03ms - +7.89ms
-unsure 🔍
-1% - +1%
-6.59ms - +5.47ms
previous-release
previous-release
517.07ms - 526.10msunsure 🔍
-1% - +2%
-2.87ms - +8.85ms
unsure 🔍
-1% - +1%
-5.47ms - +6.59ms
-

update-reflect

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
523.51ms - 530.52ms-unsure 🔍
-1% - +1%
-5.82ms - +4.47ms
unsure 🔍
-1% - +1%
-3.99ms - +6.16ms
tip-of-tree
tip-of-tree
523.93ms - 531.45msunsure 🔍
-1% - +1%
-4.47ms - +5.82ms
-unsure 🔍
-1% - +1%
-3.49ms - +7.01ms
previous-release
previous-release
522.27ms - 529.59msunsure 🔍
-1% - +1%
-6.16ms - +3.99ms
unsure 🔍
-1% - +1%
-7.01ms - +3.49ms
-

tachometer-reporter-action v2 for Benchmarks

@IMinchev64
Copy link
Author

I apologize for being pushy, but will there be any update on this? @kevinpschaaf

@justinfagnani
Copy link
Collaborator

@IMinchev64 I'm taking a look. Just kicked off the tests.

Copy link
Contributor

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

@justinfagnani
Copy link
Collaborator

@IMinchev64 this looks good. We just need to format the file and add a changeset file (run npm run changeset).

@IMinchev64
Copy link
Author

@IMinchev64 this looks good. We just need to format the file and add a changeset file (run npm run changeset).

@justinfagnani Is it fine now?

@enesozturk
Copy link

Hey guts, any update to this? @IMinchev64 @kevinpschaaf. Thinking to use it in our product: #4557 (comment)

Thanks 🙏

@justinfagnani
Copy link
Collaborator

@enesozturk I'm re-running CI now. Looks like the file may still need to be formatted though. cc @IMinchev64

@enesozturk
Copy link

Thanks @justinfagnani, I'll be following the updates

@IMinchev64
Copy link
Author

@justinfagnani I finished running the lint and format scripts as per the guidelines so now the formatting should be fine as well

@justinfagnani
Copy link
Collaborator

@IMinchev64 the formatting looks like it's formatting way too many files. Do you have the latest dependencies? Make sure your branch is synced to make and run npm ci.

@enesozturk
Copy link

Hey team, any update to this? @IMinchev64 @justinfagnani

@IMinchev64
Copy link
Author

IMinchev64 commented Apr 1, 2024

I'm currently looking into what went wrong with the formatting. @enesozturk

@IMinchev64
Copy link
Author

@justinfagnani I hope the formatting is correct now. It's just for the Virtualizer.ts now so fingers crossed all is good.

@IMinchev64
Copy link
Author

@justinfagnani Can you rerun the ci please?

@enesozturk
Copy link

@justinfagnani @IMinchev64 seems CI is good, do you have a plan to release this soon? I'd be the first one try it 🙏

@hrmcdonald
Copy link

Would love to get this update! This is a blocker for us using this in components right now as well.

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.

I don't want to specifically block this from merging as is, but I don't think this specifically makes virtualizer support SSR. It may prevent it from erroring during SSR but I suspect it won't actually render anything in the server. I'm unsure if that might lead to a hydration mismatch client-side.

packages/labs/virtualizer/src/Virtualizer.ts Outdated Show resolved Hide resolved
.changeset/rare-actors-grab.md Outdated Show resolved Hide resolved
IMinchev64 and others added 3 commits May 8, 2024 11:34
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.

[labs/virtualizer] Virtualizer.ts throws reference error in Node.js environment
5 participants