-
Notifications
You must be signed in to change notification settings - Fork 9
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
Lit v3 upgrade and SSR Pages support and compatibility for renderer plugin #1197
Closed
Labels
Milestone
Comments
thescientist13
added
bug
Something isn't working
Plugins
Greenwood Plugins
SSR
v0.30.0
labels
Jan 20, 2024
thescientist13
changed the title
Lit v3 upgrade + SSR Pages fixes
Lit v3 upgrade + SSR Pages support and compatibility
Jan 20, 2024
thescientist13
changed the title
Lit v3 upgrade + SSR Pages support and compatibility
Lit v3 upgrade + SSR Pages support and compatibility for renderer plugin
Jan 20, 2024
12 tasks
thescientist13
changed the title
Lit v3 upgrade + SSR Pages support and compatibility for renderer plugin
Lit v3 upgrade and SSR Pages support and compatibility for renderer plugin
Jan 27, 2024
This was referenced Feb 1, 2024
thescientist13
added
documentation
Greenwood specific docs
enhancement
Improve something existing (e.g. no docs, new APIs, etc)
feature
New feature or request
and removed
feature
New feature or request
enhancement
Improve something existing (e.g. no docs, new APIs, etc)
labels
Feb 27, 2024
Open
38 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Summary
Was making a demo for Lit SSR on Vercel serverless functions and ran into a few issues. (check out the patches/ folder) in
Node Resolution
We will need to add
node
as a default bundlingexport
condition or else the DOM shim wont come in. This would be needed for SSR pages and API routes.Otherwise, the
serve
command was failing with the below error.This is called out in the Lit SSR docs
Maybe #1187 will handle this by default? Should look into it.
SSR Client Script
Looks we were missing the addition of the SSR client hydration script from our output
Otherwise we were getting double rendering in the browser
customElements.define
conflictHaven't seen this in any of my other demos with WCC, but if you load the home page and click the more products button, the page will crash the following error can be seen in the terminal, meaning this happening in NodeJS land. (Maybe this is why workers are good - #1117 )
We may want to revisit the SSR docs on their recommendation of running in a VM module vs a Worker.
Details
The specific set of fixes and enhancements will need to implement are
renderToString
to use newcollectResult
SSR APIgetBody
API for pages, since there is no "Server Components Only" option with LitglobalThis
for state?) #880 and custom response and constructor props for SSR pages #1177export const hydration = true
export const function loader() => { /* ... */ }
type="module-shim"
🤔The text was updated successfully, but these errors were encountered: