Breaking changes in front-end SDK v2
Major updates overview
-
Server-Side Rendering (SSR) and personalization (p13n)
-
Full content server-side rendering is now enabled for both author and public instances, improving performance and SEO.
-
Author instance now supports Server-Side Rendering of personalized content.
-
-
TypeScript migration
The libraries have been migrated to TypeScript to enhance:
-
Code quality
-
Maintainability
-
Type safety
JavaScript vs TypeScript SPAs: Do you need to update?
-
JavaScript SPAs: No updates required.
-
TypeScript SPAs: Must update page input declarations.
-
Magnolia samples:
-
Affected (update needed): Angular and Angular-SSR.
-
Unaffected: NextJS, Vue, and Nuxt.
-
-
-
Common changes across libraries
You can find best practice examples of how to work with the Frontend SDK v2 (incorporating all of the following information) in the Starter projects. |
Wrapper removal
-
EditorContentHelper
andPersonalizationService
wrappers have been removed. -
SPAs must now import these functions directly from
@magnolia/frontend-helpers-base
:import { EditorContextService, PersonalizationService } from '@magnolia/frontend-helpers-base';
Editor context changes
-
Editors now use
magnoliaContext
to determine page mode (edit/review) in Magnolia. -
Replaces previous iframe-based detection (
inEditor
,inEditorAsync
).
Framework-specific updates
Angular
Enhanced support
-
editable-area
now supports additional children besides content andcustomView
. -
Supports both tag and directive syntax for
editable-area
:<div class="flex flex-col justify-between min-h-[calc(100vh-5rem)]"> <main> <editable-area [content]="main"></editable-area> </main> <div editable-area [content]="footer" [customView]="renderFooter"></div> <ng-template #renderFooter let-components="components"> <app-footer-renderer [components]="components"></app-footer-renderer> </ng-template> </div>
Property changes
-
Removed
EditorContextService
fortemplateAnnotations
andconfig
. -
Removed
templateDefinitions
property ineditable-page
. -
Added new properties to
editable-page
:<editable-page [content]="content" [templateAnnotations]="templateAnnotations" [magnoliaContext]="magnoliaContext" [config]="magnoliaConfig" ></editable-page>
React
-
Updated children processing in
editable-area
.For more details about the differences between children processing in v1 and v2 libraries, see MGNLFE-571 Change the way to process children of
EditableArea
inReactEditor
. -
Removed
templateDefinitions
property fromeditable-page
. -
Added
magnoliaContext
property toeditable-page
.