Uploaded image for project: 'Magnolia Frontend Helpers'
  1. Magnolia Frontend Helpers
  2. MGNLFE-685

Update dynamic component creation for Angular 14+ compatibility

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Done
    • Neutral
    • 1.5-angular
    • None
    • None
    • None
    • Yes
    • DevX 50
    • 1
    • Yes

    Description

      Update the current dynamic component creation code to be compatible with Angular 14+.

       

      Context:

      In the current implementation we face these challenges:

      1. Deprecated factory: We are using the deprecated `ComponentFactoryResolver`.

      2. Property vs Input:

      Currently, all properties of a Magnolia node are set directly as properties on the corresponding Angular component.

      This bypasses the distinction between properties and inputs in Angular, resulting in an inability to use inputs as they were intended. This has implications on component lifecycle and binding capabilities.

      Current workaround forces us to interface with Angular’s internal API, as we can’t determine if a property of a magnolia node is supposed to be handled as an input or a property.

       

      Proposed solution:
      PR #226

      1. Replace the deprecated factory

      2. Distinguish Properties vs Inputs:

      Before assigning properties from Magnolia nodes, verify if they should be set as inputs on the Angular component. This will enable the proper use of lifecycle hooks, directives, and other features that rely on inputs.

      Checklists

        Acceptance criteria

        Attachments

          Issue Links

            There are no Sub-Tasks for this issue.

            Activity

              People

                rsiska Robert Šiška
                mmichlova Martina Michlova
                DeveloperX
                Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:
                  Work Started:

                  Checklists

                    Task DoD