lit / lit/lit.dev

[docs] showcase example of SSR with VM module

Open
#1,354 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
142
Forks
230
PR merge metrics
No merged PRs in 30d

Description

Thanks @KonnorRogers for suggesting!

We can also showcase a running example of SSR with VM module, a la https://stackblitz.com/edit/lit-ssr-vm-module?file=src%2Fserver.js

While making this, I noticed the example in https://lit.dev/docs/ssr/server-usage/#vm-module is different than the example in https://github.com/lit/lit/tree/main/packages/labs/ssr#rendering-in-a-separate-vm-context

They ultimately do the same thing but looks like the lit.dev example was changed in https://github.com/lit/lit.dev/pull/1026 since `renderModule` actually creates a module loader with some DOM shim baked into the global which no longer became necessary. (This actually might be some cruft we should address in the SSR package).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the StackBlitz example's src/server.js, then compare the lit.dev SSR server-usage VM module example with packages/labs/ssr's “Rendering in a separate VM context” example. Confirm which behavior is current and update the documentation to include a working SSR-with-VM example, with the two examples consistent.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js
Domain
documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.