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

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
thescientist13 added a commit that referenced this pull request Jun 1, 2024
* initial upgrade for test cases

* upgrade CLI and www to Lit v3

* revert static router test case change

* all tests passing

* patch escodegen for better ESM support

* test for lit element hydration script

* refactor rollup config

* update Lit renderer README and apply conditional Lit script hydration

* comments and TODOs cleanup

* minor rebase patches

* WCC v0.12.0 upgrade and removing patches directory

* hydration default documentation and testing for Lit renderer plugin
thescientist13 added a commit that referenced this pull request Jun 2, 2024
* initial upgrade for test cases

* upgrade CLI and www to Lit v3

* revert static router test case change

* all tests passing

* patch escodegen for better ESM support

* test for lit element hydration script

* refactor rollup config

* update Lit renderer README and apply conditional Lit script hydration

* comments and TODOs cleanup

* minor rebase patches

* WCC v0.12.0 upgrade and removing patches directory

* hydration default documentation and testing for Lit renderer plugin
thescientist13 added a commit that referenced this pull request Jun 22, 2024
* initial upgrade for test cases

* upgrade CLI and www to Lit v3

* revert static router test case change

* all tests passing

* patch escodegen for better ESM support

* test for lit element hydration script

* refactor rollup config

* update Lit renderer README and apply conditional Lit script hydration

* comments and TODOs cleanup

* minor rebase patches

* WCC v0.12.0 upgrade and removing patches directory

* hydration default documentation and testing for Lit renderer plugin
thescientist13 added a commit that referenced this pull request Jun 22, 2024
…ptimization (#1235)

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

* initial upgrade for test cases

* upgrade CLI and www to Lit v3

* revert static router test case change

* all tests passing

* patch escodegen for better ESM support

* test for lit element hydration script

* refactor rollup config

* update Lit renderer README and apply conditional Lit script hydration

* comments and TODOs cleanup

* minor rebase patches

* WCC v0.12.0 upgrade and removing patches directory

* hydration default documentation and testing for Lit renderer plugin

* v0.30.0-alpha.1

* feature/issue 923 native import attributes for CSS and JSON (#1215)

* intial draft of import attributes support for CSS and JSON

* all test cases passing

* need patch package

* wcc patches for import attributes and CSSStylesheet shim

* bump min NodeJS version for exp specs

* temp disable ESLint

* develop based import assertion specs

* serve based import attributes specs

* add preIntercept resource plugin lifecycle and refactor PostCSS to use it

* all test cases passing for import attributes support

* refactor built in CSS and JSON intercepting

* demo code

* raw plugin docs and package.json updates

* update latest documentation for custom loaders support in NodeJS

* update custom import docs

* upgrade wcc v0.13.0

* only need Node 18 for github actions

* css imports and raw plugin interop with test cases

* lit renderer import attribute test cases and documentation

* refactor matchers support for raw plugin instead of patching and add test cases

* disable describe.only

* update usage for custom resource plugins to showcase usage of import attributes

* document preIntercept lifecycle and convert Babel to use it

* restore ESLint

* enable debug logging for failing specs

* refactor theme pack specs

* fix linting

* remove CSS and JSON packages from being publishable

* clean up console logs and comments

* rename exp test cases to loadersnaming prefix

* fix command in github actions

* remove plugin-import-css callout from plugin-postcss README

* remove demo code from website

* refine PostCSS plugin intercepting

* gracefully handle unresolvable assets during CSS optimization

* refactor URL and fs usage

* fix lint

* missed rebase-a-ronis

* missed rebase-a-ronis
thescientist13 added a commit that referenced this pull request Nov 2, 2024
* initial upgrade for test cases

* upgrade CLI and www to Lit v3

* revert static router test case change

* all tests passing

* patch escodegen for better ESM support

* test for lit element hydration script

* refactor rollup config

* update Lit renderer README and apply conditional Lit script hydration

* comments and TODOs cleanup

* minor rebase patches

* WCC v0.12.0 upgrade and removing patches directory

* hydration default documentation and testing for Lit renderer plugin
thescientist13 added a commit that referenced this pull request Nov 2, 2024
…ptimization (#1235)

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

* initial upgrade for test cases

* upgrade CLI and www to Lit v3

* revert static router test case change

* all tests passing

* patch escodegen for better ESM support

* test for lit element hydration script

* refactor rollup config

* update Lit renderer README and apply conditional Lit script hydration

* comments and TODOs cleanup

* minor rebase patches

* WCC v0.12.0 upgrade and removing patches directory

* hydration default documentation and testing for Lit renderer plugin

* v0.30.0-alpha.1

* feature/issue 923 native import attributes for CSS and JSON (#1215)

* intial draft of import attributes support for CSS and JSON

* all test cases passing

* need patch package

* wcc patches for import attributes and CSSStylesheet shim

* bump min NodeJS version for exp specs

* temp disable ESLint

* develop based import assertion specs

* serve based import attributes specs

* add preIntercept resource plugin lifecycle and refactor PostCSS to use it

* all test cases passing for import attributes support

* refactor built in CSS and JSON intercepting

* demo code

* raw plugin docs and package.json updates

* update latest documentation for custom loaders support in NodeJS

* update custom import docs

* upgrade wcc v0.13.0

* only need Node 18 for github actions

* css imports and raw plugin interop with test cases

* lit renderer import attribute test cases and documentation

* refactor matchers support for raw plugin instead of patching and add test cases

* disable describe.only

* update usage for custom resource plugins to showcase usage of import attributes

* document preIntercept lifecycle and convert Babel to use it

* restore ESLint

* enable debug logging for failing specs

* refactor theme pack specs

* fix linting

* remove CSS and JSON packages from being publishable

* clean up console logs and comments

* rename exp test cases to loadersnaming prefix

* fix command in github actions

* remove plugin-import-css callout from plugin-postcss README

* remove demo code from website

* refine PostCSS plugin intercepting

* gracefully handle unresolvable assets during CSS optimization

* refactor URL and fs usage

* fix lint

* missed rebase-a-ronis

* missed rebase-a-ronis
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