Skip to content

Commit

Permalink
feature/issue 1197 Lit v3 upgrade and SSR fixes and enhancements (#1201)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
thescientist13 committed Jun 22, 2024
1 parent 957a780 commit 7167efc
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion packages/plugin-renderer-lit/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ yarn add @greenwood/plugin-renderer-lit --dev
1. Please familiarize yourself with some of the [caveats](https://lit.dev/docs/ssr/overview/#library-status) called out in the Lit docs, like:
- Lit SSR [**only** renders into declarative shadow roots](https://github.com/lit/lit/issues/3080#issuecomment-1165158794), so you will have to keep browser support and polyfill usage in mind.
- At this time, `LitElement` does not support `async` work. You can follow along with this issue [in the Lit repo](https://github.com/lit/lit/issues/2469).
1. Lit only supports templates on the server side for HTML generated content, thus Greenwood's `getBody` API must be used. We would love for [server only components](https://github.com/lit/lit/issues/2469#issuecomment-1759583861) to be a thing though!
1. Lit only supports templates on the server side for HTML only generated content, thus Greenwood's `getBody` API must be used. We would love for [server only components](https://github.com/lit/lit/issues/2469#issuecomment-1759583861) to be a thing though!
1. Lit does not support [`CSSStyleSheet` (aka CSS Modules) in their SSR DOM shim](https://github.com/lit/lit/issues/2631#issuecomment-1065400805).
1. Full hydration support is not available yet. See [this Greenwood issue](https://github.com/ProjectEvergreen/greenwood/issues/880) to follow along with when it will land.

Expand Down Expand Up @@ -87,6 +87,16 @@ export async function getBody() {
}
```

<<<<<<< HEAD
=======
## Caveats

There are a few considerations to take into account when using a `LitElement` as your page component:
- Lit SSR [**only** renders into declarative shadow roots](https://github.com/lit/lit/issues/3080#issuecomment-1165158794), so you will have to keep browser support and polyfill usage in mind.
- Depending on your use case, SSR bundling may break due to bundle chunking and code splitting by Rollup, which we are [hoping to correct ASAP](https://github.com/ProjectEvergreen/greenwood/issues/1118).
- At this time, `LitElement` does [not support `async` work](https://lit.dev/docs/ssr/overview/#library-status) which makes data fetching in pages a bit of challenge. You can follow along with this issue [in the Lit repo](https://github.com/lit/lit/issues/2469).

>>>>>>> 82460ea4 (feature/issue 1197 Lit v3 upgrade and SSR fixes and enhancements (#1201))
## Options

### Isolation Mode
Expand Down

0 comments on commit 7167efc

Please sign in to comment.