[RFC] Support for server-side rendering #2221
Closed
9aoy
started this conversation in
RFC Discussions
Replies: 1 comment
-
resolved by #2528 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We plan to provide some APIs in rsbuild to make it easier for users to use server-side rendering.
Background
Currently, users can implement the ssr capability in rsbuild by themselves, but according to the practice of rsbuild-ssr-example, there are some problems:
output.manifest
config #989Configuring SSR
Rsbuild will provide some SSR related APIs for users to use.
rsbuildServer.ssrLoadModule
. Used to load and execute ssr module.rsbuildServer.getTransformedHtml
. used to get the compiled HTML template.Type
Example
Therefore, users can use ssr in rsbuild like this:
and the user's server-entry and template might look like this:
template.html:
index.server.tsx:
Beta Was this translation helpful? Give feedback.
All reactions