angular/integration/ng-modules-importability/README.md
Paul Gschwendtner 6890eab220 test: add integration test to ensure all exported modules can be imported (#60489)
This commit adds a new integration test which will help ensure that all
exported `@NgModule`'s of framework packages can be imported by users
without any errors.

This test is generally useful, but with our upcoming changes with
relative imports, this is a good safety-net. Relative imports could
break re-exported NgModules inside NgModule's. For more details, see:
https://github.com/angular/components/pull/30667

Notably we don't expect any issues for framework package as re-exporting
`@NgModule`'s inside `@NgModule`'s is seemingly a rather rare pattern for
APF libraries (confirmed by Material only having like 4-5 instances).

PR Close #60489
2025-03-20 12:32:36 -07:00

573 B

This test is a safety check, ensuring that all @NgModule's exported by Angular framework packages can be imported in user code without causing any build errors.

Occasionally, an @NgModule might re-export another module. This is fine, but there are cases, especially with relative imports being used, where the compiler (in consuming projects) is not able to find a working import to these re-exported symbols.

The re-exported symbols simply need to be re-exported from the entry-point. For more details on this, see: https://github.com/angular/components/pull/30667.