angular/packages
Kristiyan Kostadinov ce80136e7b fix(compiler): optimize away unnecessary restore/reset view calls
When producing a listener, the template pipeline does the following in separate phases:
1. Generates all the variables available within its scope.
2. Adds `restoreView` and `resetView` calls if there are any referenced to local variables (e.g. `@let` or local refs).
3. Optimizes away the variables that aren't used.

This means that we can end up in a situation where the references to the variables in the scope no longer exist, but we still enter and leave the view as if they're there which is unnecessary.

These changes add a simple optimization pass that looks specifically for the pattern of a `restoreView` followed by a `return resetView(expr)`. Furthermore, by changing the order of some optimizations, we're able to drop the `getCurrentView` variable as well.

Fixes #66286.
2026-01-20 10:22:55 -08:00
..
animations refactor(core): mark VERSION exports as pure for better tree-shaking 2026-01-02 08:13:40 +01:00
benchpress ci: reformat files 2025-12-16 14:44:19 -08:00
common refactor(http): remove redundant providedIn: 'root' in XSRF_HEADER_NAME 2026-01-12 10:00:24 -08:00
compiler fix(compiler): optimize away unnecessary restore/reset view calls 2026-01-20 10:22:55 -08:00
compiler-cli fix(compiler): optimize away unnecessary restore/reset view calls 2026-01-20 10:22:55 -08:00
core feat(core): add host node to DeferBlockData (#66546) 2026-01-20 18:16:32 +00:00
docs/di build: format md files 2025-11-06 10:03:05 -08:00
elements refactor(core): mark VERSION as @__PURE__ for better tree-shaking 2025-11-10 12:04:04 -08:00
examples ci: reformat files 2025-12-16 14:44:19 -08:00
forms refactor(forms): remove unused API 2026-01-20 10:19:58 -08:00
language-service build: initial test of TypeScript 6 2026-01-15 13:41:01 -08:00
localize build: initial test of TypeScript 6 2026-01-15 13:41:01 -08:00
misc/angular-in-memory-web-api ci: reformat files 2025-12-16 14:44:19 -08:00
platform-browser refactor(core): update error message links to versioned docs (#66374) 2026-01-09 22:33:51 +00:00
platform-browser-dynamic refactor(core): mark VERSION as @__PURE__ for better tree-shaking 2025-11-10 12:04:04 -08:00
platform-server fix(core): fix memory leak with event replay 2026-01-07 14:27:44 -08:00
private/testing build: rename defaults2.bzl to defaults.bzl (#63383) 2025-08-25 15:45:01 -07:00
router docs: update examples to use isActive instead of deprecated Router.isActive (#66430) 2026-01-12 22:42:32 +00:00
service-worker refactor(core): correct all typeof ngDevMode comparison patterns introduced by #63875 2025-12-08 10:30:01 -08:00
ssr/docs build: rename defaults2.bzl to defaults.bzl (#63383) 2025-08-25 15:45:01 -07:00
upgrade refactor(upgrade): deprecate VERSION export 2025-12-09 09:26:02 -08:00
zone.js build: update dependency @csstools/css-color-parser to v4 2026-01-16 10:30:20 -08:00
BUILD.bazel build(forms): expose signal forms compat package 2025-11-14 09:23:36 -08:00
circular-deps-test.conf.cjs build: use Node.js built-in TypeScript support for dev-infra scripts 2026-01-02 08:15:40 +01:00
empty.ts refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
goog.d.ts refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
license-banner.txt docs: update copyright year 2026-01-07 12:28:34 -05:00
package.json build: prepare for compiler-cli to be using ts_project (#61181) 2025-05-09 15:59:46 +00:00
README.md build: format md files 2025-11-06 10:03:05 -08:00
system.d.ts refactor: update packages/core:{core,src} to ts_project (#61275) 2025-05-14 12:01:51 +00:00
tsconfig-build.json Revert "refactor(compiler-cli): remove deep imports from compiler-cli (#64732)" 2025-11-06 13:09:01 -08:00
tsconfig-legacy-saucelabs.json
tsconfig-test.json
tsconfig.json feat(compiler-cli): enable type checking of host bindings by default (#63654) 2025-09-09 14:34:29 -07:00
tsec-exemption.json
types.d.ts build: move private testing helpers outside platform-browser/testing (#61472) 2025-05-20 10:00:43 +00:00

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