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

Feature/issue 709 custom render plugin #869

Merged
merged 20 commits into from
Jan 28, 2022

Conversation

thescientist13
Copy link
Member

@thescientist13 thescientist13 commented Jan 17, 2022

Related Issue

#709 / #710

Summary of Changes

  1. Introduced a renderer plugin API
  2. Introduced a Lit renderer plugin
  3. Added headers to Resource plugins for optimize to support both static (file) and server (route) contexts
  4. Added documentation for custom render plugin API

Screen Shot 2022-01-17 at 1 08 58 PM

TODO

  1. make greenwood implementation a plugin
  2. Investigate how to delineate between render (server) vs prerender (client) and understand how to custom render an SSG site (w/ hydration?)
  3. html plugin refactoring
  4. Tests
  5. Docs
  6. Remove demo code

Thoughts / Questions

  1. Should we use VM context for Lit plugin?
  2. Ongoing Investigations (merge into the release branch issue tracking list)
    • static rendering w/ custom renderer, e.g. www/ + Lit (just have experimental support right now) and define patterns / practices
    • hydration support for SSG & SSR (how do we get the data in an SSG context though... ?)
    • streaming support for HTML via generators would be awesome!

@thescientist13 thescientist13 added documentation Greenwood specific docs Plugins Greenwood Plugins CLI SSR discussion tied to an ongoing discussion or meeting notes feature New feature or request labels Jan 17, 2022
@thescientist13 thescientist13 self-assigned this Jan 17, 2022
@thescientist13 thescientist13 marked this pull request as ready for review January 25, 2022 22:46
@thescientist13
Copy link
Member Author

thescientist13 commented Jan 27, 2022

Good catch on the call @hutchgrant 🔍 👀

I was trying to be a bit too clever maybe by having an option for SSR routes to be rendered by a custom renderer (e.g. Lit) AND also puppeteer, but that seems excessive since the whole point of a custom renderer is to avoid that overhead. Puppeteer was basically giving us its own HTML instead of the nice HTML that Lit gave us with declarative shadow DOM and all the nice hydration markers.

Verified it works as expected now and also updated that spec to test the affirmative (explicit name matches) as opposed for testing the negative (absence of default placeholder text). Thanks! 🤝
Screen Shot 2022-01-27 at 9 06 59 AM

@thescientist13 thescientist13 merged commit 3b237d4 into release/0.23.0 Jan 28, 2022
@thescientist13 thescientist13 deleted the feature/issue-709-custom-render-plugin branch January 28, 2022 01:13
thescientist13 added a commit that referenced this pull request Feb 12, 2022
* POC of Lit SSR for development

* render lit SSR from html

* add renderer API to Greenwood

* mini refactor

* stub out lit renderer plugin

* build and serve support

* update specs

* fix incorrect callback assignment

* refactor SSR worker for Greenwood as a plugin

* support for intercepting and optimizing SSR routes and add dual SSR support for plugins

* template support for SSR routes

* set prerender true in spec

* add minimumal support for using custom renderer to prerender static pages

* lit render SSR specs

* address spec TODOs

* fix specs

* SSR specs for development

* documentation for custom renderer plugin

* remove puppeteer prerendering option from SSR routes and ensure explicit SSR output for lit renderer

* remove demo code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLI discussion tied to an ongoing discussion or meeting notes documentation Greenwood specific docs feature New feature or request Plugins Greenwood Plugins SSR
Projects
None yet
1 participant