Commit graph

1199 commits

Author SHA1 Message Date
Vincent
e5d6fb5825 fix(http): Reset headers, progress, and statusCode when using set() in HttpResource (#62873)
Currently, those values aren't reset, which means they are out of sync with the new value

PR Close #62873
2025-08-01 08:08:52 +00:00
Joey Perrott
cbc258eec8 build: remove ts_project_interop infrastructure (#62908)
Remove the interop macros and final usages

PR Close #62908
2025-07-31 09:12:58 +00:00
SkyZeroZx
245494ad29 fix(http): add missing http options allowed in fetch API (#62881)
The addBody function was not preserving all fetch API options like integrity and referrer when creating request options for POST/PUT/PATCH requests. This caused these options to be stripped out during request construction.

PR Close #62881
2025-07-30 14:07:41 +00:00
Joey Perrott
793ff35602 build: move http_server and generate_api_docs into defaults2.bzl (#62878)
Move http_server and generate_api_docs into defaults2.bzl as they are rules_js compliant

PR Close #62878
2025-07-29 16:53:54 +00:00
Matthieu Riegler
5f759999a8 refactor(common): replace aio links to adev (#62839)
The is a doc change + a minor test change (to remove test logs that mention aio)

PR Close #62839
2025-07-29 09:55:26 +00:00
Joey Perrott
32c00ab416 build: standardize usage of js_binary (#62860)
Remove usages of nodejs_binary and use a commonly defined js_binary macro

PR Close #62860
2025-07-29 06:43:44 +02:00
Joey Perrott
caee6ff8e7 build: remove all usages of @bazel/runfiles (#62804)
Remove usages of @bazel/runfiles throughout the repository

PR Close #62804
2025-07-25 10:04:55 +02:00
SkyZeroZx
0984b30388 feat(http): Add redirected property to HttpResponse and HttpErrorResponse (#62675)
Add support for the Fetch API's redirected property in HttpResponse and HttpErrorResponse when using HttpClient with the withFetch provider.

The redirected property indicates whether the response was the result of an HTTP redirect, providing valuable information for security, debugging, and conditional logic.

PR Close #62675
2025-07-24 13:19:22 +00:00
Sebastian Barfurth
1b73c23597 fix(http): propagate plain errors when parsing fails (#62765)
The fetch backend now propagates the plain body when parsing the body fails.
This replicates the behavior of the XHR backend introduced in #19773.

The current state completely obfuscates errors of the "wrong" response type.
However, it's not uncommon for successful requests to return one type and
errors to return another type. Propagating the plain error allows downstream
error consumers to reason about the error body and decide how to parse it
depending on application needs.

PR Close #62765
2025-07-24 09:23:24 +00:00
Joey Perrott
8bf97d1370 build: remove all usages of the interop_deps attr for ts_project and ng_project (#62732)
Remove all of the usages of interop_deps as attributes in the repo

PR Close #62732
2025-07-21 13:03:09 -04:00
Joey Perrott
23d58777b4 build: migrate to new toolchain usage for api goldens (#62688)
Migrate api golden usage to be based on rules_js toolchain implementation

PR Close #62688
2025-07-17 18:13:42 -04:00
Vincent
1408baff45 fix(http): Add missing timeout and transferCache options to HttpClient (#62586)
The `timeout` option is implemented in the different HTTP backends, but the option is not actually passed to the backends. `transferCache` is also missing in one signature. This commit adds both options to `HttpClient`.

Fixes #62581

PR Close #62586
2025-07-14 15:45:25 -07:00
Kristiyan Kostadinov
745ea44394 feat(core): support TypeScript 5.9 (#62541)
Updates the repo to support TypeScript 5.9 and expands the allowed version range.

PR Close #62541
2025-07-14 14:04:58 -07:00
SkyZeroZx
be811fee79 feat(http): add referrer & integrity support for fetch requests in httpResource (#62461)
This commit adds support for the Fetch API's referrer & integrity options when using httpResource with the withFetch provider

PR Close #62461
2025-07-14 11:40:54 -07:00
SkyZeroZx
3c1f5857ac refactor(http): use RuntimeError for invalid timeout error (#62490)
Replace generic Error with RuntimeError

PR Close #62490
2025-07-11 10:38:56 -07:00
Alan Agius
75a5d08c5e fix(http): do not display warnings Angular detected that a HttpClient request with the keepalive option was sent using XHR when option is not true (#62536)
Currently, this warning is always displayed as the option defaults to false. We update the logic to only display the warning when it's true.

PR Close #62536
2025-07-09 12:45:27 -07:00
SkyZeroZx
1cf9d9064c feat(http): Add support for fetch referrer & integrity options in HttpClient (#62417)
Enhances Angular HttpClient requests with Fetch API referrer and integrity options to optimize security

PR Close #62417
2025-07-03 08:07:36 +00:00
Joey Perrott
4fae4dbba8 build: migrate adev to use packaged version of @angular/* packages (#62413)
Use the packaged versions of the packages instead of the local ts_project dependencies to prevent multiple versions of the deps to enter test bundles

PR Close #62413
2025-07-02 16:10:25 +00:00
SkyZeroZx
b6ef42843c feat(http): add credentials support for fetch requests in httpResource (#62390)
This commit adds support for the Fetch API's credentials option when using httpResource with the withFetch provider

PR Close #62390
2025-07-01 13:37:56 +00:00
SkyZeroZx
cfbbb08437 feat(http): add warning when withCredentials overrides explicit credentials (#62383)
This will prevent confusion and accidentally overriding of credentials.

PR Close #62383
2025-07-01 09:21:35 +00:00
SkyZeroZx
f0965c7acd feat(http): Add support for fetch credentials options in HttpClient (#62354)
Extend Angular's HttpClient to accept the 'credentials' option from the Fetch API.

PR Close #62354
2025-06-30 10:04:55 +00:00
SkyZeroZx
27b7ec0a62 feat(http): add mode & redirect for fetch request in httpResource (#62337)
This commit adds support for the Fetch API's mode & redirect options when using httpResource with the withFetch provider

PR Close #62337
2025-06-27 15:01:52 +00:00
SkyZeroZx
87322449a3 feat(http): add support for fetch mode and redirect options in HttpClient (#62315)
Add support for mode and redirect options in Angular's HttpClient based on fech provider to enable control CORS behavior and redirect handling

PR Close #62315
2025-06-27 13:16:25 +00:00
Matthieu Riegler
aa861c42ff feat(http): add timeout option on httpResource. (#62326)
This uses the option that was introduction on the HttpClient

PR Close #62326
2025-06-27 11:21:59 +00:00
Vincent
c4cffe2063 feat(http): Add timeout option to HTTP requests (#57194)
Add timeout option to both XHR and fetch backends.

PR Close #57194
2025-06-27 09:56:25 +00:00
SkyZeroZx
55fa38a1e5 feat(http): add cache & priority support for fetch requests in httpResource (#62301)
This commit adds support for the Fetch API's cache & priority options when using httpResource with the withFetch provider

PR Close #62301
2025-06-27 09:51:31 +00:00
Joey Perrott
b84859073b build: migrate to use web test runner rules (#62292)
Migrate karma tests throughout the repo to use the new web test runner based rule instead

PR Close #62292
2025-06-26 17:19:10 +00:00
arturovt
13875d0140 refactor(common): remove redundant ɵloadImpl check in client bundles (#62191)
In this commit, the conditional branching around `ɵloadImpl` is removed from client-side code, as `ɵloadImpl` is never defined in client bundles. This makes the logic simpler and improves tree-shaking, allowing the `from()` import to be dropped from the common bundle in browser builds.

PR Close #62191
2025-06-26 12:02:51 +00:00
Tristan Bastian
58aedc37d1 feat(common): add support for a custom EnvironmentInjector to NgComponentOutlet directive (#54764)
Signed-off-by: Tristan Bastian <tristan.bastian@cumulocity.com>

PR Close #54764
2025-06-25 17:02:19 +00:00
Mansi Shrivastava
7426dbbd56 refactor(common): allow HttpErrorResponse with successful status codes (#61107)
This adds the ability to mock out errors even when successful status codes are returned.

Fixes #26161

PR Close #61107
2025-06-25 17:01:18 +00:00
Matthieu Riegler
4f0126e76a docs: fix deprecation message on ngIf/ngSwitch (#62149)
fixes #62147

PR Close #62149
2025-06-25 11:22:15 +00:00
arturovt
f1b8ac6150 refactor(common): move ngServerMode check outside tap() to enable tree-shaking (#62238)
In this commit, the `ngServerMode` check is moved outside the RxJS `pipe()` to ensure that server-only logic is excluded from client bundles. Previously, the `tap()` operator and its closure were always included in the output, even though `ngServerMode` was false on the client and the side effect was never triggered.

By guarding the observable chain earlier, this reduces the RxJS stack frame depth, which simplifies debugging by avoiding unnecessary operator noise in client-side stack traces.

The resulting logic is also easier to reason about and avoids evaluating `HttpResponse` instances where not needed.

PR Close #62238
2025-06-25 11:13:21 +00:00
SkyZeroZx
9791ab1b6f feat(http): Add support for fetch request cache and priority options (#61766)
Enhances Angular HttpClient requests with Fetch API cache and priority options to optimize loading and performance.

PR Close #61766
2025-06-25 09:46:21 +00:00
SkyZeroZx
73269cf5ce feat(http): add keepalive support for fetch requests in httpResource (#61833)
This commit adds support for the Fetch API's keepalive option when using httpResource with the withFetch provider

PR Close #61833
2025-06-25 09:14:26 +00:00
arturovt
7600bec71d fix(router): handle scrollRestoration error in restricted environments (#62186)
In this commit, setting `window.history.scrollRestoration` is wrapped in a try-catch block to prevent `SecurityError` exceptions in restricted contexts such as:

- sandboxed iframes
- partially navigated or inactive windows
- test runners, extensions, or content previews

If an error occurs, a runtime warning with error code [2400] is logged to the console. This avoids breaking app initialization and improves cross-browser safety.

Unfortunately, it's not possible to perform any end-to-end testing of this fix.

PR Close #62186
2025-06-24 12:24:43 +00:00
Joey Perrott
3a0cfd544d build: migrate to using new jasmine_test (#62086)
Use the new jasmine_test based on rules_js instead of jasmine_node_test from rules_nodejs

PR Close #62086
2025-06-18 08:27:26 +02:00
Joey Perrott
dfbdbbe882 refactor: use zone.js from npm instead of packages/zone.js throughout repo (#61977)
Use zone.js from npm isntead of from the repo going forward

PR Close #61977
2025-06-10 12:02:03 -07:00
arturovt
ef10aa4005 feat(common): support decoding in NgOptimizedImage (#61905)
This commit adds the ability to set the decoding attribute in NgOptimizedImage. It proxies the binding onto the host image element. If no binding is provided, it defaults to "auto", which matches the browser's default behavior. This approach avoids any breaking changes resulting from the update.

PR Close #61905
2025-06-09 09:02:17 -07:00
Joey Perrott
9354efc86a build: remove unnecessary zone.js dep from various build targets (#61901)
Remove unnecessary zone.js dep from various build targets

PR Close #61901
2025-06-05 09:12:27 -07:00
arturovt
e947dfb84f refactor(common): use ngServerMode in HttpInterceptorHandler (#61605)
Drops `isPlatformServer(platformId)` in favor of `ngServerMode` in the `HttpInterceptorHandler`.

PR Close #61605
2025-06-04 14:13:15 -04:00
Paul Gschwendtner
d081ef9b06 build: replace all ng_package with new rule from rules_angular (#61843)
Replaces all `ng_package` rule with the new rule from `rules_angular`.

PR Close #61843
2025-06-04 09:13:41 +00:00
Matthieu Riegler
e5d9ea2fe3 docs: update resource docs (#61846)
`value` throws when the resource is in error state.

PR Close #61846
2025-06-03 20:20:47 -04:00
Paul Gschwendtner
b80957d1c5 build: adjust bundling tests to use Angular CLI (#61566)
Instead of dev-infra maintaining a custom ESBuild + Terser pipeline that
tries to emulate the Angular CLI, we are switching the bundling core
tests to a new rule that really leverages the Angular CLI.

This involves some file renames and small adjustments. In addition, we
leverage the updated symbol tracking rule to output new goldens that can
work with multiple bundle files (as generated by the Angular CLI;
especially with defer and its "lazy" chunks).

PR Close #61566
2025-05-29 14:39:11 -04:00
Joey Perrott
26f126a049 build: update common's locales to use rules_js (#61629)
Use ts_project to build the common locales

PR Close #61629
2025-05-26 10:18:14 +00:00
Rafal Slawik
82327f2092 feat(common): accept undefined inputs in NgTemplateOutlet (#61404)
Extend types of inputs to include `undefined` to avoid `?? null` when using singals (e.g. `viewChild`).

Fixes #51225

PR Close #61404
2025-05-25 14:26:42 -07:00
Andrew Scott
abcb865474 fix(common): avoid injecting ApplicationRef in FetchBackend (#61649)
fixes a circular dependency caused by injecting applicationRef

fixes #61644

PR Close #61649
2025-05-23 10:04:08 -07:00
Maciej Sawicki
05eb028c7a fix(core): narrow error type for resources API (#61441)
`Resource.error` used to return `unknown`. Now it's `Error | undefined`.
For non-`Error` types they are encapsulated with the `Error` type.

PR Close #61441
2025-05-21 12:06:40 -07:00
Maciej Sawicki
07811ddd7d fix(core): move reload method from Resource to WritableResource (#61441)
Now only mutable resources can be reloaded.

PR Close #61441
2025-05-21 12:06:40 -07:00
arturovt
93e8565f0e fix(core): cleanup rxResource abort listener (#58306)
The observable terminates immediately when `error` is called, and no further emissions or completion notifications occur. Thus, we have to remove the `abort` listener in both the `error` and `complete` notifications.

PR Close #58306
2025-05-21 15:17:22 +00:00
arturovt
17fe731e8e fix(common): cancel reader when app is destroyed (#61528)
Streams left in a pending state (due to `break` without cancel) may continue consuming or holding onto data behind the scenes. Calling `reader.cancel()` allows the browser or the underlying system to release any network or memory resources associated with the stream.

PR Close #61528
2025-05-21 15:07:17 +00:00