[MGNLFE-685] Update dynamic component creation for Angular 14+ compatibility Created: 25/Oct/23 Updated: 17/Nov/23 Resolved: 15/Nov/23 |
|
| Status: | Closed |
| Project: | Magnolia Frontend Helpers |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 1.5-angular |
| Type: | Improvement | Priority: | Neutral |
| Reporter: | Martina Michlova | Assignee: | Robert Šiška |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Σ Remaining Estimate: | Not Specified | Remaining Estimate: | Not Specified |
| Σ Time Spent: | Not Specified | Time Spent: | Not Specified |
| Σ Original Estimate: | Not Specified | Original Estimate: | Not Specified |
| Issue Links: |
|
|||||||||||||||||||||||||
| Sub-Tasks: |
|
|||||||||||||||||||||||||
| Template: |
|
|||||||||||||||||||||||||
| Acceptance criteria: |
Empty
|
|||||||||||||||||||||||||
| Task DoD: |
[X]*
Doc/release notes changes? Comment present?
[X]*
Downstream builds green?
[X]*
Solution information and context easily available?
[X]*
Tests
[X]*
FixVersion filled and not yet released
[ ] 
Architecture Decision Record (ADR)
|
|||||||||||||||||||||||||
| Documentation update required: |
Yes
|
|||||||||||||||||||||||||
| Date of First Response: | ||||||||||||||||||||||||||
| Epic Link: | Support | |||||||||||||||||||||||||
| Sprint: | DevX 50 | |||||||||||||||||||||||||
| Story Points: | 1 | |||||||||||||||||||||||||
| Team: | ||||||||||||||||||||||||||
| Work Started: | ||||||||||||||||||||||||||
| Approved: |
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: 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. |
| Comments |
| Comment by Christopher Zimmermann [ 31/Oct/23 ] |
|
After discussing with rsiska we intend to:
In Slack: https://magnolia-cms.slack.com/archives/C0469GY5X2L/p1698322618858999 |