This is apparently an option! @jdlrobson exploring with PyMiniRacer.
This is one possibility; it would allow us to keep some of the rendering logic in python, and pull it in from the JavaScript.
If we have some node file that renders a Vue template, we can call it from the python and cache the result. Basically identical to the next option, but without a separate service. This might make it slightly easier to manage (and this would probably be better for a v0), but having a long lived service might have some speed improvements. Note caching will regardless be happing on the python side with our memcached servers; likely based on vue component name, and prop values.
We'd likely just augment this function to call the node file (and cache):
Would require a node-based call-out script thing, but long-lived in its own service; we basically only need to add something like this to our docker-compose, and it will largely just work in prod:
# Create a new service that will start on `docker-compose up`.
vue-rendering-server:
# The default image, oldev:latest, has node on it! So can use it to start a Node
# server if we want to.
image: "${OLIMAGE:-oldev:latest}"
ports:
# Syntax is HOST:Container, so this will assume the container (i.e. start.sh in
# this example) is exposing port 9099, and it will make that available on the
# host machine at localhost:9099. Other services in the file (ex the web service)
# will be able to access it at vue-rendering-server:9099
- 9099:9099
networks:
# webnet is the network with the web (ie python) service on it; if we want this
# accessible from the python, it'll need access
- webnet
# And the long-lived command that will be running on this server.
command: node start.sh
IA is exploring a more client-side rendering driven experience, and exploring Rendertron (From the Google Chrome team!), a "Headless Chrome rendering solution", for rendering stuff server-side for browsers that don't support eg es6 modules.