-
-
Notifications
You must be signed in to change notification settings - Fork 16
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: SSR Shared State #34
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sgammon
added
java
Pull requests that update Java code
module:graalvm
Modules, changes, and issues relating to GraalVM
module:server
Modules, changes, and issues relating to Elide for servers
feature
Large PRs or issues with full-blown features
🚧 WIP
Works-in-progress. Blocks merge
javascript
Features and issues relating to JS
labels
Jul 18, 2022
SonarCloud Quality Gate failed. |
Codecov Report
@@ Coverage Diff @@
## v3 #34 +/- ##
============================================
+ Coverage 59.02% 63.81% +4.78%
- Complexity 350 356 +6
============================================
Files 69 70 +1
Lines 2726 2556 -170
Branches 248 228 -20
============================================
+ Hits 1609 1631 +22
+ Misses 1056 862 -194
- Partials 61 63 +2
Continue to review full report at Codecov.
|
This changeset introduces the concept of shared state, which is computed during a `PageController` execution, and shared with the render context. State is shared with the frontend via an injected JSON blob which the framework can decode on behalf of the developer, similar to how `getServerSideProps` works in Next.js. VM-side, state is exported for guest language use, allowing access to context/state within SSR bundles. Changes enclosed: - Introduce new `PageWithProps` controller, and `props()` extension point, where the developer provides shared state for a given cycle - Support basic for state sharing with SSR scripts - Serialize and inject server-side props for frontend use - Provide `boot` entrypoint for frontend apps, which accounts for server-injected state, + SSR vs. CSR mode - Fix for double-render / double-compute of state - Fix support for VM inspection via `-Delide.vm.inspect` - Fix for `runBlocking` call during HTML rendering
Kudos, SonarCloud Quality Gate passed! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
feature
Large PRs or issues with full-blown features
java
Pull requests that update Java code
javascript
Features and issues relating to JS
module:graalvm
Modules, changes, and issues relating to GraalVM
module:server
Modules, changes, and issues relating to Elide for servers
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This changeset introduces the concept of shared state, which is computed during a
PageController
execution, and shared with the render context.State is shared with the frontend via an injected JSON blob which the framework can decode on behalf of the developer, similar to how
getServerSideProps
works in Next.js.VM-side, state is exported for guest language use, allowing access to context/state within SSR bundles.
Changelog
PageWithProps
controller, andprops()
extension point, where the developer provides shared state for a given request/response cycleboot
entrypoint for frontend apps, which accounts for server-injected state, + SSR vs. CSR mode-Delide.vm.inspect
runBlocking
call during HTML rendering