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

Enhancement/issue 575 optional prerendering #580

Merged
merged 8 commits into from
May 8, 2021

Conversation

thescientist13
Copy link
Member

@thescientist13 thescientist13 commented Apr 29, 2021

Related Issue

resolves #575

Summary of Changes

  1. Renamed serialize lifecycle -> prerender
  2. Added a prerender configuration option for bypassing puppeteer
  3. Added test cases
  4. Add documentation

At present and maybe not immediately obvious, but this feature is incompatible with using GraphQL from the client side since without running the web components, the *-cache.json files will never get created. As per #576 if we could do this entirely with HTML somehow or some sort of <query-outlet></query-outlet> that would be great? There are some options to explore for sure.

It should be noted graph.json will still exist, so anyone can still use fetch to get the same information.

That said, the site builds suuuuuuper fast without prerendering, in like 5-6s.

Thoughts / Issues To Make

  1. Some possible future prerender options?
    • browser (default) - what we are doing currently
    • RenderElement - Lit's native solution
    • LitElement - as a plugin, specifically for Lit?
    • could then add an SSR "mode"
  2. In this model, it would be nice to make the puppeteer dependency optional, and only install if needed. Should make an issue for that.

Added notes in #576

TODOs

  1. Documentation + disclaimer and some use cases
  2. Upgrade config schema ? - not needed
  3. Some general refactoring to try and share logic in the build command
  4. Track a discussion around "static" templating with web components - added notes in Server Side Rendering and Templating (puppeteer alternatives) #576

@thescientist13 thescientist13 added enhancement Improve something existing (e.g. no docs, new APIs, etc) CLI SSR todos labels Apr 29, 2021
@thescientist13 thescientist13 removed help wanted Extra attention is needed todos labels May 7, 2021
@thescientist13 thescientist13 removed their assignment May 7, 2021
@thescientist13 thescientist13 marked this pull request as ready for review May 7, 2021 01:23
@thescientist13 thescientist13 merged commit 60cd837 into master May 8, 2021
@thescientist13 thescientist13 deleted the enhancement/issue-575-optional-prerendering branch May 8, 2021 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLI Content as Data documentation Greenwood specific docs enhancement Improve something existing (e.g. no docs, new APIs, etc) SSR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add configuration to allow pre-rendering to be optional
1 participant