[PAGES-207] SPA renderer Created: 09/Apr/19  Updated: 19/Nov/19  Resolved: 07/Nov/19

Status: Closed
Project: Magnolia pages module
Component/s: None
Affects Version/s: 5.7.2, 6.0
Fix Version/s: 6.2

Type: Story Priority: Neutral
Reporter: Christopher Zimmermann Assignee: Sang Ngo Huu
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 0d
Time Spent: 13d 3.5h
Original Estimate: Not Specified

Issue Links:
Cloners
is cloned by PAGES-208 Provide endpoints serving the templat... Closed
duplicate
is duplicated by PAGES-182 Static renderer for SPA Closed
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Release notes required:
Yes
Documentation update required:
Yes
Date of First Response:
Epic Link: SPA Editor
Sprint: SPA Editor 7, SPA Editor 8, SPA Editor 9, SPA Editor 10
Story Points: 8

 Description   

User story:

As a developer I want to publish my entire SPA build into a Magnolia module, including the index.html page it creates, and use the index.html as a template script, so that I can easily setup the Page Editor to edit the SPA.

Notes:

Frontend frameworks always build a default index.html page which contains the relative links to other files (such as js & css) and sometimes other metadata such as a "base" path. Often the relatively linked files have new names with every build to prevent unwanted caching, and sometimes the js files are split to optimize app loading performance. It can be tiresome and error-prone to transfer the proper information from this file to a regular freemarker template script. Ideally a template definition can point directly to this generated index file and take care of anything else such as providing the functionality that a page directive does.

Acceptance criteria:

  • Developer only needs to provide the path to the index file in their template definition.
  • Developer provides a different template renderer name than freemarker, maybe "static", or "single-page-app".
  • Developer does not need to add a page directive or any area directives in the file, or change it in any way.

 

Additional notes:

Possibly the renderer does the following (in the future):

  • Loads the specified index.html file.
  • Adds the Magnolia page directive.
  • Set a BaseURL in the page.
  • Write "Mapping configuration" to the page.
  • Write "EditorHints" to the page (when in Page Editor).

 



 Comments   
Comment by Sang Ngo Huu [ 08/Oct/19 ]

I also use `ResourceTemplatingFuntions` to load css and js file dynamic, but seem it is slow. I will investigate more

Generated at Mon Feb 12 06:16:40 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.