Prior to this commit, the `cleanUpControl` function (responsible for cleaning up control instance) was not taking validators into account. As a result, these validators remain registered on a detached form control instance, thus causing memory leaks. This commit updates the `cleanUpControl` function logic to also run validators cleanup. As a part of this change, the logic to setup and cleanup validators was refactored and moved to separate functions (with completely opposite behavior), so that they can be reused in the future. This commit doesn't add the `cleanUpControl` calls to all possible places, it just fixes the cases where this function is being called, but doesn't fully perform a cleanup. The `cleanUpControl` function calls will be added to other parts of code (to avoid more memory leaks) in a followup PR. PR Close #39234
Bundle
js_expected_symbol_test
This folder contains tests which assert that most of the code is tree shaken away. This is asserted by keeping gold files of all symbols which are expected to be retained. When doing renaming it is often necessary to update the gold files, to do so use these commands:
yarn bazel run --config=ivy //packages/core/test/bundling/injection:symbol_test.accept
yarn bazel run --config=ivy //packages/core/test/bundling/cyclic_import:symbol_test.accept
yarn bazel run --config=ivy //packages/core/test/bundling/forms:symbol_test.accept
yarn bazel run --config=ivy //packages/core/test/bundling/hello_world:symbol_test.accept
yarn bazel run --config=ivy //packages/core/test/bundling/router:symbol_test.accept
yarn bazel run --config=ivy //packages/core/test/bundling/todo:symbol_test.accept
Running all symbol tests
To run all symbol tests with one command, you can use the following scripts:
yarn run symbol-extractor:check
yarn run symbol-extractor:update