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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature/issue 1197 Lit v3 upgrade and SSR fixes and enhancements #1201

Conversation

thescientist13
Copy link
Member

@thescientist13 thescientist13 commented Feb 1, 2024

Related Issue

resolves #1197

Depends on the following PRs being merged first

  1. feature/discussion 1117 Isolation Mode (v1)聽#1206
  2. feature/issue 142 adopt ESM and bundler friendly fork of acorn-jsx聽wcc#143
  3. Feature/issue 140 adopt ESM and bundler friendly fork of escodegen聽wcc#141

See demo repo - thescientist13/greenwood-lit-ssr#9

Summary of Changes

  1. Upgrade docs / Lit renderer plugin to v3
  2. Add custom exportConditions for SSR pages and API routes to now include node (like used in Lit's SSR implementation)
  3. Found some areas where we missing were HTML intercepting and optimizing during SSR pages bundling
  4. Removed need for Lit polyfill-support in the CLI (see create Lit specific polyfill plugin聽#728)
  5. Update Lit Renderer plugin README for new usage (getBody API)
  6. Upgrade WCC to version 0.12.0

TODO

  1. Implement basic hydration support for client script - https://lit.dev/docs/ssr/client-usage/#loading-@lit-labsssr-clientlit-element-hydrate-support.js
    • should it be conditional?
  2. Will want to track full data hydration support as part of add support for (progressive) hydration for compatible renderers (globalThis for state?)聽#880 and custom response and constructor props for SSR pages聽#1177
    • export const hydration = true
    • data loader will be needed? - export const function loader() => { /* ... */ }
  3. Find a solution around the customElements.define issue - feature/discussion 1117 Isolation Mode (v1)聽#1206
  4. Needs to handle some downstream dependency ESM patches for WCC
  5. Update Lit Renderer Package README
    • getBody limitation for SSR pages
  6. looks like we don't need to enable preferBuiltins for Lit in our Rollup config anymore?
  7. WCC version 0.12.0 and delete patches/ + postinstall - https://github.com/ProjectEvergreen/wcc/releases/tag/0.12.0
  8. Default Hydration Settings for plugins and docs
    • WCC - false
    • Lit - true
  9. clean up TODOs / comments / cross-tracking

Thoughts / Questions

  1. check if exportConditions are still needed after upgrade Rollup and all plugins to 3.x聽#1087
  2. plugins have to manage their own type="module-shim" 馃
  3. Lit - should track as part of v0.30.0 release blog post
  4. How come the Lit card re-renders on client side in our demo repo? - ah, most likely due to not populating the data on the client side - Hydration always results in duplicate render聽lit/lit#3651
    • need the polyfill?
    • chrome doesn't already support it? (is this a shadowrootmode thing?)

@thescientist13 thescientist13 added bug Something isn't working Plugins Greenwood Plugins CLI feature New feature or request labels Feb 1, 2024
@thescientist13 thescientist13 self-assigned this Feb 1, 2024
@thescientist13 thescientist13 changed the title Feature/lit3 upgrade and ssr fixes and enhancements Feature/issue 1197 lit3 upgrade and ssr fixes and enhancements Feb 1, 2024
@thescientist13 thescientist13 changed the title Feature/issue 1197 lit3 upgrade and ssr fixes and enhancements Feature/issue 1197 Lit v2 upgrade and SSR fixes and enhancements Feb 1, 2024
@thescientist13 thescientist13 changed the title Feature/issue 1197 Lit v2 upgrade and SSR fixes and enhancements Feature/issue 1197 Lit v3 upgrade and SSR fixes and enhancements Feb 1, 2024
@thescientist13 thescientist13 changed the title Feature/issue 1197 Lit v3 upgrade and SSR fixes and enhancements enhancement/issue 1197 Lit v3 upgrade and SSR fixes and enhancements Feb 27, 2024
@thescientist13 thescientist13 changed the title enhancement/issue 1197 Lit v3 upgrade and SSR fixes and enhancements feature/issue 1197 Lit v3 upgrade and SSR fixes and enhancements Feb 27, 2024
@thescientist13 thescientist13 added the question Further information is requested label Feb 27, 2024
@thescientist13 thescientist13 force-pushed the feature/lit3-upgrade-and-ssr-fixes-and-enhancements branch from 1629fb6 to 200a40f Compare February 27, 2024 23:25
@thescientist13 thescientist13 marked this pull request as ready for review February 28, 2024 02:49
@thescientist13 thescientist13 changed the base branch from master to release/0.30.0 March 9, 2024 20:06
@thescientist13 thescientist13 force-pushed the feature/lit3-upgrade-and-ssr-fixes-and-enhancements branch from 02dff52 to 236e43f Compare March 10, 2024 01:40
@thescientist13 thescientist13 merged commit 82460ea into release/0.30.0 Mar 10, 2024
8 checks passed
@thescientist13 thescientist13 deleted the feature/lit3-upgrade-and-ssr-fixes-and-enhancements branch March 10, 2024 02:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking bug Something isn't working CLI documentation Greenwood specific docs feature New feature or request needs upstream Plugins Greenwood Plugins question Further information is requested SSR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Lit v3 upgrade and SSR Pages support and compatibility for renderer plugin
1 participant