SSR service
This pattern is to solve the SEO problem of the Launch React or Vue in template
Workflow
Notes:
- When user visits the website, Python web server process the request
- If the template contains React / Vue component, send request to the
Node.js
process to get the HTML of the React / Vue component - After that, the final HTML will be returned to the browser.
- The browser will run JS and attach the event hanlders to the existing DOM elements. This also called rehydration
Packages
- django-react-templatetags
- hypernova will run as a service, which generate HTML of the React / Vue component (server side rendering)
Pros and Cons
Pros:
- It is very flexible and SEO-friendly.
Cons:
- This architecture is not very popular, and there are not many learning resources.