Commit Graph

30108 Commits

Author SHA1 Message Date
Joey Perrott 98de185e53 WIP 2024-05-07 19:21:23 +00:00
Tom Wilkinson 0fb455f72e refactor(core): Move global dispatch behavior into Dispatcher. (#55692)
This behavior is now implemented by calling `dispatch` whether or not
the `action` is populated. The `Dispatcher` then does global dispatch
and early returns if there's no action.

PR Close #55692
2024-05-07 12:00:40 -07:00
Thomas Nguyen 67bb310376 refactor(core): Fix timing of removal of jsaction attribute to be after event replay. (#55696)
This otherwise leads to bugs where, by the time replay needs the attribute, hydration
happens and it's gone.

PR Close #55696
2024-05-07 08:16:16 -07:00
arturovt a9460d08a0 fix(zone.js): remove abort listener on a signal when actual event is removed (#55339)
This commit updates the implementation of the `addEventListener` patcher.

We're currently creating an abort event listener on the signal (when it's provided)
and never remove it. The abort event listener creates a closure which captures `task`
(tasks capture zones and other stuff too) and prevent `task`, zones and signals from
being garbage collected.

We now store the function which removes the abort event listener when the actual event
listener is being removed. The function is stored on task data since task data is already
being used to store different types of information that's necessary to be shared between
`addEventListener` and `removeEventListener`.

Closes #54739

PR Close #55339
2024-05-07 08:07:33 -07:00
Paul Gschwendtner afc057ee92 docs: properly link to developer preview section (#55711)
Fixes an invalid link to the developer preview section.
PR Close #55711
2024-05-07 08:06:42 -07:00
Angular Robot 0fffe5389f build: update all non-major dependencies (#55531)
See associated pull request for more information.

PR Close #55531
2024-05-07 08:05:57 -07:00
AleksanderBodurri 77ae5a391b refactor(devtools): remove git sha stamping from devtools build (#55694)
This stamping is interfering with publishing to the Firefox addons store by brining in the entirety of the `.git` directory as part of the source code necessary for a reproducible build, which Firefox requires as part of it's approval process.

In it's place, we are now using the extension version pulled from the manifest.

PR Close #55694
2024-05-06 16:02:36 -07:00
Andrew Scott 76f2c4fe1a refactor(core): private export token that indicates if zone scheduling is provided (#55690)
This is needed internally to determine whether to provide zone or
zoneless by default.

PR Close #55690
2024-05-06 16:01:48 -07:00
Andrew Scott 9366e170e9 refactor(router): resolve view transition promise in a timeout when unsupported (#55327)
Related to #51131, this change ensures that the router navigation exits
the current event loop before rendering the route when the view transition
feature is enabled, when the browser does not support view transitions.

PR Close #55327
2024-05-06 16:00:53 -07:00
Rahat Ahmed 879537466e refactor(core): Remove unused JSNAMESPACE_SUPPORT from event-dispatch (#55619)
The usage of this option has been removed from google3 code, so we don't
need to keep it around anymore.

PR Close #55619
2024-05-06 14:58:25 -07:00
Andrew Scott 7330b6944d fix(core): TestBed should not override NgZone from initTestEnvironment (#55226)
Prior to this change, `NgZone` was provided by default in TestBed in a
location that would override anything configured in
`TestBed.initTestEnvironment`. This change moves the default `NgZone`
provider to the `RootScopeModule` and these providers can be overridden
by the ones in `additionalModuleTypes`, which are assigned from the
first argument of `initTestEnvironment`. This makes it possible to
configure Zone globally for all tests as opposed to needing to repeat it
in `configureTestingModule` of each suite.

PR Close #55226
2024-05-06 13:33:16 -07:00
Alan Agius 3e1d6e9d6e fix(compiler): maintain multiline CSS selectors during CSS scoping (#55509)
Previously, multiline selectors were being converted into single lines, resulting in sourcemap disruptions due to shifts in line numbers.

Closes #55508

PR Close #55509
2024-05-06 12:39:50 -07:00
Andrew Kushnir 9d3cd9bc83 refactor(animations): make async animations code compatible with Closure compiler (#55686)
Closure compiler optimizations in g3 require `.then` to be present for a dynamic import (or an import should be `await`ed) to detect the set of imported symbols. Currently, the `.then` is located at a later stage in the file, which confuses static code analysis. This change adds the `.then((m) => m)` workaround to satisfy Closure compiler constraints.

PR Close #55686
2024-05-06 12:35:23 -07:00
Alan Agius b3e61ba63f ci: update Renovate configuration: replace matchPackagePatterns with matchDepPatterns (#55683)
This commit addresses a warning in Renovate regarding a deprecated behavior that will be phased out in the future.

```
WARNING: To prevent future issues, replace the usage of matchPackagePatterns with matchDepPatterns (repository=angular/angular, baseBranch=main)
       "packageRule": {
         "matchPackagePatterns": ["^@bazel/.*", "^build_bazel.*"],
         "groupName": "bazel setup",
         "schedule": ["at any time"]
       },
       "packageName": "bazelbuild/rules_nodejs",
       "depName": "build_bazel_rules_nodejs"
```

PR Close #55683
2024-05-06 12:34:09 -07:00
Alan Agius 15e0600521 ci: remove stopUpdatingLabel setting (#55683)
This commit removes the 'stopUpdatingLabel' option from Renovate settings. This option caused pull requests to not automatically rebase when  conflicting.

PR Close #55683
2024-05-06 12:34:09 -07:00
Alan Agius cf84acf44c fix(platform-server): remove event dispatch script from HTML when hydration is disabled (#55681)
Prior to this commit, the included event dispatcher remained in the HTML even when hydration was disabled.

PR Close #55681
2024-05-06 12:33:09 -07:00
Angular Robot 7898957b9d build: lock file maintenance (#55680)
See associated pull request for more information.

PR Close #55680
2024-05-06 12:32:18 -07:00
Alan Agius 73a17904aa build: remove mermaid from deps (#55664)
This dependency is now pulled via `@angular/docs`

PR Close #55664
2024-05-06 12:31:27 -07:00
Alan Agius 9ddb003b6c fix(http): resolve withRequestsMadeViaParent behavior with withFetch (#55652)
This commit addresses dependency injection defects when using the `withFetch` API. Formerly, utilizing `withFetch` led to the automatic setting of `HttpBackend` to `FetchBackend`, which proved problematic in certain scenarios. Notably, conflicts arose when integrating `withRequestsMadeViaParent` and manually overriding tokens, as observed in instances like `InMemoryWebApiModule`.

PR Close #55652
2024-05-06 12:29:53 -07:00
cexbrayat 7a2efd442d fix(migrations): handle more cases in HttpClientModule migration (#55640)
This commit handles two cases that were breaking applications when using the new migration:

- tests using `HttpClientModule` in `TestBed.configureTestingModule` were broken as the import was removed, but the module is still present in the test configuration. It now properly adds `provideHttpClient(withInterceptorsFromDi())` and related imports to the test.
- tests using `HttpClientTestingModule` were migrated to use `provideHttpClient(withInterceptorsFromDi())` but the necessary imports were not added. They are now added by the migration.

PR Close #55640
2024-05-06 12:29:17 -07:00
Andrew Scott 464dae94ee docs: small updates to zoneless docs (#55636)
PR Close #55636
2024-05-06 12:28:36 -07:00
iteriani 8f273ce7a8 refactor(core): Allow the container and the listenable element to be configurable for early event contract. (#55586)
This will allow a multi-app application to listen to early events from different elements and place them
on a separate field on the window.

PR Close #55586
2024-05-06 08:15:54 -07:00
Angular Robot 1872fcd8e0 build: update cross-repo angular dependencies (#55422)
See associated pull request for more information.

PR Close #55422
2024-05-03 13:00:18 -07:00
Alan Agius 6e1e70d3f1 ci: use application builder for integration tests (#55660)
This updates the integration tests to use the application builder.

PR Close #55660
2024-05-03 11:21:06 -07:00
Alan Agius 554a1be51b ci: delate aio-payloads.json (#55659)
This file is no longer used.

PR Close #55659
2024-05-03 11:20:13 -07:00
Alan Agius b80b46215c ci: add adev build as part of the CI process (#55662)
Currently, this is not which caused main to be broken because breakages where not caught during PR

PR Close #55662
2024-05-03 10:20:58 -07:00
Alan Agius b5ab2ef269 build: fix adev build (#55662)
adev is broken at head

PR Close #55662
2024-05-03 10:20:58 -07:00
Alan Agius 46acb55e76 build: update integration tests lock files (#55661)
This should fix CI.

PR Close #55661
2024-05-03 09:17:16 -07:00
Alan Agius aeb3fe26cf build: remove tslint and codelyzer deps from integration tests (#55658)
These are redundant.

PR Close #55658
2024-05-03 08:15:41 -07:00
cexbrayat 14d5094177 docs: typo in RedirectFunction description (#55653)
PR Close #55653
2024-05-03 08:08:12 -07:00
Matthieu Riegler e5331107fd fix(platform-browser): Use the right namespace for mathML. (#55622)
Prior to this change, MathML element were created with the wrong namespace resulting in regular DOM `Element`.

This commit fixes this.

Related to #55608 (but doesn't fix it entirely).

PR Close #55622
2024-05-03 08:07:31 -07:00
Angular Robot 3a930a59f6 build: update dependency typescript to v5.4.5 (#55042)
See associated pull request for more information.

PR Close #55042
2024-05-03 08:06:34 -07:00
Alan Agius 72108bad4d build: update cross-repo angular dependencies (#55654)
See associated pull request for more information.

PR Close #55654
2024-05-03 08:04:40 -07:00
arturovt 9e07b621ea fix(zone.js): add missing APIs to Node.js fs patch (#54396)
This commit updates the list of Node.js `fs` APIs to be patched because
they haven't been updated for a long time. It adds `opendir,lutimes,writev`.
For example, the `opendir` method was added to Node.js in version 12.12.0 in
2019, causing some of the APIs to potentially be always called within the
`<root>` context.

**Note:** There are missing unit tests for these changes because in unit tests,
`fs` is patched by Bazel's Node.js rules and its `node_patches.cjs`. However,
the APIs are successfully patched in the real production code and are called
with the correct context.

PR Close #54396
2024-05-03 08:03:25 -07:00
Doug Parker 58a8f124b0 refactor(devtools): set key in manifest.chrome.json (#55639)
This key comes from the release build of the Chrome extension. Setting it here configures the extension ID of a local build to match the extension ID of the public release. This makes Chrome recognize that local builds are the same extension leading to more intuitive behavior. It's also useful for allowlists of extension IDs to keep the local ID consistent.

PR Close #55639
2024-05-02 14:46:24 -07:00
Andrew Scott 76e7aa8add refactor(core): Update coalescing to just use patched timers in root zone (#55366)
Rather than attempting to use the native timing functions, this commit
simplifies the logic significantly by using the global timer functions
as they are, either patched or unpatched. When Zone is defined, we run
the timers in the root zone. This has more predictable behavior and
timing than (a) using both patched and unpatched versions of timers in
different places (b) trying to get an unpatched timer and failing due to
environment specifics and patches that aren't ZoneJS.

PR Close #55366
2024-05-02 14:43:10 -07:00
Andrew Kushnir 7645325d46 refactor(core): mark @defer APIs as stable (#55625)
This commit removes the `@developerPreview` annotation from the `@defer` APIs, effectively promoting them (and the entire feature!) to stable.

PR Close #55625
2024-05-02 14:42:00 -07:00
Doug Parker b44e35f472 release: bump Angular DevTools to 1.0.15 (#55643)
PR Close #55643
2024-05-02 13:37:34 -07:00
Rahat Ahmed afd87acde4 refactor(core): Turn off JSNAMESPACE_SUPPORT by default (#55598)
All usages in google3 have been deleted so this should be a no-op. Next I'll clean up all the configurations turning this off and then delete the option entirely.

PR Close #55598
2024-05-02 12:34:24 -07:00
twerske c320aa6705 docs: style the nav based on version type (#55628)
PR Close #55628
2024-05-02 12:33:27 -07:00
Kristiyan Kostadinov 2e891ad72a fix(compiler): add math elements to schema (#55631)
Fixes that we didn't have the MathML elements in the schema. Note that we can't discover which tag names are available by looking at globally-available classes, because all MathML elements are `MathMLElement` rather than something like `SVGCircleElement`. As such, I ended up having to hardcode the currently-available tags.

Fixes #55608.

PR Close #55631
2024-05-02 11:12:14 -07:00
cexbrayat 8b5921547c docs: typos in NG0956 (#55630)
PR Close #55630
2024-05-02 11:10:58 -07:00
Angular Robot 45b58059f0 build: update io_bazel_rules_sass digest to 9f8be59 (#55602)
See associated pull request for more information.

PR Close #55602
2024-05-02 11:06:46 -07:00
iteriani 95bf0c85f8 refactor(core): Remove jsaction from element after handling the event. (#55549)
This also adds a test to make sure that the event contract is still listening to other events, especially in the case where we may want partial hydration in the future.

PR Close #55549
2024-05-02 11:04:59 -07:00
Andrew Scott 8cabb7a85d Revert "fix(core): render hooks should not specifically run outside the Angular zone (#55399)" (#55624)
This reverts commit 7e89753eef.

Running render hooks inside the zone is specifically problematic for
`afterRender` hooks. If the callback has async task, it would cause an
infinite change detection. In addition, updating state in render hooks
is generally discourages and certainly should update state in a way that
notifies Angular of the change (either via signal or with `markForCheck`) rather
than relying on ZoneJS to pick it up (which would only work if the
change is done inside an async task).

PR Close #55624
2024-05-02 11:00:29 -07:00
Andrew Scott 7c1b4a49ae fix(core): afterRender hooks registered outside change detection can mark views dirty (#55623)
This commit fixes an error in the looping logic of `ApplicationRef.tick`
when the tick skips straight to render hooks. In this case, if a render
hook makes a state update that requires a view refresh, we would never
actually refresh the view and just loop until we hit the loop limit.

PR Close #55623
2024-05-02 10:58:28 -07:00
Payam Valadkhan 1f2e791c57 refactor(compiler-cli): optimize extra import generation in local compilation mode (#55548)
Currently we add global extra imports to all the files in the compilation unit. However not all the files need extra imports. For example non-Angular files definitely do not need such extra imports, and in some cases these extra imports causes problems as the file is meant to be run the Node but it has Angular dependencies which are not compatible with Node. This change tries to limit extra import generation to a subset of files. Wit hthis change we create extra imports only for the files that contain at least one component whose NgModule is in a different file. This is because all other files do not need extra imports since they are either not Angular files or they already have all the imports that the components need.

PR Close #55548
2024-05-02 10:57:41 -07:00
Kristiyan Kostadinov a0ec2d8915 fix(core): don't schedule timer triggers on the server (#55605)
Fixes that even though we weren't rendering the deferred block the server, we were still triggering the timeout which can delay the response.

Fixes #55475.

PR Close #55605
2024-05-01 15:10:26 -07:00
Emma Twersky fc9602087a docs: update press kit to reduce confusion (#55611)
PR Close #55611
2024-05-01 15:09:33 -07:00
Matthieu Riegler 7ff7dfaee7 docs: fix missing example (#55584)
preview is hidding was responsible for hidding the content.

fixes #55583

PR Close #55584
2024-05-01 15:07:58 -07:00