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

Introduce support for Server-Side rendering #35

Closed
lschoett opened this issue Jul 25, 2019 · 3 comments
Closed

Introduce support for Server-Side rendering #35

lschoett opened this issue Jul 25, 2019 · 3 comments
Assignees
Labels
core Concerns the piral-core library. enhancement New feature or request rendering Concerns support for (server-side) rendering.
Milestone

Comments

@lschoett
Copy link
Contributor

New Feature Proposal

Description

For some scenarios and supporting older browser version, Server-Side rendering could bring benefits.

Background

Certain older browser might not fully support all features provided by Piral. Another benefit could be improving the overall performance e.g. by adding caching for the rendered pages.

Discussion

One downside of using the Server-Side rendering is that the backend will require more resources for rendering and exposing the content.

@lschoett lschoett added the enhancement New feature or request label Jul 25, 2019
@FlorianRappl FlorianRappl added core Concerns the piral-core library. rendering Concerns support for (server-side) rendering. labels Jul 25, 2019
@FlorianRappl FlorianRappl added this to the 0.9.0 milestone Jul 31, 2019
@FlorianRappl FlorianRappl added the in-review The item is currently being reviewed. label Oct 29, 2019
@FlorianRappl FlorianRappl added in-implementation The item is currently being implemented. and removed in-review The item is currently being reviewed. labels Nov 13, 2019
@FlorianRappl FlorianRappl self-assigned this Nov 13, 2019
@FlorianRappl
Copy link
Contributor

Current options spectrum regarding rendering:

  1. CSR, leave everything as-is
  2. "shallow" ("level-0") SSR that places the feed service response in the delivered code
  3. "level-1" SSR that places the (JS-bundles from the) pilets from the feed service response in the delivered code
  4. "level-2" SSR that pre-evaluates the setup methods of the pilets; the initial state is already delivered and the pilets are all bundled together with the main code (setup will not be run again)
  5. "level-3" SSR that does not stop at the setup method - actually the whole thing is rendered and hydrated from there again

They are not only sorted in terms of "SSRness", but also in terms of complexity (on our side and on the infrastructure of the user for providing / setting up SSR).

For the 0.9 version we will most likely go until "level-1" SSR.

@FlorianRappl
Copy link
Contributor

We just published a sample at https://github.com/smapiot/sample-piral-ssr.

I think overall we are quite far, but I would like to also introduce these convenience functions. Most likely we will create a dedicated package called piral-ssr or piral-server for it.

This package will be free of any dependencies to Express or a specific HTTP requester - so all this would still need to be implemented, however, most of the (Piral-related) work should be done by this package.

@FlorianRappl FlorianRappl added in-testing The item is already out in preview and can be tested. and removed in-implementation The item is currently being implemented. in-testing The item is already out in preview and can be tested. labels Nov 26, 2019
@FlorianRappl
Copy link
Contributor

This is now available as a preview with the package piral-ssr-utils.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Concerns the piral-core library. enhancement New feature or request rendering Concerns support for (server-side) rendering.
Projects
None yet
Development

No branches or pull requests

2 participants