angular-cn/packages
crisbeto 95fc3d4c5c fix(core): ngOnDestroy on multi providers called with incorrect context (#35840)
Currently destroy hooks are stored in memory as `[1, hook, 5, hook]` where
the numbers represent the index at which to find the context and `hook` is
the function to be invoked. This breaks down for `multi` providers,
because the value at the index will be an array of providers, resulting in
the hook being invoked with an array of all the multi provider values,
rather than the provider that was destroyed. In ViewEngine `ngOnDestroy`
wasn't being called for `multi` providers at all.

These changes fix the issue by changing the structure of the destroy hooks to `[1, hook, 5, [0, hook, 3, hook]]` where the indexes inside the inner array point to the provider inside of the multi provider array. Note that this is slightly different from the original design which called for the structure to be `[1, hook, 5, [hook, hook]`, because in the process of implementing it, I realized that we wouldn't get passing the correct context if only some of the `multi` providers have `ngOnDestroy` and others don't.

I've run the newly-added `view_destroy_hooks` benchmark against these changes and compared it to master. The difference seems to be insignificant (between 1% and 2% slower).

Fixes #35231.

PR Close #35840
2020-04-07 10:31:41 -07:00
..
animations build: provide full paths to `ts_api_guardian_test_npm_package` and `ts_api_guardian_test` (#36034) 2020-03-12 09:49:00 -07:00
bazel build: rebuild yarn lock from scratch (#36377) 2020-04-03 11:09:17 -07:00
benchpress fix(benchpress): update dependencies (#36205) 2020-04-01 13:19:33 -07:00
common fix(common): let `KeyValuePipe` accept type unions with `null` (#36093) 2020-03-24 14:41:41 -07:00
compiler fix(compiler-cli): pass real source spans where they are empty (#31805) 2020-04-06 09:28:27 -07:00
compiler-cli fix(ngcc): detect non-emitted, non-imported TypeScript helpers (#36418) 2020-04-07 10:19:22 -07:00
core fix(core): ngOnDestroy on multi providers called with incorrect context (#35840) 2020-04-07 10:31:41 -07:00
docs refactor(core): remove deprecated Renderer (#33019) 2019-10-08 09:23:00 -07:00
elements fix(elements): correctly handle setting inputs to `undefined` (#36140) 2020-03-24 10:29:33 -07:00
examples docs: changes AoT to AOT for consistency (#35112) 2020-02-04 10:43:33 -08:00
forms style(forms): reformat of the `forms` package after clang update (#36466) 2020-04-07 09:47:09 -07:00
http build: provide full paths to `ts_api_guardian_test_npm_package` and `ts_api_guardian_test` (#36034) 2020-03-12 09:49:00 -07:00
language-service test(language-service): delete expression-cases.ts (#36468) 2020-04-07 10:20:27 -07:00
localize build: provide full paths to `ts_api_guardian_test_npm_package` and `ts_api_guardian_test` (#36034) 2020-03-12 09:49:00 -07:00
platform-browser build: provide full paths to `ts_api_guardian_test_npm_package` and `ts_api_guardian_test` (#36034) 2020-03-12 09:49:00 -07:00
platform-browser-dynamic build: provide full paths to `ts_api_guardian_test_npm_package` and `ts_api_guardian_test` (#36034) 2020-03-12 09:49:00 -07:00
platform-server fix(platform-server): update `xhr2` dependency (#36366) 2020-04-01 13:31:38 -07:00
platform-webworker build: provide full paths to `ts_api_guardian_test_npm_package` and `ts_api_guardian_test` (#36034) 2020-03-12 09:49:00 -07:00
platform-webworker-dynamic build: provide full paths to `ts_api_guardian_test_npm_package` and `ts_api_guardian_test` (#36034) 2020-03-12 09:49:00 -07:00
private/testing fix(core): adhere to bootstrap options for JIT compiled components (#35534) 2020-03-19 08:57:39 -07:00
router fix(router): allow UrlMatcher to return null (#36402) 2020-04-03 11:16:23 -07:00
service-worker build: enable service-worker tests on saucelabs (#36129) 2020-04-01 15:37:47 -07:00
upgrade build: provide full paths to `ts_api_guardian_test_npm_package` and `ts_api_guardian_test` (#36034) 2020-03-12 09:49:00 -07:00
zone.js style(zone.js): fix lint errors after clang update (#36487) 2020-04-07 10:10:34 -07:00
BUILD.bazel build: reference zone.js from source directly instead of npm. (#33046) 2019-11-06 00:48:34 +00:00
README.md docs: add doc reference to npm package readme (#33911) 2019-11-20 14:46:23 -08:00
circular-deps-test.conf.js build: allow custom module resolution for ts-circular-deps tests (#36226) 2020-03-27 11:14:49 -07:00
empty.ts refactor: move angular source to /packages rather than modules/@angular 2017-03-08 16:29:27 -08:00
goog.d.ts fix(ivy): use goog.LOCALE for Closure Compiler to define default LOCALE_ID (#31519) 2019-07-16 13:02:10 -04:00
license-banner.txt build: bump year (#34651) 2020-01-13 07:21:43 -08:00
system.d.ts build: no longer run tslint from within gulp task (#35800) 2020-03-03 09:20:49 -08:00
tsconfig-build-no-strict.json refactor(core): ensure compatibility with typescript strict flag (#30993) 2019-07-18 14:21:25 -07:00
tsconfig-build.json refactor(core): ensure compatibility with typescript strict flag (#30993) 2019-07-18 14:21:25 -07:00
tsconfig-test.json refactor: fix typescript strict flag failures in all tests (#30993) 2019-07-18 14:21:26 -07:00
tsconfig.json build: enable IDE type checking of $localize code (#35711) 2020-02-28 07:09:50 -08:00
types.d.ts build: reference zone.js from source directly instead of npm. (#33046) 2019-11-06 00:48:34 +00:00

README.md

Angular

The sources for this package are in the main Angular repo. Please file issues and pull requests against that repo.

Usage information and reference details can be found in Angular documentation.

License: MIT