-
Notifications
You must be signed in to change notification settings - Fork 878
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
[labs/virtualizer] Guard window
access to not error on import from non-browser
#4564
Conversation
🦋 Changeset detectedLatest commit: a3c9c67 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
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. |
📊 Tachometer Benchmark ResultsSummary⏳ Benchmarks are currently running. Results below are out of date. nop-update
render
update
update-reflect
Results⏳ Benchmarks are currently running. Results below are out of date. this-change
render
update
update-reflect
this-change, tip-of-tree, previous-release
render
update
nop-update
this-change, tip-of-tree, previous-release
render
update
this-change, tip-of-tree, previous-release
render
update
update-reflect
|
I apologize for being pushy, but will there be any update on this? @kevinpschaaf |
@IMinchev64 I'm taking a look. Just kicked off the tests. |
The size of lit-html.js and lit-core.min.js are as expected. |
@IMinchev64 this looks good. We just need to format the file and add a changeset file (run |
@justinfagnani Is it fine now? |
Hey guts, any update to this? @IMinchev64 @kevinpschaaf. Thinking to use it in our product: #4557 (comment) Thanks 🙏 |
@enesozturk I'm re-running CI now. Looks like the file may still need to be formatted though. cc @IMinchev64 |
Thanks @justinfagnani, I'll be following the updates |
…v64/lit into iminchev/virtualizer-ssr
@justinfagnani I finished running the lint and format scripts as per the guidelines so now the formatting should be fine as well |
@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 |
Hey team, any update to this? @IMinchev64 @justinfagnani |
I'm currently looking into what went wrong with the formatting. @enesozturk |
@justinfagnani I hope the formatting is correct now. It's just for the Virtualizer.ts now so fingers crossed all is good. |
@justinfagnani Can you rerun the ci please? |
@justinfagnani @IMinchev64 seems CI is good, do you have a plan to release this soon? I'd be the first one try it 🙏 |
Would love to get this update! This is a blocker for us using this in components right now as well. |
There was a problem hiding this 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.
Co-authored-by: Augustine Kim <ajk830@gmail.com>
Co-authored-by: Augustine Kim <ajk830@gmail.com>
Hey @graynorton, do you have any update on this? Me and few other people willing to try it. Virtualized list is something necessary while building performant apps. Appreciate if you can prio this 🙏🏽 |
Hey @IMinchev64, I was asking about this one in the discord. It seems like bringing in @augustjk suggested instead of: let _ResizeObserver: typeof ResizeObserver | undefined =
globalThis.ResizeObserver; Going with something like: let _ResizeObserver: typeof ResizeObserver | undefined =
typeof window !== 'undefined' ? window.ResizeObserver : undefined; I tested this in a scenario with Next.js that throws errors because of the |
@hrmcdonald I applied the suggestion from the comment. Thanks for the recommendation! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I updated the changeset to reflect the latest change as this is no longer a breaking change.
This was also approved by @graynorton off-site in our discord discussion.
window
access to not error on import from non-browser
Fixes #4557