Motivation
- Make it as easy as possible to start with Lupus Decoupled.
- The CSR approach has the advantage that it inherits the backend authention, since in runs in the backend/Drupal context. This makes it a good fit for rendering previews, thus solving #3487123: Previews fails if user is not logged into the frontend.
Proposed resolution
JS: Have the JS-framework generate the client-side app and dump in a suiting dir, e.g. web/_nuxt for nuxt.
Theme: Completely replace the page template with a loader / copy of the HTML shell (index.html) generated by the JS
This will trigger the client-side JS app to be loaded instead of the Drupal site. With nuxt, this should all work out of the box and the app will load. However, it will fetch the ce-api content via a new API request. As a follow-up we can improve this:
Phase2: Ideally we ship the ce-api response already with the Drupal request that generated the JS-app-shell and provide it in a pre-defined way, so some framework glue-code can pick it up.
Issue fork lupus_decoupled-3487125
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
fagothis finally happens: https://www.drupal.org/project/lupus_csr
let's get the integration code added here. We don'T require any really, but it makes sense to for better improvement.
Comment #4
fagoComment #6
fagoWorks well! Merged.