Commit graph

13495 commits

Author SHA1 Message Date
Andrew Scott
971981e1df fix(core): TestBed.tick should ensure test components are synchronized (#61382)
This ensures that `TestBed.tick` updates any components created with
`TestBed.createComponent`, regardless of whether autoDetectChanges is
on.

PR Close #61382
2025-05-21 15:02:52 +00:00
arturovt
216222f8b4 refactor(common): drop httpResource error message (#61570)
Drops `httpResource` error message in production and replaces with an error code.

PR Close #61570
2025-05-21 14:16:53 +00:00
Matthieu Riegler
dba912dd07 refactor(platform-browser): replace platform-browser-dynamic with platform-browser (#61498)
The former isn't needed anymore and is now deprecated.

PR Close #61498
2025-05-21 14:01:49 +00:00
Pawel Kozlowski
1123b314b1 refactor(core): consolidate TNode creation checks (#61563)
This change de-duplicates code executed during TNode creation
and reponsible for asserting a TNode index.

PR Close #61563
2025-05-21 13:49:32 +00:00
Pawel Kozlowski
a5a18ae191 refactor(core): minimize code in the element-like instructions (#61563)
Minor changes to the element and elementContainer instructions to
move as much code as possible out of those instructions.

PR Close #61563
2025-05-21 13:49:31 +00:00
Jonathan Meier
0cf1001715 feat(compiler-cli): support host directives with direct external references in fast type declaration emission (#61469)
In the initial implementation for experimental fast type declaration
emission introduced in e62fb35, external references in host directives
were not supported at all.

This change adds support for direct external references in host
directives. Any other expressions indirectly using external references
are still not supported.

PR Close #61469
2025-05-21 13:46:43 +00:00
arturovt
e7656b84b2 refactor(core): drop rxResource error messages (#61565)
Drops `rxResource` error messages in production and replaces with error codes.

PR Close #61565
2025-05-21 12:42:59 +00:00
arturovt
62185714b5 refactor(core): drop injection context assertion in production (#61564)
In other parts of the code, calls to the `assertInInjectionContext` function are guarded with `ngDevMode`. This change aligns these parts of the code with other implementations that drop such assertions in production.

PR Close #61564
2025-05-21 12:42:10 +00:00
Kristiyan Kostadinov
46af02395f fix(compiler): avoid conflicts between HMR code and local symbols (#61550)
Currently we construct the HMR replacement URL inline by calling into the native `URL` constructor. This can cause conflicts with user code that defines a symbol called `URL`.

These changes resolve the issue by moving the URL construction into a separate function. This has a secondary benefit of making the generated code easier to follow and allowing us to update the URL without changing the compiled code.

Fixes #61517.

PR Close #61550
2025-05-21 12:25:25 +00:00
arturovt
6bf6dbc37e fix(core): cleanup testability subscriptions (#61261)
This commit prevents leaking memory when the application is destroyed and subscriptions are still alive.

PR Close #61261
2025-05-21 12:06:23 +00:00
arturovt
9416483bd3 refactor(core): drop injection context assertion in production (#61560)
In other parts of the code, calls to the `assertInInjectionContext` function are guarded with `ngDevMode`. This change aligns these parts of the code with other implementations that drop such assertions in production.

PR Close #61560
2025-05-21 11:35:47 +00:00
Matthieu Riegler
ef01d3c69e refactor(core): Merge R3TemplateRef implementation and TemplateRef interface (#61455)
This was an artifact of the Ivy migration.

PR Close #61455
2025-05-21 10:07:12 +00:00
Angular Robot
e57509e0a2 build: update dependency google-closure-compiler to v20250519 (#61551)
See associated pull request for more information.

PR Close #61551
2025-05-21 10:02:05 +00:00
Paul Gschwendtner
08f7d21d5c refactor(migrations): ensure tsurge configures file system properly (#61553)
Currently in 1P, without this commit, the tsconfig parsing picks up the
default file system (InvalidFS) and results in runtime errors.

PR Close #61553
2025-05-21 10:01:18 +00:00
Joey Perrott
3acc2a5f07 build: migrate router to use rules_js (#61542)
Use ts_project and ng_project for building router

PR Close #61542
2025-05-21 09:53:34 +00:00
Andrew Scott
1aa57857dd refactor(core): Remove _cdRefInjectingView from markForRefresh (#60918)
The code was not compatible with property renaming so it was always
using _lView. This didn't matter because they're always the same for the
only place the function is used. Casting to any would fix the
renaming problem but introduce a risk of getting "broken" by a refactor
that changes the private variable name. This change removes the
private member access entirely.

PR Close #60918
2025-05-21 09:46:49 +00:00
Joey Perrott
7f6bb91c5d build: update compiler-cli to not be stamped when used for the compiler in ng_project (#61535)
The compiler-cli package needs to be unstamped and will the resulting generated code will be stamped as expected.

PR Close #61535
2025-05-21 09:16:06 +00:00
Joey Perrott
e11f48f65e build: migrate forms to rules_js (#61535)
Migrate forms to use ng_project and ts_project

PR Close #61535
2025-05-21 09:16:05 +00:00
Matthieu Riegler
5a4ca62081 docs: fix info about descendants for content queries. (#61534)
- `descendants` option  is `true` for `contentChild`
- `descendants` option is `false` for `contentChildren`

PR Close #61534
2025-05-21 09:06:06 +00:00
Andrew Scott
c71adb1ad1 fix(compiler-cli): Always retain prior results for all files (#61487)
This change ensures that prior results for all files are retained even when
a request is made such that we only need a shim for a single file. Prior
to this change, any prior results that were not part of the request were discarded.

PR Close #61487
2025-05-21 08:56:53 +00:00
Joey Perrott
69de729cde build: migrate angular-in-memory-web-api to use rules_js (#61524)
Use ts_project and ng_project for building angular-in-memory-web-api

PR Close #61524
2025-05-20 16:53:20 +00:00
arturovt
87688942d4 fix(common): prevent reading chunks if app is destroyed (#61354)
Prevents processing response chunks after the application has been destroyed.

PR Close #61354
2025-05-20 15:09:44 +00:00
Joey Perrott
3440338d45 build: migrate common to use rules_js based toolchain (#61433)
Migrate packages/common to use ts_project and ng_project.

PR Close #61433
2025-05-20 15:07:56 +00:00
Matthieu Riegler
1148b7e0c5 fix(core): unregister onDestroy in toSignal. (#61514)
We cleanup if the observable completes before the onDestroy fires.

fixes #61511

PR Close #61514
2025-05-20 14:43:31 +00:00
Alan Agius
8f65223bd8 fix(core): update min Node.js support to 20.19, 22.12, and 24.0 (#61499)
This is to match the versions of the Angular CLI.

See: https://github.com/angular/angular-cli/pull/30349

PR Close #61499
2025-05-20 14:15:13 +00:00
Jonathan Meier
2796f18a3d test: set the noCheck TS compiler option in declaration-only emission compliance tests (#61470)
No type-checking is performed in declaration-only emission mode so we
should explicitly disable it in the compliance tests.

This also aligns the compiler configuration with the setup used in
`packages/compiler-cli/test/ngtsc/declaration_only_emission_spec.ts`:
2b3c89dba2/packages/compiler-cli/test/ngtsc/declaration_only_emission_spec.ts (L31).

PR Close #61470
2025-05-20 12:07:18 +00:00
Angular Robot
c7420df449 build: update dependency google-closure-compiler to v20250518 (#61490)
See associated pull request for more information.

PR Close #61490
2025-05-20 10:06:42 +00:00
Paul Gschwendtner
7e571069bc refactor(compiler): avoid duplication between FactoryTarget type (#61472)
Avoids duplication of the `FactoryTarget` enums. This is necessary
now because we are exposing the previously deeply-imported JIT facade
now via the exports; and the typing integration tests surface a type
conflict due to the different duplicated enums.

PR Close #61472
2025-05-20 10:00:43 +00:00
Paul Gschwendtner
082cc5579d build: migrate all ng_module in packages/core/test (#61472)
Migrates all `ng_module` to `ng_project` in `packages/core/test/`.

PR Close #61472
2025-05-20 10:00:43 +00:00
Paul Gschwendtner
8ead19fe00 build: migrate all ts_library in packages/core/test (#61472)
This commit migrates all `ts_library` in `package/core/test` to
`ts_project`, and fixes deep module, or relative imports inside.

PR Close #61472
2025-05-20 10:00:43 +00:00
Paul Gschwendtner
3a106a35bc build: move private testing helpers outside platform-browser/testing (#61472)
These helpers are often imported by various tests throughout the
repository, but the helpers aren't exported/exposed from the public
entry-point; even though they confusingly reside in there.

This commit fixes this, and moves the helpers into
`packages/private/testing`. This is a preparation for the `ts_project`
migration where we don't want to leverage deep imports between packages.

PR Close #61472
2025-05-20 10:00:43 +00:00
Andrew Scott
f182886ce5 refactor(core): Disallow autoDetectChanges(false) in zoneless (#61430)
This removes the ability to use `autoDetectChanges(false)` when
`provideZonelessChangeDetection` is used.

PR Close #61430
2025-05-20 08:49:06 +00:00
Joey Perrott
abdfbefe74 build: use an unstamped version of compiler-cli for running the angular compiler in ng_project (#61479)
Use an unstamped version of the compiler when it runs in `ng_project` as it will get stamped appropriately
whenever the generated code gets stamped after its usage."

PR Close #61479
2025-05-20 08:46:34 +00:00
Joey Perrott
447b2a3690 build: migrate animations to use rules_js based toolchain (#61479)
Migrate animations to use `ts_project` and `ng_project`

PR Close #61479
2025-05-20 08:46:33 +00:00
Joey Perrott
1818a84209 build: migrate benchpress to use rules_js (#61486)
Use ts_project to build targets in benchpress package

PR Close #61486
2025-05-20 08:44:53 +00:00
Pawel Kozlowski
feb571ceaa refactor(core): expose enableProfiling() on from @angular/core (#61465)
This commit exposes the experimental enableProfiling() API that
enables Angular integration with the Chrome DevTools performance
panel. Previously this integration was exposed on the ng. namespace
only but there are legitimate cases where developers might want to
expose the integration earlier (ex.: bootstrap profiling).

PR Close #61465
2025-05-19 14:22:34 +00:00
Pawel Kozlowski
2b3c89dba2 refactor(core): re-introduce TestBed.flushEffects()" (#61462)
Our intention was to remove TestBed.flushEffects() in Angular v20
as it was a developer preview API that doesn't need to follow our
deprecation policy. It turned out, though, that the angular.dev
documentation wasn't displaying the @developerPreview annotation
properly so some of the developers might have been unaware of the
non-stable nature of this API.

This commits re-introduces the TestBed.flushEffects() API. This
API call will delegate to TestBed.tick().

PR Close #61462
2025-05-19 13:26:52 +00:00
Paul Gschwendtner
b148e272f6 refactor(migrations): gracefully proceed if reference cannot be resolved (#61426)
A runtime error can surface when TypeScript internally fails to resolve
a reference that is named similar to an input, but no `.d.ts` is
available for it.

See example error:
https://github.com/microsoft/TypeScript/issues/61473#issuecomment-2746537781.

PR Close #61426
2025-05-19 11:04:52 +00:00
Angular Robot
10c2ab2a4a build: lock file maintenance (#61456)
See associated pull request for more information.

PR Close #61456
2025-05-19 11:03:53 +00:00
Angular Robot
24ae05f3f8 build: update all non-major dependencies (#61458)
See associated pull request for more information.

PR Close #61458
2025-05-19 09:53:46 +00:00
Kristiyan Kostadinov
7a308ccc3b refactor(core): consolidate logic to determine whether node can be hydrated (#61409)
Several instructions were repeating the logic that checks if a specific can be hydrated. These changes move it into a common location.

PR Close #61409
2025-05-19 09:30:20 +00:00
Kristiyan Kostadinov
6783fb7eae refactor(core): consolidate element end instruction logic (#61409)
There was some identical logic between the `elementEnd` and `elementContainerEnd` instructions. These changes consolidate it.

PR Close #61409
2025-05-19 09:30:20 +00:00
Kristiyan Kostadinov
049fe82de6 refactor(core): consolidate element start logic (#61409)
The logic for the `elementStart` and `elementContainerStart` instructions was identical. These changes consolidate it into a single base instruction.

PR Close #61409
2025-05-19 09:30:20 +00:00
Kristiyan Kostadinov
d216ffedbd refactor(core): consolidate first create pass (#61409)
The first create pass for elements and containers was identical. These changes consolidate it to reduce code duplication.

PR Close #61409
2025-05-19 09:30:20 +00:00
Kristiyan Kostadinov
b785256b9e perf(core): avoid intermediate arrays in definition (#61445)
A minor performance improvement for `ɵɵdefineComponent` where the underlying `extractDefListOrFactory` call had a chain of `.map.filter` which meant that we were unnecessarily creating intermediate arrays just to filter out the null values. These changes switch to simple `for` loop to get around it.

PR Close #61445
2025-05-19 09:20:07 +00:00
Alan Agius
cf8c853523 build: remove @types/diff (#61447)
The latest diff package includes the TS types.

PR Close #61447
2025-05-19 09:17:47 +00:00
Andrew Scott
bdbf616a4e refactor(core): Deprecate fixture.autoDetectChanges(true/false) (#61429)
After nearly a decade of existence, there are 0 uses of
`autoDetectChanges(false)` internally. All uses of
`autoDetectChanges(true)` can be migrated directly to
`autoDetectChanges()` instead.

PR Close #61429
2025-05-19 08:31:37 +00:00
Jonathan Meier
77fa204ad1 fix(compiler-cli): rename flag for enabling fast type declaration emission (#61353)
Rename the flag `_geminiAllowEmitDeclarationOnly` to
`_experimentalAllowEmitDeclarationOnly` as a follow-up on a comment in
PR #61334.

PR Close #61353
2025-05-19 08:27:43 +00:00
arturovt
7aae854f5e refactor(animations): mark non-default new expressions as pure (#61452)
Adds `__PURE__` annotations to non-default `new` expressions to enable tree-shaking, even if they are not referenced. These variables are not dropped when Angular is imported from a module that has `sideEffects` set to `true`.

PR Close #61452
2025-05-19 08:26:56 +00:00
Pawel Kozlowski
69984ef55d refactor(core): move the data store operation out of instructions (#61425)
The view data store operation is not an instruction and shouldn't be
located in the instructions folder.

PR Close #61425
2025-05-19 08:24:45 +00:00