Which @angular/* package(s) are relevant/related to the feature request?
core
Description
In this blog post it is communicated that the value for standalone will default to true in version 19.
This will likely break our application that depends on being able to dynamically loading external components. Most of these external components were not developed with standalone in mind, so they have relied on the implicit standalone: false up until now.
The components are loaded by:
- Import
https://cdn-url/the-component.js
the-component.js exports a @Component and an optional @NgModule
- Instantiate/compile the module with
createNgModule() (unless the component is standalone)
- Instantiate/compile the component with
ViewContainerRef.createComponent
After version 19, I'm assuming that the ViewContainerRef.createComponent or the createNgModule calls will fail, since the component now implicitly has standalone: true, but it is also declared in the @NgModule and has no imports.
Proposed solution
Perhaps one of:
- Add an option to either
createNgModule or createComponent where the default value can be overridden.
- Allow standalone components to be part of a NgModule
declarations array, and make them inherit the NgModule imports or something.
This is all based on a lot of assumptions since as far as I can tell the new default isn't implemented yet. So I'm not sure what a good solution looks like (or even if one is needed).
Alternatives considered
None yet
Which @angular/* package(s) are relevant/related to the feature request?
core
Description
In this blog post it is communicated that the value for
standalonewill default totruein version 19.This will likely break our application that depends on being able to dynamically loading external components. Most of these external components were not developed with
standalonein mind, so they have relied on the implicitstandalone: falseup until now.The components are loaded by:
https://cdn-url/the-component.jsthe-component.jsexports a@Componentand an optional@NgModulecreateNgModule()(unless the component is standalone)ViewContainerRef.createComponentAfter version 19, I'm assuming that the
ViewContainerRef.createComponentor thecreateNgModulecalls will fail, since the component now implicitly hasstandalone: true, but it is also declared in the@NgModuleand has no imports.Proposed solution
Perhaps one of:
createNgModuleorcreateComponentwhere the default value can be overridden.declarationsarray, and make them inherit the NgModuleimportsor something.This is all based on a lot of assumptions since as far as I can tell the new default isn't implemented yet. So I'm not sure what a good solution looks like (or even if one is needed).
Alternatives considered
None yet