IssueRaiser

Imperative View & Template Composition APIs

*Note 1: This proposal has its origin in [RFC: Exploration of use-cases for Angular JIT compilation mode](https://github.com/angular/angular/issues/43133) and aims to address the concerns around AOT compiler not being flexible enough for very dynamic, or heavily data-driven UIs.* *Note 2: 📺 Check out the [video recording of a community discussion about this proposal](https://youtu.be/FbJLC7GxAAs?t=1891) @ [angularnation.net](https://www.angularnation.net/)* ### Description While declarative templating is great for most cases, developers often need more flexibility to create UIs dynamically, using components and directives (often) not known at the time of writing the component that generates this UI. Common use cases include data driven UIs (including forms), A/B experiments, UIs generated via plugin systems, etc. Angular currently enables dynamic view or template creation only with major drawbacks in two ways: 1. Via the JIT compiler, which can take any string and compile it on the fly within the browser. This approach compromises security of the application (there is a high risk of introducing XSS and compromising the overall security model of Angular) and also comes with a major performance penalty due to the runtime cost of the compilation, and payload size of the overhead of the compiler. 2. Via [ViewContainerRef#createComponent](https://angular.io/api/core/ViewContainerRef#createComponent) and similar APIs, which don't offer enough flexibility to dynamically comp

Posted by IgorMinar on Aug 11, 2021, 7:53 PM

Tags

Related issues

Raise real-world problems, find people facing the same issue, and discuss solutions.3,000 issues0 comments

pricing (Software)

Imperative View & Template Composition APIs

IgorMinarAug 11, 2021, 7:53 PM

*Note 1: This proposal has its origin in [RFC: Exploration of use-cases for Angular JIT compilation mode](https://github.com/angular/angular/issues/43133) and aims to address the concerns around AOT compiler not being flexible enough for very dynamic, or heavily data-driven UIs.* *Note 2: 📺 Check out the [video recording of a community discussion about this proposal](https://youtu.be/FbJLC7GxAAs?t=1891) @ [angularnation.net](https://www.angularnation.net/)* ### Description While declarative templating is great for most cases, developers often need more flexibility to create UIs dynamically, using components and directives (often) not known at the time of writing the component that generates this UI. Common use cases include data driven UIs (including forms), A/B experiments, UIs generated via plugin systems, etc. Angular currently enables dynamic view or template creation only with major drawbacks in two ways: 1. Via the JIT compiler, which can take any string and compile it on the fly within the browser. This approach compromises security of the application (there is a high risk of introducing XSS and compromising the overall security model of Angular) and also comes with a major performance penalty due to the runtime cost of the compilation, and payload size of the overhead of the compiler. 2. Via [ViewContainerRef#createComponent](https://angular.io/api/core/ViewContainerRef#createComponent) and similar APIs, which don't offer enough flexibility to dynamically comp

Comments (0)

No comments yet. Start the discussion.

Comment on this issue