angular/packages/core/src
Alex Rickabaugh f0bf29a24d fix(compiler-cli): preserve forwardRef for component scopes (#46139)
Angular generally supports cycles between components in the same NgModule.
We have a mechanism of moving the component scope declaration into the
NgModule file in this case. This ensures that Angular never itself
introduces an import which creates a cycle.

What happens if the cycle already exists in the user's program, though, is a
bit different. In these cases, the "correct" emit for Angular is to generate
the component scope (whether direct or remote) inside of a closure, to
prevent evaluating the scope's references until module evaluation is
complete and all cyclic imports have been resolved. We don't want to do this
for *all* scopes because the code size cost of emitting a function wrapper
is non-zero.

In this fix, we take the presence of a `forwardRef` in a component's
`imports` or in an NgModule `declarations` or `imports` as a sign that
component scopes emitted into those files need to be protected against
cyclic references. In a future commit, we may introduce a warning or error
if cyclic imports are not protected behind `forwardRef` in these cases, but
this will take some time to implement.

PR Close #46139
2022-05-26 17:42:01 -07:00
..
change_detection perf(core): allow checkNoChanges mode to be tree-shaken in production (#45913) 2022-05-09 12:04:04 -07:00
compiler refactor(compiler-cli): emit NgModule dependencies of standalone components (#45672) 2022-04-20 05:45:56 -07:00
debug feat(core): triggerEventHandler accept optional eventObj (#45279) 2022-03-09 13:51:54 -08:00
di docs: fix inline JSDoc tags (@see --> @link) (#46040) 2022-05-19 13:32:20 -07:00
i18n refactor(core): Switch over to new closure LOCALE vs getLocale() (#45302) 2022-03-10 12:48:29 -08:00
interface ci: Upgrade tsec to 0.2.0. (#44205) 2021-11-24 18:55:58 +00:00
linker feat(core): implement EnvironmentInjector with adapter to NgModuleRef (#45626) 2022-04-18 09:28:42 -07:00
metadata docs: update directives info to include standalone (#46078) 2022-05-23 13:54:11 -07:00
reflection refactor(core): remove unused logic from reflection capabilities (#45335) 2022-03-24 11:02:39 -07:00
render refactor: delete the View Engine runtime (#43884) 2021-11-23 21:10:06 +00:00
render3 fix(compiler-cli): preserve forwardRef for component scopes (#46139) 2022-05-26 17:42:01 -07:00
sanitization refactor(core): make the error messages tree shakable (#44359) 2022-01-18 17:38:10 -08:00
testability perf(platform-browser): avoid including Testability by default in bootstrapApplication (#45885) 2022-05-10 13:34:28 -07:00
util feat(core): support TypeScript 4.7 (#45749) 2022-04-29 12:19:45 -04:00
view refactor: delete the View Engine runtime (#43884) 2021-11-23 21:10:06 +00:00
zone fix(core): error if NgZone.isInAngularZone is called with a noop zone (#44800) 2022-01-24 10:44:43 -08:00
application_init.ts perf(core): make Compiler, ApplicationRef and ApplicationInitStatus tree-shakable (#45102) 2022-02-18 13:40:02 -08:00
application_module.ts perf(core): make LOCALE_ID and other tokens from ApplicationModule tree-shakable (#45102) 2022-02-18 13:40:02 -08:00
application_ref.ts refactor(core): make Testability compatible with tree-shaking (#45657) 2022-05-05 11:50:23 -07:00
application_tokens.ts refactor(core): make platform core providers tree-shakable (#45506) 2022-04-12 22:28:23 +00:00
change_detection.ts perf(core): remove support for the deprecated WrappedValue (#43507) 2021-10-01 12:25:19 -04:00
console.ts refactor(core): make platform core providers tree-shakable (#45506) 2022-04-12 22:28:23 +00:00
core.externs.js build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
core.ts feat(core): implement EnvironmentInjector with adapter to NgModuleRef (#45626) 2022-04-18 09:28:42 -07:00
core_private_export.ts refactor(core): make Testability compatible with tree-shaking (#45657) 2022-05-05 11:50:23 -07:00
core_render3_private_export.ts feat(core): allow to throw on unknown properties in tests (#45853) 2022-05-03 15:49:00 -07:00
di.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
error_details_base_url.ts refactor(core): move runtime error code logic (#44398) 2022-01-06 23:43:18 +00:00
error_handler.ts refactor(core): move runtime error code logic (#44398) 2022-01-06 23:43:18 +00:00
errors.ts refactor(core): disallow standalone components in importProvidersFrom calls (#45837) 2022-05-03 13:12:36 -07:00
event_emitter.ts refactor(core): ensure compatibility with noImplicitOverride (#42512) 2021-07-12 13:11:15 -07:00
linker.ts feat(core): add getNgModuleById function to retrieve loaded NgModules by id (#43580) 2021-10-04 16:35:26 -07:00
metadata.ts refactor(core): move ModuleWithProviders type (#45722) 2022-04-27 09:05:51 -07:00
platform_core_providers.ts refactor(core): make platform core providers tree-shakable (#45506) 2022-04-12 22:28:23 +00:00
r3_symbols.ts refactor(core): rename ɵɵInjectableDef interface to ɵɵInjectableDeclaration (#41316) 2021-04-07 13:57:12 -07:00
render.ts refactor(core): clean up circular dependencies (#39722) 2020-11-18 09:15:29 -08:00
version.ts Revert "refactor(core): optimize calls to split and slice while computing version parts (#41208)" 2021-05-12 14:13:50 -04:00
zone.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00