-
Notifications
You must be signed in to change notification settings - Fork 4.7k
SSR guide #864
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
SSR guide #864
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've made a few small suggestions inline.
I had two other thoughts:
- If we're going to merge this as we go then we should probably have a disclaimer at the top of each page warning that the guide is incomplete.
- I got a little bit confused by the Express example. The example itself is fine but it doesn't include any client-side hydration. There should probably be a note somewhere that we're only dealing with the server part for now and hydration will be covered later.
On a loosely related note, the API Reference for mount
suggests that it takes a second argument called isHydrate
. When I tried playing with SSR myself that threw me for a while. As far as I can tell that isn't true, it only takes a single argument and you just use createSSRApp
in the client code to trigger hydration. Perhaps something to update when the relevant SSR bits are added to the API Reference.
src/guide/ssr/getting-started.md
Outdated
Unlike Vue client-only application, SSR one should use a different method for creating an application instance: instead of `createApp` we need to use `createSSRApp`. | ||
|
||
```js | ||
// server.js |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm guessing the point of this line is to remind the reader that this is server-side Node code? If that is the intention then perhaps it'd be better to state it explicitly rather than implying it via a file name?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed it altogether as it's a bit early to explain about Node code before we dropped an Express name
src/guide/ssr/getting-started.md
Outdated
|
||
## Integrating with a Server | ||
|
||
To run an application, [Express](https://expressjs.com/): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was there meant to be more to this sentence? Maybe something explaining that you don't have to use Express but we're going to use it to complete the example on this page?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extended a bit
Co-authored-by: skirtle <[email protected]>
Co-authored-by: skirtle <[email protected]>
Co-authored-by: skirtle <[email protected]>
Co-authored-by: skirtle <[email protected]>
@skirtles-code I've added a few sentences and a disclaimer to show the guide is incomplete. As for hydration: it seems in the previous guide it was covered in webpack build, do you think we should have it before? |
@NataliaTepluhina I'm not sure how to cover hydration without a build. I tried to create the simplest example I could that used client-side hydration but I don't think it would make for a good documentation example: https://github.com/skirtles-code/vue-3-ssr-example-no-build In practice I can't imagine anyone wanting to do it that way and the tricks I used to get it to work are more likely to confuse someone rather than clarifying anything. I think the paragraph you've added to the end of the current page explaining that client-side hydration will be explained later is sufficient to avoid confusion. |
fixes vuejs#864
fixes vuejs#864
Description of Problem
This is the first PR to start with Server side rendering guide. This particular one covers only the most basic SSR - without templating, without any bundler. I plan to extend this section in the follow-up PRs.