angular-cn/packages/core/test
Kristiyan Kostadinov 18b33e79d3 perf(core): avoid storing LView in __ngContext__ (#41358)
Currently we save a reference to an `LView` on most DOM nodes created by Angular either by saving
the `LView` directly in the `__ngContext__` or by saving the `LContext` which has a reference to
the `LView`. This can be a problem if the DOM node is retained in memory, because the `LView` has
references to all of the child nodes of the view, as well as other internal data structures.

Previously we tried to resolve the issue by clearing the `__ngContext__` when a node is removed
(see https://github.com/angular/angular/pull/36011), but we decided not to proceeed, because it can
slow down destruction due to a megamorphic write.

These changes aim to address the issue while reducing the performance impact by assigning a unique
ID when an `LView` is created and adding it to `__ngContext__`. All active views are tracked in
a map where their unique ID is used as the key. We don't need to worry about leaks within that map,
because `LView`s are an internal data structure and we have complete control over when they are
created and destroyed.

Fixes #41047.

PR Close #41358
2021-04-26 09:31:41 -07:00
..
acceptance perf(core): avoid storing LView in __ngContext__ (#41358) 2021-04-26 09:31:41 -07:00
animation feat(animations): add support for disabling animations through BrowserAnimationsModule.withConfig (#40731) 2021-02-24 15:08:27 -08:00
bundling perf(core): avoid storing LView in __ngContext__ (#41358) 2021-04-26 09:31:41 -07:00
change_detection fix(core): make DefaultIterableDiffer keep the order of duplicates (#23941) 2021-01-26 15:44:42 -08:00
debug fix(core): error if DebugRenderer2.destroyNode is called twice in a row (#41565) 2021-04-12 10:30:11 -07:00
di refactor(compiler): move factory out of injector definition (#41022) 2021-03-08 15:31:30 -08:00
dom perf(common): remove unused methods from DomAdapter (#41102) 2021-03-10 11:48:24 -08:00
i18n build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
linker fix(animations): allow animations on elements in the shadow DOM (#40134) 2021-04-15 12:45:52 -07:00
metadata build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
reflection fix(core): detect synthesized constructors that have been downleveled using TS 4.2 (#41305) 2021-03-23 11:23:04 -07:00
render3 perf(core): avoid storing LView in __ngContext__ (#41358) 2021-04-26 09:31:41 -07:00
sanitization fix(core): ensure sanitizer works if DOMParser return null body (#40107) 2021-01-06 10:32:24 -08:00
strict_types refactor(core): rename `...WithMeta` types to `...Declaration` and alias to `unknown` (#41119) 2021-03-22 08:57:18 -07:00
testability feat(core): update reference and doc to change `async` to `waitAsync`. (#37583) 2020-08-03 12:54:13 -07:00
util fix(core): fix possible XSS attack in development through SSR (#40525) 2021-01-26 09:32:27 -08:00
view refactor(core): rename `ɵɵInjectableDef` interface to `ɵɵInjectableDeclaration` (#41316) 2021-04-07 13:57:12 -07:00
zone test: use `global` util instead of `global` property. (#41739) 2021-04-26 09:29:58 -07:00
BUILD.bazel fix(core): detect synthesized constructors that have been downleveled using TS 4.2 (#41305) 2021-03-23 11:23:04 -07:00
application_init_spec.ts test(core): refactor ApplicationInitStatus tests to avoid TestBed side-effects (#33222) 2021-02-22 08:41:49 -08:00
application_module_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
application_ref_integration_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
application_ref_spec.ts perf(common): remove unused methods from DomAdapter (#41102) 2021-03-10 11:48:24 -08:00
component_fixture_spec.ts feat(core): update reference and doc to change `async` to `waitAsync`. (#37583) 2020-08-03 12:54:13 -07:00
dev_mode_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
directive_lifecycle_integration_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
error_handler_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
event_emitter_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
fake_async_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
forward_ref_integration_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
spies.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
test_bed_async_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
test_bed_spec.ts refactor(core): remove the need for `ɵɵinjectPipeChangeDetectorRef()` (#41231) 2021-03-30 16:46:37 -07:00
testing_internal_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
util_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00