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

Updates for integration with lit-ssr-hacker-news app #64

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

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