angular/packages/core/src
Jessica Janiuk 290ea57a93 fix(core): Access injected parent values using SelfSkip (#39464)
In ViewEngine, SelfSkip would navigate up the tree to get tokens from
the parent node, skipping the child. This restores that functionality in
Ivy. In ViewEngine, if a special token (e.g. ElementRef) was not found
in the NodeInjector tree, the ModuleInjector was also used to lookup
that token. While special tokens like ElementRef make sense only in a
context of a NodeInjector, we preserved ViewEngine logic for now to
avoid breaking changes.

We identified 4 scenarios related to @SkipSelf and special tokens where
ViewEngine behavior was incorrect and is likely due to bugs. In Ivy this
is implemented to provide a more intuitive API. The list of scenarios
can be found below.

1. When Injector is used in combination with @Host and @SkipSelf on the
first Component within a module and the injector is defined in the
module, ViewEngine will get the injector from the module. In Ivy, it
does not do this and throws instead.

2. When retrieving a @ViewContainerRef while @SkipSelf and @Host are
present, in ViewEngine, it throws an exception. In Ivy it returns the
host ViewContainerRef.

3. When retrieving a @ViewContainerRef on an embedded view and @SkipSelf
is present, in ViewEngine, the ref is null. In Ivy it returns the parent
ViewContainerRef.

4. When utilizing viewProviders and providers, a child component that is
nested within a parent component that has @SkipSelf on a viewProvider
value, if that provider is provided by the parent component's
viewProviders and providers, ViewEngine will return that parent's
viewProviders value, which violates how viewProviders' visibility should
work. In Ivy, it retrieves the value from providers, as it should.

These discrepancies all behave as they should in Ivy and are likely bugs
in ViewEngine.

PR Close #39464
2020-11-06 09:23:45 -08:00
..
change_detection refactor(core): _reset() remove nextRecord (#38752) 2020-09-10 08:52:51 -07:00
compiler refactor(compiler): store the fullStart location on ParseSourceSpans (#39486) 2020-11-06 09:01:37 -08:00
debug refactor(core): Create TNodeType.Text to display full template in TView debug (#39233) 2020-10-21 18:33:00 -07:00
di refactor(core): group provider and circular errors (#39251) 2020-10-22 13:42:34 -07:00
i18n build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
interface docs(core): Fix typo in JSDoc for AbstractType<T> (#38541) 2020-08-20 09:30:17 -07:00
linker perf(core): do not recurse into modules that have already been registered (#39514) 2020-11-02 07:51:18 -08:00
metadata feat(core): remove ViewEncapsulation.Native (#38882) 2020-10-08 11:56:03 -07:00
reflection fix(ngcc): detect synthesized delegate constructors for downleveled ES2015 classes (#38463) 2020-08-17 10:55:40 -07:00
render fix(core): Store ICU state in LView rather than in TView (#39233) 2020-10-21 18:33:00 -07:00
render3 fix(core): Access injected parent values using SelfSkip (#39464) 2020-11-06 09:23:45 -08:00
sanitization fix(core): convert legacy-sanitized values to Trusted Types (#39218) 2020-10-16 08:13:52 -07:00
testability build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
util fix(core): mark Trusted Types as declarations (#39471) 2020-10-29 11:58:48 -07:00
view fix(core): Store ICU state in LView rather than in TView (#39233) 2020-10-21 18:33:00 -07:00
zone fix(core): unify the signature between ngZone and noopZone (#37581) 2020-07-28 09:59:49 -07:00
application_init.ts docs: fix typo from singular to plural spelling (#36586) 2020-07-22 10:12:44 -07:00
application_module.ts refactor(core): break i18n.ts into smaller files (#38368) 2020-08-10 15:07:42 -07:00
application_ref.ts docs(core): update a typo in the comment of ngZoneEventCoalescing (#39423) 2020-10-27 14:27:15 -07:00
application_tokens.ts docs: clean up api doc in core (#37053) 2020-06-30 12:11:15 -07:00
change_detection.ts fix(core): remove CollectionChangeRecord symbol (#38668) 2020-09-02 16:45:19 -07:00
codegen_private_exports.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
console.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
core.externs.js build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
core.ts fix(core): do not error when ngDevMode is undeclared (#39415) 2020-10-27 10:45:18 -07:00
core_private_export.ts refactor(core): remove looseIdentical in favor of built-in Object.is (#37191) 2020-06-01 17:19:17 -04:00
core_render3_private_export.ts refactor(compiler-cli): rename $ngDeclareDirective/$ngDeclareComponent to use ɵɵ prefix (#39518) 2020-11-04 10:44:37 -08:00
di.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
error_handler.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
errors.ts refactor(core): reduce the number of circular deps (#38805) 2020-09-18 11:20:08 -07:00
event_emitter.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
ivy_switch.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
linker.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
metadata.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
platform_core_providers.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
r3_symbols.ts refactor(core): add noSideEffects() as private export (#38320) 2020-08-06 09:02:16 -07:00
render.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
version.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
zone.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00