Make a prototype of a server-side rendering implementation that uses a Node.js service to do the rendering.
High level architecture:
- Make a Node.js service that accepts HTTP requests asking it to render a Vue component, and returns the rendered HTML (+ maybe some metadata)
- When MediaWiki needs to render a Vue component, it gathers the necessary information (such as props to pass to the Vue component), makes an HTTP request to the service, then embeds the resulting HTML in its response
Current Status
A basic prototype of this extension lives here: https://gitlab.wikimedia.org/catrope/vuessrprovider. See the README file for details about installation and usage. The short version is:
- download this patch in MW Core
- install the VueSSRProvider extension from Gitlab
- To see it in action, install the VueTest extension and check out this patch
- If you are using mw-docker for development, see this page for details on setting up a container for the node service
So far we've had success server-rendering the basic Special:VueTest page which is added by the VueTest extension. With a little bit of additional work @Catrope was also able to server-render the Special:MediaSearch page from the MediaSearch extension (see this patch). Thus far none of our existing Vue code has been written with SSR in mind, so this prototype will probably uncover lots of things that will need to be changed upstream.
Future Tasks
- TBD