Skip to content

Conversation

kevinpschaaf
Copy link
Contributor

  • Makes dom-shim a factory to return a unique window object per call to importModule
  • Adds node-fetch shim for fetch to dom-shim, along with a couple other required globals for it
  • Adds support to importModule for importing built-in node modules in VM context (required for e.g. node-fetch)
  • Ensures identifier for VM modules is unique per VM context (important to avoid caching issues with dynamic imports)
  • Adds Koa middleware for rendering static HTML files through render-lit-html
    • Scripts to be loaded on server should be marked with ssr attribute
    • Scripts to be loaded only on server (e.g. for fetching/initializing data) can be marked with type="ssr-only" to prevent loading on client
    • If a module script loaded on the server exports an initializeSSR method, it will be invoked & awaited
    • If initializeSSR returns any values, they will be interpolated into <!--lit-ssr-value--> markers placed in the HTML file

Associated PR's:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant