Compare commits

...

203 Commits

Author SHA1 Message Date
Jessica Janiuk 6652f9fad9 release: cut the v20.1.4 release 2025-07-31 10:38:57 +02:00
Joey Perrott faa9ed9435 build: remove @bazel/esbuild (#62907)
Remove @bazel/esbuild as its no longer used

PR Close #62907
2025-07-30 17:37:14 +00:00
Joey Perrott 97180abd44 build: migrate @angular/upgrade examples tests to new esbuild (#62907)
Migrate to the new esbuild

PR Close #62907
2025-07-30 17:37:14 +00:00
Joey Perrott 3f42c05113 build: update to latest devinfra in workspace (#62901)
Update to the latest devinfra in workspace to correct goldens update error

PR Close #62901
2025-07-30 16:19:37 +00:00
Joey Perrott 280f1f59e1 test(language-service): update language-service legacy tests (#62900)
Update the language-service legacy tests to use new toolchain as basis for tests

PR Close #62900
2025-07-30 15:54:59 +00:00
Jessica Janiuk 82fcc9c136 Revert "fix(http): add missing http options allowed in fetch API (#62881)" (#62899)
This reverts commit ab6033979a.

PR Close #62899
2025-07-30 14:35:36 +00:00
SkyZeroZx ab6033979a 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:42 +00:00
Matthieu Riegler 55e575adee docs(docs-infra): increase until timeout (#62894)
Those tests have been flaky recently, let's try increasing the timeout

PR Close #62894
2025-07-30 10:01:04 +00:00
Angular Robot a2e3bfcbbf build: update all non-major dependencies (#62892)
See associated pull request for more information.

PR Close #62892
2025-07-30 09:37:08 +00:00
Matthieu Riegler 25c6b1547f refactor(core): add private resource error helper function for g3 migration (#62840)
This function is intented to be temporary to help migrate G3 code to the new throwing behavior.

PR Close #62840
2025-07-30 09:23:11 +00:00
Angular Robot af53c93114 build: update github/codeql-action action to v3.29.5 (#62891)
See associated pull request for more information.

PR Close #62891
2025-07-30 08:53:29 +00:00
Joey Perrott 775f918192 build: remove usages of rules_nodejs (#62885)
Remove rules_nodejs usages with direct migrations to rule_js alternatives

PR Close #62885
2025-07-30 08:51:28 +00:00
Joey Perrott de37d1a5d9 build: correctly apply patch fro dagre-d3-es (#62884)
Correctly apply patch for dagre-d3-es so that it is effective with new toolchain

PR Close #62884
2025-07-30 08:50:17 +00:00
Joey Perrott 3f0e823a5d build: remove the esm interop patches and tooling (#62880)
Remove esm interop patches and tooling from previous toolchain

PR Close #62880
2025-07-29 17:28:38 +00:00
Matthieu Riegler db3c5826ee fix(compiler): exclude more safe reads expression from 2way-binding (#62852)
Priori to this fix the parser would allow safereads in accestor receievers (but the direct one).

fixes #62837

PR Close #62852
2025-07-29 17:28:08 +00:00
arturovt 8ddf5e4dc1 refactor(service-worker): align getRegistration() types (#62497)
In this commit, we align the service worker types with those provided by TypeScript. The `ServiceWorkerContainer.getRegistration()` method returns a `Promise<ServiceWorkerRegistration | undefined>`, but we were casting it to `Observable<ServiceWorkerRegistration>`, ignoring the possibility of `undefined`.

This is unsafe, as we should account for the case where the registration is `undefined` and handle it appropriately in the push manager.

PR Close #62497
2025-07-29 17:25:03 +00:00
Joey Perrott c9fb4e31dd build: use ts_project based extract_types (#62875)
Use the extract_types that pulls from ts_project deps

PR Close #62875
2025-07-29 17:14:27 +00:00
Joey Perrott ea1afec1e4 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:55 +00:00
Joey Perrott c032f69287 build: remove unused macro (#62878)
Remove unused npm_package_bin macro

PR Close #62878
2025-07-29 16:53:55 +00:00
Joey Perrott 2c3faf7a7e build: remove final usages of nodejs_binary macros (#62878)
Remove the remaining usages of our nodejs_binary macros

PR Close #62878
2025-07-29 16:53:54 +00:00
Angular Robot e8744c696f build: update cross-repo angular dependencies (#62877)
See associated pull request for more information.

PR Close #62877
2025-07-29 16:50:36 +00:00
Justin White 34ba50e1ed docs: fix const for pi calculation (#62872)
PR Close #62872
2025-07-29 16:48:06 +00:00
Matthieu Riegler 0b9f53a05d docs: fix ActivateRoute example (#62855)
PR Close #62855
2025-07-29 12:17:46 +00:00
Matthieu Riegler f0fca612ee 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
Angular Robot cd256ef33c build: update dependency preact to v10.27.0 (#62863)
See associated pull request for more information.

PR Close #62863
2025-07-29 09:35:13 +00:00
Matthieu Riegler 5b604547f5 docs: restore mention of structural directives. (#62836)
The link was removed in #61708, but we should actually kept it but point to the dedicated page

fixes #62835

PR Close #62836
2025-07-29 09:33:29 +00:00
Joey Perrott 622e10881f 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:45 +02:00
Angular Robot 88913b2e32 build: update cross-repo angular dependencies (#62857)
See associated pull request for more information.

PR Close #62857
2025-07-28 20:55:53 +02:00
Joey Perrott 2b16824110 build: move tsec to new toolchain (#62825)
Migrate tsec tooling/macro to use tsec directly as a js_binary and rely on ts_project dependencies.

PR Close #62825
2025-07-28 20:07:05 +02:00
Angular Robot a53c8b0b2a build: update cross-repo angular dependencies (#62828)
See associated pull request for more information.

PR Close #62828
2025-07-28 19:05:29 +02:00
Milo c633b63e56 fix(core): update symbols for new signals api (#62284)
approve the new symbols that appear from bundling the signals changes

PR Close #62284
2025-07-28 17:01:43 +02:00
Milo ce2cd9e7a0 refactor(core): use quad linked lists for signals (#62284)
inspired by the design of Preact's signals, use linked lists instead of arrays for faster signal creation

PR Close #62284
2025-07-28 17:01:43 +02:00
Angular Robot aa46ad258e build: update dependency rollup to v4.46.1 (#62833)
See associated pull request for more information.

PR Close #62833
2025-07-28 14:22:05 +02:00
Joey Perrott 14d998d809 build: use rollup to locally bundle domino (#62823)
Use rollup instead of esbuild for bundling domino locally for usage within the repository

PR Close #62823
2025-07-28 14:19:57 +02:00
Joey Perrott 973740e14a build: migrate zone.js tests to use web test runner instead of karma web tests (#62826)
Migrate zone.js bazel tests to use web test runner instead of karma

PR Close #62826
2025-07-28 14:18:46 +02:00
Avcharov Hryhorii 86111d71e6 refactor(docs): rename idx to firebase studio (#62848)
Rename IDX, as since now IDX is a part of Firebase Studio

PR Close #62848
2025-07-28 14:17:35 +02:00
Joey Perrott 9a8b5c74eb build: remove local zone.js build from usage in integration tests (#62800)
Remove the local zone.js build from dependencies in the integration tests

PR Close #62800
2025-07-25 16:54:20 +02:00
Joey Perrott b6f52c3111 build: move from using rollup to esbuild for bundling zone.js (#62800)
Use esbuild to bundle zone.js

PR Close #62800
2025-07-25 16:54:20 +02:00
Andrew Scott 715d5ce192 build: Export language service bundle (#62811)
fixes Plugin activation failed: Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './bundles/language-service.js' is not defined by 'exports'

PR Close #62811
2025-07-25 16:52:00 +02:00
Angular Robot c11f7b991f build: update cross-repo angular dependencies (#62807)
See associated pull request for more information.

PR Close #62807
2025-07-25 14:32:17 +02:00
Joey Perrott dce0609755 build: use ts_config rule from rules_ts only and always load from common location (#62808)
Only use the ts_config rule from rules_ts, and always load the rule from tools/defaults2.bzl

PR Close #62808
2025-07-25 10:08:13 +02:00
Joey Perrott 2b0f3fc7cb build: remove all usages of @bazel/runfiles (#62805)
Remove usages of @bazel/runfiles throughout the repository

PR Close #62805
2025-07-25 10:05:54 +02:00
Jan-Niklas W. 0040ac7359 docs: fix issue in jetbrains MCP configuration (#62802)
PR Close #62802
2025-07-25 10:04:15 +02:00
Garegin Hakobyan 82862deab8 docs(docs-infra): correct typos in adev and wording in resource api (#62801)
PR Close #62801
2025-07-24 16:13:00 +00:00
Charles Lyding da0fb331ca docs: add initial documentation for MCP server tools (#62777)
Adds documentation for the tools available in the Angular CLI MCP server. This includes:
- get_best_practices
- search_documentation
- list_projects

Also includes a section for providing feedback and ideas for new capabilities.

PR Close #62777
2025-07-24 14:00:11 +00:00
SkyZeroZx 206d153301 refactor(forms): Removes redundant destroy ref usage in value accessor in select control (#62738)
Simplifies destruction logic by relying directly on the injector's destroyed state.
Eliminates unnecessary retrieval of a separate destroy reference

PR Close #62738
2025-07-24 13:25:31 +00:00
Angular Robot 5aaf726b66 build: update dependency source-map to v0.7.6 (#62791)
See associated pull request for more information.

PR Close #62791
2025-07-24 11:55:48 +00:00
Angular Robot 187cb9cd10 build: update cross-repo angular dependencies (#62790)
See associated pull request for more information.

PR Close #62790
2025-07-24 11:27:30 +00:00
Angular Robot 69537c439d build: update github/codeql-action action to v3.29.4 (#62792)
See associated pull request for more information.

PR Close #62792
2025-07-24 11:02:34 +00:00
Gerome Grignon 8292cca146 docs(router): rephrase the package installation (#62704)
PR Close #62704
2025-07-24 11:00:28 +00:00
Angular Robot e2e1cb6def build: lock file maintenance (#62794)
See associated pull request for more information.

Closes #62622 as a pr takeover

PR Close #62794
2025-07-24 10:59:16 +00:00
Andrew Scott a967f92078 test(router): Use autoTick feature in router tests (#62776)
This updates async router tests to use the jasmine autoTick feature. Observed test timings
for the chromium tests went down from ~7.5s to ~3.5-4s. For node, these decreased from ~5.5s to ~3s.

In addition to the speed improvement, this feature:

* Removes the need to be careful about timeout ordering when there are several timeouts in tests.
* Removes the need to ensure test timeouts are kept sufficiently small
* Reduces overall flakiness

PR Close #62776
2025-07-24 10:04:06 +00:00
Walter Breakell 502bb4de9c docs: update link to git fixup documentation (#62717)
PR Close #62717
2025-07-24 10:02:41 +00:00
Angular Robot f2f1af97ab build: update dependency angular-split to v20 (#62756)
See associated pull request for more information.

PR Close #62756
2025-07-24 09:41:32 +00:00
Sebastian Barfurth 15670d8417 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
Matthieu Riegler a83ef0ecdf refactor(compiler): Error on comment only interpolations (#62590)
This commit introduces a ParserError to prevent an error later in the pipepine

fixes #34084

PR Close #62590
2025-07-24 09:19:47 +00:00
Matheus B. 19bc917c62 docs(docs-infra): fix indentation in documentation (#62774)
fix minor indentation issue in a code block to improve readability
PR Close #62774
2025-07-24 09:17:55 +00:00
Jan Martin 6c925139d8 docs: call out cleanup steps in devtools release process (#62769)
PR Close #62769
2025-07-24 09:16:13 +00:00
Matthieu Riegler a082f315db docs: add mentions of dynamic title resolver / strategy (#62751)
PR Close #62751
2025-07-24 09:15:29 +00:00
Kirill Cherkashin d53649c8fb release: cut the v20.1.3 release 2025-07-23 16:54:37 -04:00
Andrew Scott 006eaf3d90 build: update bazel rules_browsers dependency (#62772)
Updates only rules_browsers since
https://github.com/angular/angular/pull/62542 is having difficulty with
other deps updated at the same time

PR Close #62772
2025-07-23 15:42:05 -04:00
Matthieu Riegler 155dbee71a docs: guard a resource error with hasValue() (#62708)
fixes #62687

PR Close #62708
2025-07-23 14:00:47 -04:00
Jan Martin 6398baa215 release: bump Angular DevTools version to 1.0.40 (#62767)
PR Close #62767
2025-07-23 09:25:24 -07:00
Kristiyan Kostadinov 2fd1f7beb5 fix(platform-browser): resolve component resources before bootstrapping in JIT mode (#62758)
Currently if the app has some external resources and it gets bootstrapped in JIT mode, the user will get an error about calling `resolveComponentResources`. These changes add a call to `resolveComponentResources` automatically inside `bootstrapApplication`.

Note that we don't need similar logic for `bootstrapModule`, because it calls into `compileNgModuleFactory` internally which in turn calls `resolveComponentResources`.

PR Close #62758
2025-07-23 11:05:20 -04:00
Angular Robot f38ee0d0e9 build: update all non-major dependencies (#62755)
See associated pull request for more information.

PR Close #62755
2025-07-23 11:04:41 -04:00
Charles Lyding b7c745b12d docs: create MCP server setup guide (#62746)
Introduces a new guide for setting up the Angular CLI's Model Context Protocol (MCP) server.

The guide includes:
- Instructions on how to use the command.
- IDE-specific JSON configurations for VS Code, JetBrains, Firebase Studio, and Cursor.
- Clarification on the different JSON structures required by each IDE.

PR Close #62746
2025-07-23 07:24:48 -04:00
Jessica Janiuk c00359dd14 ci: update renovate reviewers (#62761)
This restores the framework-team availability, since the setting was not working as intended.

PR Close #62761
2025-07-23 07:24:13 -04:00
Angular Robot 91bdd178f4 build: update @angular/ng-dev digest to 75a2aee (#62745)
See associated pull request for more information.

PR Close #62745
2025-07-22 12:32:30 -04:00
Joey Perrott db8f7ce0ba build: move generating doc files for @angular/ssr to using an intermediate typescript file (#62734)
Use an intermediate typescript file to rexport all of all of @angular/ssr rather than reaching into the npm package files

PR Close #62734
2025-07-22 10:13:28 -04:00
Joey Perrott e361deae30 build: remove unused @bazel/* npm packages (#62711)
Remove the unused bazel npm packages

PR Close #62711
2025-07-22 10:10:18 -04:00
Joey Perrott 807c4d7973 build: move nodejs_test to js_test (#62711)
Move nodejs_test to js_test and remove unnecessary files after move

PR Close #62711
2025-07-22 10:10:18 -04:00
Joey Perrott ca10fbde5a build: remove unused rules/macros from defaults.bzl (#62711)
Remove rules/macros that are not longer used in the repo

PR Close #62711
2025-07-22 10:10:18 -04:00
Joey Perrott 91f5a3c0ec build: migrate tslint rules from dev-infra to local (#62711)
Migrate the tslint rules used in dev-infra to locally defined rules as they are unused in other repos

PR Close #62711
2025-07-22 10:10:17 -04:00
Angular Robot 1151c45086 build: update github/codeql-action action to v3.29.3 (#62741)
See associated pull request for more information.

PR Close #62741
2025-07-22 10:05:41 -04:00
Matthieu Riegler 38b7ab26fb refactor(core): add a getTransferState for the devtools (#62722)
`getTransferState` will expose public data from the transfer state. It will for example remove internal hydration data.

PR Close #62722
2025-07-21 17:00:28 -04:00
AleksanderBodurri 45d3eeffaf test(devtools): bump cypress timeout to 10 seconds (#62726)
By default this is 4 seconds. In CI we have unreliable runtime performance so we this change gives us a bit of wiggle room to validate application behaviour.

PR Close #62726
2025-07-21 16:35:40 -04:00
Angular Robot f041042947 build: update cross-repo angular dependencies (#62731)
See associated pull request for more information.

PR Close #62731
2025-07-21 16:12:26 -04:00
Aristeidis Bampakos 74e47782c6 docs: fix minor typos in styleguide (#62706)
PR Close #62706
2025-07-21 13:38:40 -04:00
Joey Perrott b388f1e518 build: remove all usages of the interop_deps attr for ts_project and ng_project (#62733)
Remove all of the usages of interop_deps as attributes in the repo

PR Close #62733
2025-07-21 13:10:18 -04:00
AleksanderBodurri aee5260610 fix(devtools): stop reseting currentlyMatchedIndex when a node is selected in the component explorer (#62727)
This was causing some unintended behaviour when paired with our new zoneless configuration. I'm not sure why currentlyMatchedIndex was getting set to -1 here. With this removed it seems like things are working as expected. Previously a select call would reset this index *after* a search filter was applied, which would cause weird behaviour with the "next" and "prev" buttons.

PR Close #62727
2025-07-21 12:15:02 -04:00
Angular Robot 70d0c10d6c docs: update Angular CLI help (#62730)
Updated Angular CLI help contents.

PR Close #62730
2025-07-21 12:06:28 -04:00
Angular Robot bca8a3c73b build: update dependency node to v22.17.1 (#62715)
See associated pull request for more information.

PR Close #62715
2025-07-21 10:54:11 -04:00
Angular Robot a1a78b2e13 build: update all non-major dependencies (#62716)
See associated pull request for more information.

PR Close #62716
2025-07-21 10:22:12 -04:00
Johnny Huang cf48b13706 docs: fix code snippet (#62720)
changes code snippet on first-app tutorials (https://angular.dev/tutorials/first-app/09-services) for the step "Add a new file level import for the HousingService:" from 

imports: [HousingLocation], 

to

import {HousingService} from '../housing.service';
PR Close #62720
2025-07-21 09:37:46 -04:00
Angular Robot c36de9e6ca build: update cross-repo angular dependencies (#62651)
See associated pull request for more information.

PR Close #62651
2025-07-18 10:19:36 -04:00
Matthieu Riegler 409287add3 docs: split devtools doc to prepare for upcomming updates (#62597)
PR Close #62597
2025-07-18 10:07:46 -04:00
Elizabeth 2c522efbe5 fix(core): fix change tracking for Resource#hasValue (#62595)
When using `hasValue()` I would expect it to behave like any other
reactive value such that changes to the internal `value()` that do not
cause `hasValue()` to return anything different do not trigger change
detection, but this was not the case. This change wraps the value
checking in a `computed` such that it behaves as expected again while
still preserving the type narrowing.

PR Close #62595
2025-07-18 10:01:44 -04:00
Andrew Scott ba8a5d826e refactor(core): Use promise.finally for task removal (#62674)
Updates the approach from https://github.com/angular/angular/pull/62631 to
use Promise.finally for task removal. This is a bit cleaner and also handles
rejections from the donePromise

PR Close #62674
2025-07-18 07:19:49 -04:00
Joey Perrott 1e9bfe54b1 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:43 -04:00
Kirill Cherkashin c53abd96f1 release: cut the v20.1.2 release 2025-07-17 17:47:43 -04:00
Jonathan Pribesh e7e2dea9c8 docs: fixes binding box typo in httpResource.value() template example (#62661)
PR Close #62661
2025-07-17 14:31:08 -04:00
Matthieu Riegler 8ad10fd63b fix(compiler): fix detection of directive deps in JIT (#62666)
This fix also matches the implementation to the jsdoc for `hasDirectiveDependencies` "Whether any of the component's dependencies are directives"

fixes #62573

PR Close #62666
2025-07-17 14:20:32 -04:00
Joey Perrott c2625575aa build: remove ts_library definition (#62686)
Remove the ts_library macro from our defaults.bzl file

PR Close #62686
2025-07-17 14:16:02 -04:00
Joey Perrott 8b62b313e1 build: migrate zone.js to use ts_project instead of ts_library (#62686)
Use ts_project instead of ts_library for building zone.js

PR Close #62686
2025-07-17 14:16:02 -04:00
hawkgs dcab8c928b refactor(devtools): rearrange main toolbar menu buttons (#62684)
Place the version in the info menu and move both the info and gear buttons to the right-hand side of the toolbar.

PR Close #62684
2025-07-17 14:06:32 -04:00
Tony Conway 1930e99e14 docs: Update versions.md to use canonical Baseline site (#62680)
replace `tonypconway` fork URL with canonical `web-platform-dx` URL

PR Close #62680
2025-07-17 13:26:41 -04:00
Joey Perrott 0db3613565 build: remove rules_nodejs based protractor tooling (#62649)
Remove the protractor setup based on rules_nodejs

PR Close #62649
2025-07-16 16:39:50 -04:00
Joey Perrott bcf07e4559 build: remove extra toolchain registration (#62649)
Remove extra toolchain registration that is redundant as we already add the toolchains elsewhere

PR Close #62649
2025-07-16 16:39:50 -04:00
Joey Perrott 3e8e16bce7 build: migrate protractor test to new toolchain (#62649)
Migrate to new toolchain for protractor test in packages/examples/upgrade

PR Close #62649
2025-07-16 16:39:50 -04:00
Joey Perrott 5aed352abd ci: use new size tracking in integration tests (#62652)
Use the new size tracking within integration tests

PR Close #62652
2025-07-16 16:36:13 -04:00
Joey Perrott 2bcdc66159 build: move all rule/macro loading into adev/defaults.bzl and fix intellisense loading (#62629)
Move all of our loading into a local defaults.bzl file instead of mixed loading via tools/defaults and adev/defaults

PR Close #62629
2025-07-16 16:34:05 -04:00
Joey Perrott 7bf66f0c52 build: move all rule/macro loading into devtools/defaults.bzl (#62629)
Move all of our loading into a local defaults.bzl file instead of mixed loading via tools/defaults and devtolls/defaults

PR Close #62629
2025-07-16 16:34:04 -04:00
Jan Martin 4b9385f468 release: bump Angular DevTools version to 1.0.39 (#62670)
PR Close #62670
2025-07-16 16:13:12 -04:00
Andrew Kushnir 44784f175d release: cut the v20.1.1 release 2025-07-16 10:58:44 -07:00
Kristiyan Kostadinov 9506cdfaad fix(compiler-cli): infer type of event target for void elements (#62648)
Currently we infer the target of DOM events to be `EventTarget | null` which is consistent with the built-in types for `addEventListener`. This is due to the fact that users can dispatch custom events, or the event might've bubbled. However, this typing is also inconvenient for some other common use cases like `<input (input)="query($event.target.value)">`, because we don't have the ability to type cast in a template.

These changes aim to make some of the cases simpler by inferring the type of `$event.target` if the event is bound on a void element which guarantees that it couldn't have bubbled.

PR Close #62648
2025-07-16 12:40:26 +02:00
Kristiyan Kostadinov 2ab638d514 refactor(core): expose function to assert type of variables (#62648)
Adds the `ɵassertType` function that will be used during type checking to assert the type of a value.

PR Close #62648
2025-07-16 12:40:26 +02:00
Kristiyan Kostadinov 53963e910e refactor(compiler): indicate whether element is void at AST level (#62648)
Updates the HTML AST to indicate whether a specific element is a void element.

PR Close #62648
2025-07-16 12:40:25 +02:00
Kristiyan Kostadinov 70c8780c54 fix(compiler): more permissive parsing of @ characters (#62644)
When we introduced blocks, we made a deliberate decision to treat the `@` character as a reserved character in case we need to use it for other syntax in the future. This meant that some common cases, like writing out an email address in the template, can be broken.

After some recent discussions we decided to relax the requirement and only treat `@` as a reserve character if it's followed by a character sequence that matches a known block.

PR Close #62644
2025-07-15 13:24:47 -07:00
Kristiyan Kostadinov f531370281 test(compiler): remove duplicated lexer tests (#62644)
There were 26 duplicated block tests in `lexer_spec.ts`, likely due to merge conflicts. These changes remove the duplicates while keeping the 6 tests that were different.

PR Close #62644
2025-07-15 13:24:47 -07:00
Angular Robot acf8b742d8 build: update all non-major dependencies (#62643)
See associated pull request for more information.

PR Close #62643
2025-07-15 09:35:03 -07:00
SkyZeroZx 6f5bd5f964 docs: Update documentation httpResource with referrer & integrity options (#62637)
PR Close #62637
2025-07-15 09:33:15 -07:00
muhammadali1658 72605a42c4 docs: fix missing 'of' in Style Guide sentence (#62628)
PR Close #62628
2025-07-15 07:59:20 -07:00
Kristiyan Kostadinov 75d2a349b4 fix(compiler): incorrect spans for left side of binary operation (#62641)
Fixes that the span for the `left` side of a `Binary` AST included the range up to and including the operator.

Fixes #62617.

PR Close #62641
2025-07-15 07:57:32 -07:00
Kristiyan Kostadinov e8234095ca docs: update best practices prompt (#62640)
Updates the `best-practices.md` with results from recent testing.

PR Close #62640
2025-07-15 07:56:05 -07:00
Milo d381e3b05b refactor(devtools): simplify vendored deps to make importing into google3 easier (#62636)
prefer using node_modules/webtreemap, and remove memo-decorator

PR Close #62636
2025-07-15 07:53:51 -07:00
Andrew Scott 26ade4a337 fix(core): Ensure application remains unstable during bootstrap (#62631)
This commit ensures the application remains unstable during the entire
bootstrap process. This ensures all bootstrap listeners and app
initializers observe the application as being unstable until each one
has gotten a chance to execute the synchronous block (potentially adding
more pending tasks).

Prior to this commit, application initializers or bootstrap
listeners may observe the application as being stable, even though other
initializers/listeners had not yet executed. This created an ordering
issue whereby the hydration bootstrap listener would observe the
application as stable prior to the router performing its initial
navigation.

fixes #62592

PR Close #62631
2025-07-15 07:52:36 -07:00
aparziale a81f0faa1a fix(core): InputBinding marks component a dirty. (#62613)
This fix ensures that CD runs on OnPush component when an input binding is set.

PR Close #62613
2025-07-14 15:46:29 -07:00
Joey Perrott 74beeeca3f docs: correctly look for examples in the bin_dir instead of execPath (#62632)
Properly look for the example files for live previews in the bin_dir

PR Close #62632
2025-07-14 14:49:16 -07:00
Ben Hong f202160e6e docs: add dedicated data resolvers router guide (#62250)
PR Close #62250
2025-07-14 14:17:50 -07:00
Matthieu Riegler c526238751 build: set paths for devtools & adev (#62574)
This allows the IDE to find the right imports

PR Close #62574
2025-07-14 14:11:09 -07:00
arturovt 5949373692 fix(router): handle errors from view transition readiness (#62535)
This commit adds a `.catch()` handler to `transition.ready` from `document.startViewTransition` to prevent `AbortError`s in Safari when `startViewTransition` is called synchronously multiple times.

PR Close #62535
2025-07-14 11:39:57 -07:00
Matthieu Riegler 22b56ca66f test(docs-infra): Use the zoneless testing rule (#62596)
This will spare use the warning logs when the tests run.

```
      NG0914: The application is using zoneless change detection, but is still loading Zone.js. Consider removing Zone.js to get the full benefits of zoneless. In applications using the Angular CLI, Zone.js is typically included in the "polyfills" section of the angular.json file.
```

PR Close #62596
2025-07-14 11:36:44 -07:00
Matthieu Riegler 5aa69ff0a2 refactor(devtools): Use OnPush on all components (#62610)
The end goal is to move the devtools app to zoneless.

PR Close #62610
2025-07-14 11:35:48 -07:00
Angular Robot a5b45ca2f6 build: update all non-major dependencies (#62604)
See associated pull request for more information.

PR Close #62604
2025-07-14 11:34:36 -07:00
Emily Marigold Klassen 0ce086e967 docs: update forgotten change to input signals (#62612)
PR Close #62612
2025-07-14 10:03:24 -07:00
Matthieu Riegler c9d7a70fb5 refactor(devtools): update the patch branch with the content of main. (#62623)
This is a technical commit.

PR Close #62623
2025-07-14 10:02:53 -07:00
Dmitry Kostyuk 546d7b8329 docs(docs-infra): fix nested routes example (#62608)
PR Close #62608
2025-07-14 10:00:49 -07:00
Matthieu Riegler b935eff007 docs: fix CLI reference layout (#62609)
fixes #62602

PR Close #62609
2025-07-14 09:59:55 -07:00
Matthieu Riegler ebfc946683 docs: add note about difference between class bindings and ngClass (#62611)
fixes #40623

PR Close #62611
2025-07-14 09:59:17 -07:00
Matthieu Riegler ddd92585a9 docs(docs-infra): Add status to some guide entries. (#62614)
Guide entries can now have "new" or "updated" tags.

PR Close #62614
2025-07-14 09:58:14 -07:00
Joao da Silva 4dd0586978 docs: fix lazy load example in define-routes.md (#62620)
Fixes #62619

PR Close #62620
2025-07-14 09:57:27 -07:00
Angular Robot 1fa10c07ce docs: update Angular CDK apis (#62601)
Updated Angular CDK api files.

PR Close #62601
2025-07-11 16:07:38 -07:00
Angular Robot db11cdd389 build: update all non-major dependencies (#62583)
See associated pull request for more information.

PR Close #62583
2025-07-11 14:46:59 -07:00
Jessica Janiuk 02dce8ee11 ci: add to public-api approvers list (#62591)
This appends reviewers to the approvers list.

PR Close #62591
2025-07-11 10:43:28 -07:00
fortnite misogynist 4bd178a68c docs: fix comment breaking Highlighter (#62577)
This fixes a comment that was causing issues with docs highlighting

PR Close #62577
2025-07-11 10:41:47 -07:00
Angular Robot cfdd04b2ac build: update cross-repo angular dependencies (#62565)
See associated pull request for more information.

PR Close #62565
2025-07-11 10:40:41 -07:00
Joey Perrott 4f1e88e598 build: use esbuild from aspect rules (#62568)
Use the esbuild ruleset from aspect rules instead of via @bazel/esbuild

PR Close #62568
2025-07-10 13:45:15 -07:00
Jessica Janiuk aea0a70c1d ci: adjust renovate teams (#62578)
This switches framework team to approve but not requested, and adds the currently active caretaker group to the teams for renovate.

PR Close #62578
2025-07-10 12:52:31 -07:00
Andrew Kushnir 6549418e39 refactor(core): include DI path into cyclic dependency error message (#50902)
This commit updates the logic to better handle a situation when there is a cyclic DI dependency detected. Previously, the error message used to contain the name of the token that triggered the problem. With this change, the DI resolution path would also be included, so that it's easier to find and resolve the cycle.

PR Close #50902
2025-07-10 10:35:12 -07:00
Alan Agius 66a85ab190 docs: update browsers support versions (#62572)
The current URL is not correct as it incorrectly includes browsers. We now replace the URL with the comparer provided by baseline which will be available soonish via `web-platform-dx.github.io`

PR Close #62572
2025-07-10 10:26:24 -07:00
Joey Perrott 6b271c88f2 build: use tsc from @npm2// instead of @npm// (#62558)
Use tsc from the new node_modules layout

PR Close #62558
2025-07-10 10:25:36 -07:00
Angular Robot e9905f7b7f build: update all non-major dependencies (#62515)
See associated pull request for more information.

PR Close #62515
2025-07-10 10:21:04 -07:00
Joey Perrott b4ae55ae68 build: use rollup directory instead of rollup through @bazel/rollup (#62556)
Use rollup directly instead of using the previous toolchain implementation

PR Close #62556
2025-07-09 16:53:25 -07:00
Angular Robot 6274ea7e8b docs: update Angular CLI help (#62519)
Updated Angular CLI help contents.

PR Close #62519
2025-07-09 14:03:50 -07:00
Alan Agius 276836ee73 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
ice-blaze 11d817348c docs(forms): remove unecessary FormGroup casting (#62555)
Fixes #62554

PR Close #62555
2025-07-09 12:43:50 -07:00
Miles Malerba 317ae4443a ci: add gemini code assist config (#62560)
Configures gemini to not interact with new pull requests, only review on
demand

PR Close #62560
2025-07-09 12:42:46 -07:00
Matthieu Riegler 053cd3c747 docs(docs-infra): do not cache the versions.json file (#62534)
Without the flag, the file gets inline in the transfer cache making the resource useless.

PR Close #62534
2025-07-09 12:42:06 -07:00
Joey Perrott f038803693 build: migrate esbuild usages to aspect_rules_esbuild esbuild rule (#62529)
Migrate more usages of esbuild to new toolchain

PR Close #62529
2025-07-09 12:41:27 -07:00
Matthieu Riegler ee16715c68 docs(docs-infra): run analytics only on the browser (#62531)
We don't care about server, adev only uses SSG.
Also `setCookieConsent` is throwing on node.

PR Close #62531
2025-07-09 12:40:37 -07:00
Matthieu Riegler 59de6400fa docs(docs-infra): update update guide when changing level (#62526)
This commit also fixes the colors of the material button toggle

fixes #62432

PR Close #62526
2025-07-09 12:40:01 -07:00
Matthieu Riegler 2f969c8ac4 docs(docs-infra): fix banner position on mobile & tablet (#62521)
#62509

PR Close #62521
2025-07-09 12:39:14 -07:00
Ben Hong d5d692766c docs: add dedicated routing lifecycle and events guide (#62225)
doc: apply suggestions from code review

Co-authored-by: Enea Jahollari <jahollarienea14@gmail.com>

Co-authored-by: Matthieu Riegler <kyro38@gmail.com>

PR Close #62225
2025-07-09 12:38:34 -07:00
Andrew Kushnir bf1b51cefe release: cut the v20.1.0 release 2025-07-09 12:25:58 -07:00
Angular Robot fed402f598 build: update dependency aspect_rules_ts to v3.6.3 (#62514)
See associated pull request for more information.

PR Close #62514
2025-07-08 16:02:47 -07:00
Joey Perrott fe50aeb3bf build: migrate usages of protractor_web_test_suite to use new rules_browser based rule (#62525)
Use the protractor_web_test_suite from rules_browser instead of @bazel/protractor

PR Close #62525
2025-07-08 15:59:12 -07:00
Matthieu Riegler dda655f8e8 refactor(devtools): remove unused imports (#62530)
Import had no purpose and was also invalid.

PR Close #62530
2025-07-08 12:12:22 -07:00
sEver c4de0c0671 fix(docs-infra): fix tutorial formatting issues (for v20) (#62457)
Fixes including, but not limited to:
- `visibleLines` values
- all codeblocks normalized to 2 spaces indentation
- lesson 14-http sEverely de-indented
- descriptions and explanations were rewritten to reflect the changes from @Input to input and from ngFor to @for
- missing step added in lesson 11-details-page
- rewritten confusing instructions for adding code that was already added in previous steps

PR Close #62457
2025-07-08 11:30:15 -07:00
Matthieu Riegler b61c8e1d2e fix(devtools): do not emit a route object with functions (#62254)
In the case where a Route has title defined as a function, it eventually throw when it reaches `window.postMessage`

fixes #60595

PR Close #62254
2025-07-08 11:28:28 -07:00
Matthieu Riegler 46d3bb56ea docs(docs-infra): generate llms-full.txt at build time (#61864)
PR Close #61864
2025-07-08 11:27:54 -07:00
Paul Gschwendtner 1a8297bf9e refactor(compiler): fix import manager to be closure property renaming-compatible (#62517)
The `generateUniqueIdentifier` helper relies on the internal `identifiers` property of a `ts.SourceFile`.
As this is not a public-facing API, it is not included in the externs provided to Closure Compiler.
Consequently, it is susceptible to being renamed during advanced optimizations, which would lead to runtime failures.

To prevent this, the property is now accessed via a string literal (`sf['identifiers']`). This change ensures that
the property name is preserved through the compilation process. An explanatory comment has been added to clarify the
necessity of this approach for future reference.

PR Close #62517
2025-07-08 11:31:09 +00:00
Angular Robot efc6405816 build: update devinfra digest to 6f54d14 (#62508)
See associated pull request for more information.

PR Close #62508
2025-07-07 20:55:23 +00:00
Joey Perrott aee83d1629 build: migrate angular-optimization from devinfra to devtools (#62505)
Migrate angular-optimization to devtools instead of loading via npm package

PR Close #62505
2025-07-07 20:21:26 +00:00
Angular Robot 46c920b1bd build: update cross-repo angular dependencies to v20.0.5 (#62501)
See associated pull request for more information.

PR Close #62501
2025-07-07 19:54:47 +00:00
Joey Perrott 2f45910489 build: disable firefox tests in devtools (#62504)
Disabling firefox tests in devtools until we can get them working on OS X as expected

PR Close #62504
2025-07-07 18:29:19 +00:00
Angular Robot bf234143db build: lock file maintenance (#62495)
See associated pull request for more information.

PR Close #62495
2025-07-07 18:10:30 +00:00
Angular Robot 5a60242421 build: update all non-major dependencies (#62478)
See associated pull request for more information.

PR Close #62478
2025-07-07 17:24:01 +00:00
Dzhavat Ushev fec1206f64 docs: update comment (#62482)
PR Close #62482
2025-07-07 16:52:15 +00:00
Paul Gschwendtner 98ecf800fa refactor(compiler): ensure compiler passes closure conformance checks (#62500)
This commit adjusts some code of the compiler that currently results in
conformance checks failures with JSCompiler/Closure.

PR Close #62500
2025-07-07 16:14:17 +00:00
Joey Perrott 35d74d2fb2 build: update to latest @angular/build-tooling (#62499)
Update to the latest @angular/build-tooling package, which drop dependency on @angular/benchpress

PR Close #62499
2025-07-07 16:07:29 +00:00
Angular Robot 30218af593 build: update dependency aspect_rules_ts to v3.6.2 (#62477)
See associated pull request for more information.

PR Close #62477
2025-07-07 15:35:56 +00:00
Kristiyan Kostadinov 918a8d06ca fix(compiler-cli): use proper name for diagnostic type (#62479)
Currently when a diagnostic happens in a template, we always say "Error occurs in ...", however we have other types of diagnostics as well.

PR Close #62479
2025-07-07 15:29:39 +00:00
Joey Perrott 62e3a70519 build: only require workspace build packages for web tests when provided (#62498)
Only use the builds from the workspace as for the bootstrap scripts for web testing

PR Close #62498
2025-07-07 15:26:37 +00:00
Joey Perrott c4863d2f98 build: migrate all dependencies for adev into adev/package.json (#62498)
Migrate the dependencies into the adev/package.json instead of importing from the the root package.json

PR Close #62498
2025-07-07 15:26:37 +00:00
Joey Perrott ffce768115 build: migrate remaing esbuild and nodejs_binary usages to new toolchain (#62498)
Migrate the remaing usages of esbuild and nodejs_binary in adev to the new toolchain versions.

PR Close #62498
2025-07-07 15:26:37 +00:00
Joey Perrott f8807a30be build: migrate adev to use rules_angular based cli rules (#62498)
Use the @angular/cli rules from rules_angular instead of the npm package directly

PR Close #62498
2025-07-07 15:26:37 +00:00
Paul Gschwendtner d7743144d3 refactor(compiler-cli): ensure mock file system can be loaded in the browser (#62493)
The mock file system currently relies on some NodeJS logic. This blocks
the convenient use of the mock file system in the browser. The file
system is useful for creating tests to verify e.g. that our transforms
can work in the browser.

PR Close #62493
2025-07-07 12:59:28 +02:00
Paul Gschwendtner 70deb1fe95 refactor: fix closure compatibility errors in compiler (#62493)
The static fields may be part of advanced compilations where the
receiver would change as part of the static field collapsing
optimization.

The optimization requires us to use the explicit class name, over
`this` that would change to e.g. `globalThis`.

PR Close #62493
2025-07-07 12:59:27 +02:00
Michael DeRazon da99b9ae3a docs: fix typo on guidelines file (#62468)
Correct a minor spelling mistake in the documentation to improve clarity.

PR Close #62468
2025-07-04 11:01:07 +00:00
Matthieu Riegler 2943591c27 docs: improve support for decorator APIs (#60411)
The commit introduce the distinction between

- class like decorators (like Component, Interface, NgModule. They are formatted like classes/interfaces, with each attribute being documents.
- function like decorators (Attribute, Host, Optional...)

PR Close #60411
2025-07-03 11:51:34 +00:00
Paul Gschwendtner fca058a8a1 refactor(migrations): ensure tsurge can properly emit references in g3 (#62447)
Currently when Tsurge runs in g3, it creates a bare bones Angular
compiler plugin. The tsconfigs from compilation units may set options
like "useHostForImportGeneration", but the Ngtsc logic doesn't enable
because the `fileNameToModuleName` method is not defined on the host.

This can break reference emission for Tsurge analyzers/programs and
result in subtle differences to real `ng_module` compilations. This
commit fixes this by making the method available in 1P Tsurge.

Notably, reference emission can occur during analysis— so even if
migrations aren't "emitting TS -> JS" output.

PR Close #62447
2025-07-03 09:36:18 +00:00
Matthieu Riegler cea42d0e6a docs(docs-infra): Load of the typing files from Angular. (#62424)
Following some infra changes, DTS files are now splitted over several files, which aren't referenced in the `package.json` but are directly imported in the root dts.

We chose to not use ATA here because it only pulls the latest version from a CDN whereas we prefer to use the local definitions we have in the `node_modules` of the tutorial.

fixes #62374

PR Close #62424
2025-07-03 09:35:37 +00:00
Jessica Janiuk f5f80d8ac2 ci: update pullapprove reviewers (#62448)
This sets some people to be reviewers, but not actively requested to account for availability.

PR Close #62448
2025-07-03 09:15:20 +00:00
Matthieu Riegler f5a10209e0 docs: display deprecation message for top most symbol (#62427)
For classes, types, functions, enums etc.

fixes #62365

PR Close #62427
2025-07-03 08:35:03 +00:00
Shuaib Hasan Akib 18816a6066 refactor(docs-infra): removed unused imports (#62441)
Cleans up instances of unused imports in a few shared docs components.

PR Close #62441
2025-07-03 08:11:46 +00:00
Shuaib Hasan Akib 7570dfd532 refactor(docs-infra): cleanup lines in scss (#62438)
Cleans up some of the scss code.

PR Close #62438
2025-07-03 08:11:10 +00:00
SkyZeroZx 6819c8b592 refactor(platform-browser): use RuntimeError for hydration feature conflicts (#62414)
Replace generic Error with RuntimeError

PR Close #62414
2025-07-03 08:08:08 +00:00
Angular Robot 026efb116e build: update cross-repo angular dependencies to v20.1.0-rc.0 (#62434)
See associated pull request for more information.

PR Close #62434
2025-07-03 07:47:39 +00:00
Paul Gschwendtner 87056c3b5d refactor(compiler-cli): do not rely on url when loading file system logic (#62431)
When executing the compiler-cli in the browser, or some parts of it—
modules like `url` are stubbed out with `{}`. This commit accounts for
this.

PR Close #62431
2025-07-02 17:05:28 +00:00
Paul Gschwendtner 827b9db370 refactor(compiler-cli): avoid eager typescript top-level usages (#62431)
For some internal refactorings, we want to avoid any direct top-level
`typescript` runtime usages. Usages that interact with `ts` after
synchronous module loading are fine.

More context in:
https://docs.google.com/document/d/1_h8AQRbM3LJrwIlUfGzGzxuwqFu0QI2-5eUTFI6gWws/edit?tab=t.0#heading=h.nunsebe2s3h0.

PR Close #62431
2025-07-02 17:05:28 +00:00
jstnjs d5210f0851 docs: fix formatting (#62400)
PR Close #62400
2025-07-02 16:56:26 +00:00
jstnjs 755b23af0b docs: fix dynamic form reactivity (#62400)
PR Close #62400
2025-07-02 16:56:26 +00:00
Shuaib Hasan Akib 59983efa82 docs(docs-infra): replace deprecated RouterTestingModule with RouterModule.forRoot([]) (#62364)
PR Close #62364
2025-07-02 16:52:32 +00:00
Joey Perrott d1d131a143 build: migrate devtools 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
Joey Perrott 0d5363a6d7 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 42a3dbbd53 docs: Update documentation httpResource with credentials option (#62415)
PR Close #62415
2025-07-02 14:49:09 +00:00
Kristiyan Kostadinov 56769de4d8 perf(core): move property remapping for dom properties to compiler (#62421)
Since we know that DOM properties won't go to an inputs, we can move the remapping logic to the compiler, saving us some processing on the client.

PR Close #62421
2025-07-02 14:28:12 +00:00
Milo cf508935f6 refactor(devtools): update signal body on change (#62410)
when the epoch of a signal changes, update the preview text

PR Close #62410
2025-07-02 14:27:27 +00:00
Angular Robot 743978576e build: update all non-major dependencies (#62420)
See associated pull request for more information.

PR Close #62420
2025-07-02 14:21:25 +00:00
Angular Robot 126204b16a build: update cross-repo angular dependencies (#62426)
See associated pull request for more information.

PR Close #62426
2025-07-02 11:45:34 +00:00
Jessica Janiuk 0dcf3094a4 Revert "fix(service-worker): update service worker to handle seeking better for videos (#60029)" (#62422)
This reverts commit c663277df6.

PR Close #62422
2025-07-02 07:50:16 +00:00
Angular Robot 1cc1500ee0 build: update cross-repo angular dependencies (#62408)
See associated pull request for more information.

PR Close #62408
2025-07-02 07:43:48 +00:00
Jessica Janiuk 41955cf92e release: cut the v20.1.0-rc.0 release 2025-07-01 19:03:03 +02:00
1039 changed files with 22721 additions and 37710 deletions
@@ -2,27 +2,31 @@
# Input hashes for repository rule npm_translate_lock(name = "npm2", pnpm_lock = "@//:pnpm-lock.yaml").
# This file should be checked into version control along with the pnpm-lock.yaml file.
.npmrc=-1406867100
.pnpmfile.cjs=-2033668682
.pnpmfile.cjs=-562808090
adev/package.json=-474177433
adev/shared-docs/package.json=735765359
adev/shared-docs/pipeline/api-gen/package.json=939673974
integration/package.json=-239561259
modules/package.json=-597456295
package.json=-1928784858
modules/package.json=1606257984
package.json=1522058443
packages/animations/package.json=-678724831
packages/benchpress/package.json=-1908328724
packages/common/package.json=1729763064
packages/compiler-cli/linker/babel/test/package.json=939673974
packages/compiler-cli/package.json=-660047565
packages/compiler-cli/package.json=1178475833
packages/compiler/package.json=1190056499
packages/core/package.json=1154833122
packages/core/test/bundling/package.json=-271224435
packages/core/test/bundling/package.json=-896235901
packages/elements/package.json=-892969618
packages/forms/package.json=-877154917
packages/localize/package.json=912913343
packages/localize/package.json=-1162087867
packages/platform-browser-dynamic/package.json=1901947880
packages/platform-browser/package.json=-1163479450
packages/platform-server/package.json=-737662753
packages/router/package.json=860819913
packages/upgrade/package.json=16347051
packages/zone.js/package.json=-1005735564
pnpm-lock.yaml=1416623477
pnpm-workspace.yaml=-375658197
pnpm-lock.yaml=1815008282
pnpm-workspace.yaml=1065599792
tools/bazel/rules_angular_store/package.json=-239561259
yarn.lock=-774434861
tools/pnpm-patches/dagre-d3-es+7.0.11.patch=-904066270
yarn.lock=1443296513
+4
View File
@@ -40,6 +40,8 @@ modules/ssr-benchmarks/node_modules
# For rules_js
adev/node_modules
adev/shared-docs/node_modules
adev/shared-docs/pipeline/api-gen/node_modules
modules/node_modules
integration/node_modules
@@ -51,8 +53,10 @@ packages/compiler-cli/linker/babel/test/node_modules
packages/compiler/node_modules
packages/core/node_modules
packages/core/test/bundling/node_modules
packages/elements/node_modules
packages/forms/node_modules
packages/platform-browser/node_modules
packages/platform-server/node_modules
packages/platform-browser-dynamic/node_modules
packages/router/node_modules
packages/zone.js/node_modules
+10
View File
@@ -0,0 +1,10 @@
have_fun: false
code_review:
disable: false
comment_severity_threshold: MEDIUM
max_review_comments: -1
pull_request_opened:
help: false
summary: false
code_review: false
ignore_patterns: []
+4 -5
View File
@@ -1,6 +1,4 @@
load("@aspect_rules_ts//ts:defs.bzl", rules_js_tsconfig = "ts_config")
load("//tools:defaults.bzl", "esbuild_checked_in")
load("//tools:defaults2.bzl", "ts_project")
load("//tools:defaults2.bzl", "esbuild_checked_in", "ts_config", "ts_project")
package(default_visibility = ["//.github/actions/deploy-docs-site:__subpackages__"])
@@ -10,6 +8,7 @@ exports_files([
esbuild_checked_in(
name = "main",
config = "esbuild.conf.js",
entry_point = ":lib/main.mts",
external = [
"undici",
@@ -18,11 +17,11 @@ esbuild_checked_in(
platform = "node",
target = "node20",
deps = [
":lib",
":lib_rjs",
],
)
rules_js_tsconfig(
ts_config(
name = "tsconfig",
src = "tsconfig.json",
)
@@ -0,0 +1,17 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/
module.exports = {
resolveExtensions: ['.mjs', '.js'],
format: 'esm',
banner: {
// Workaround for: https://github.com/evanw/esbuild/issues/946
js: `import {createRequire as __cjsCompatRequire} from 'module';
const require = __cjsCompatRequire(import.meta.url);`,
},
};
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -5,9 +5,9 @@ runs:
using: 'composite'
steps:
- name: Setup Bazel
uses: angular/dev-infra/github-actions/bazel/setup@dfe138678e4edb4789fbe40ae7792c046de3b4bd
uses: angular/dev-infra/github-actions/bazel/setup@39c70c3c8c63165bc2df0efc7dcb3b3287b69685
- name: Setup Saucelabs Variables
uses: angular/dev-infra/github-actions/saucelabs@dfe138678e4edb4789fbe40ae7792c046de3b4bd
uses: angular/dev-infra/github-actions/saucelabs@39c70c3c8c63165bc2df0efc7dcb3b3287b69685
- name: Starting Saucelabs tunnel service
shell: bash
run: ./tools/saucelabs/sauce-service.sh run &
+5 -5
View File
@@ -21,18 +21,18 @@ jobs:
(github.event.action == 'synchronize' && contains(github.event.pull_request.labels.*.name, 'adev: preview'))
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@dfe138678e4edb4789fbe40ae7792c046de3b4bd
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@39c70c3c8c63165bc2df0efc7dcb3b3287b69685
- name: Setup Bazel
uses: angular/dev-infra/github-actions/bazel/setup@dfe138678e4edb4789fbe40ae7792c046de3b4bd
uses: angular/dev-infra/github-actions/bazel/setup@39c70c3c8c63165bc2df0efc7dcb3b3287b69685
- name: Setup Bazel RBE
uses: angular/dev-infra/github-actions/bazel/configure-remote@dfe138678e4edb4789fbe40ae7792c046de3b4bd
uses: angular/dev-infra/github-actions/bazel/configure-remote@39c70c3c8c63165bc2df0efc7dcb3b3287b69685
- name: Install node modules
run: yarn install --frozen-lockfile
- name: Build adev to ensure it continues to work
run: yarn bazel build //adev:build --full_build_adev --config=release
- uses: angular/dev-infra/github-actions/previews/pack-and-upload-artifact@dfe138678e4edb4789fbe40ae7792c046de3b4bd
- uses: angular/dev-infra/github-actions/previews/pack-and-upload-artifact@39c70c3c8c63165bc2df0efc7dcb3b3287b69685
with:
workflow-artifact-name: 'adev-preview'
pull-number: '${{github.event.pull_request.number}}'
artifact-build-revision: '${{github.event.pull_request.head.sha}}'
deploy-directory: './dist/bin/adev/build/browser'
deploy-directory: './dist/bin/adev/dist/browser'
+1 -1
View File
@@ -40,7 +40,7 @@ jobs:
npx -y firebase-tools@latest target:clear --config adev/firebase.json --project ${{env.PREVIEW_PROJECT}} hosting angular-docs
npx -y firebase-tools@latest target:apply --config adev/firebase.json --project ${{env.PREVIEW_PROJECT}} hosting angular-docs ${{env.PREVIEW_SITE}}
- uses: angular/dev-infra/github-actions/previews/upload-artifacts-to-firebase@dfe138678e4edb4789fbe40ae7792c046de3b4bd
- uses: angular/dev-infra/github-actions/previews/upload-artifacts-to-firebase@39c70c3c8c63165bc2df0efc7dcb3b3287b69685
with:
github-token: '${{secrets.GITHUB_TOKEN}}'
workflow-artifact-name: 'adev-preview'
@@ -16,6 +16,6 @@ jobs:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
- uses: angular/dev-infra/github-actions/branch-manager@dfe138678e4edb4789fbe40ae7792c046de3b4bd
- uses: angular/dev-infra/github-actions/branch-manager@39c70c3c8c63165bc2df0efc7dcb3b3287b69685
with:
angular-robot-key: ${{ secrets.ANGULAR_ROBOT_PRIVATE_KEY }}
+1 -1
View File
@@ -38,7 +38,7 @@ jobs:
- uses: ./.github/actions/yarn-install
- uses: angular/dev-infra/github-actions/bazel/configure-remote@dfe138678e4edb4789fbe40ae7792c046de3b4bd
- uses: angular/dev-infra/github-actions/bazel/configure-remote@39c70c3c8c63165bc2df0efc7dcb3b3287b69685
with:
bazelrc: ./.bazelrc.user
+25 -25
View File
@@ -21,7 +21,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@dfe138678e4edb4789fbe40ae7792c046de3b4bd
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@39c70c3c8c63165bc2df0efc7dcb3b3287b69685
with:
cache-node-modules: true
- name: Install node modules
@@ -41,13 +41,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@dfe138678e4edb4789fbe40ae7792c046de3b4bd
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@39c70c3c8c63165bc2df0efc7dcb3b3287b69685
with:
cache-node-modules: true
- name: Setup Bazel
uses: angular/dev-infra/github-actions/bazel/setup@dfe138678e4edb4789fbe40ae7792c046de3b4bd
uses: angular/dev-infra/github-actions/bazel/setup@39c70c3c8c63165bc2df0efc7dcb3b3287b69685
- name: Setup Bazel RBE
uses: angular/dev-infra/github-actions/bazel/configure-remote@dfe138678e4edb4789fbe40ae7792c046de3b4bd
uses: angular/dev-infra/github-actions/bazel/configure-remote@39c70c3c8c63165bc2df0efc7dcb3b3287b69685
with:
google_credential: ${{ secrets.RBE_TRUSTED_BUILDS_USER }}
- name: Install node modules
@@ -61,13 +61,13 @@ jobs:
runs-on: ubuntu-latest-4core
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@dfe138678e4edb4789fbe40ae7792c046de3b4bd
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@39c70c3c8c63165bc2df0efc7dcb3b3287b69685
with:
cache-node-modules: true
- name: Setup Bazel
uses: angular/dev-infra/github-actions/bazel/setup@dfe138678e4edb4789fbe40ae7792c046de3b4bd
uses: angular/dev-infra/github-actions/bazel/setup@39c70c3c8c63165bc2df0efc7dcb3b3287b69685
- name: Setup Bazel Remote Caching
uses: angular/dev-infra/github-actions/bazel/configure-remote@dfe138678e4edb4789fbe40ae7792c046de3b4bd
uses: angular/dev-infra/github-actions/bazel/configure-remote@39c70c3c8c63165bc2df0efc7dcb3b3287b69685
with:
google_credential: ${{ secrets.RBE_TRUSTED_BUILDS_USER }}
- name: Install node modules
@@ -79,13 +79,13 @@ jobs:
runs-on: ubuntu-latest-4core
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@dfe138678e4edb4789fbe40ae7792c046de3b4bd
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@39c70c3c8c63165bc2df0efc7dcb3b3287b69685
with:
cache-node-modules: true
- name: Setup Bazel
uses: angular/dev-infra/github-actions/bazel/setup@dfe138678e4edb4789fbe40ae7792c046de3b4bd
uses: angular/dev-infra/github-actions/bazel/setup@39c70c3c8c63165bc2df0efc7dcb3b3287b69685
- name: Setup Bazel Remote Caching
uses: angular/dev-infra/github-actions/bazel/configure-remote@dfe138678e4edb4789fbe40ae7792c046de3b4bd
uses: angular/dev-infra/github-actions/bazel/configure-remote@39c70c3c8c63165bc2df0efc7dcb3b3287b69685
with:
google_credential: ${{ secrets.RBE_TRUSTED_BUILDS_USER }}
- name: Install node modules
@@ -98,11 +98,11 @@ jobs:
labels: ubuntu-latest-4core
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@dfe138678e4edb4789fbe40ae7792c046de3b4bd
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@39c70c3c8c63165bc2df0efc7dcb3b3287b69685
- name: Setup Bazel
uses: angular/dev-infra/github-actions/bazel/setup@dfe138678e4edb4789fbe40ae7792c046de3b4bd
uses: angular/dev-infra/github-actions/bazel/setup@39c70c3c8c63165bc2df0efc7dcb3b3287b69685
- name: Setup Bazel RBE
uses: angular/dev-infra/github-actions/bazel/configure-remote@dfe138678e4edb4789fbe40ae7792c046de3b4bd
uses: angular/dev-infra/github-actions/bazel/configure-remote@39c70c3c8c63165bc2df0efc7dcb3b3287b69685
with:
google_credential: ${{ secrets.RBE_TRUSTED_BUILDS_USER }}
- name: Install node modules
@@ -117,13 +117,13 @@ jobs:
labels: ubuntu-latest
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@dfe138678e4edb4789fbe40ae7792c046de3b4bd
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@39c70c3c8c63165bc2df0efc7dcb3b3287b69685
with:
cache-node-modules: true
- name: Setup Bazel
uses: angular/dev-infra/github-actions/bazel/setup@dfe138678e4edb4789fbe40ae7792c046de3b4bd
uses: angular/dev-infra/github-actions/bazel/setup@39c70c3c8c63165bc2df0efc7dcb3b3287b69685
- name: Setup Bazel RBE
uses: angular/dev-infra/github-actions/bazel/configure-remote@dfe138678e4edb4789fbe40ae7792c046de3b4bd
uses: angular/dev-infra/github-actions/bazel/configure-remote@39c70c3c8c63165bc2df0efc7dcb3b3287b69685
- name: Install node modules
run: yarn install --frozen-lockfile
- run: echo "https://${{secrets.SNAPSHOT_BUILDS_GITHUB_TOKEN}}:@github.com" > ${HOME}/.git_credentials
@@ -135,7 +135,7 @@ jobs:
labels: ubuntu-latest-4core
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@dfe138678e4edb4789fbe40ae7792c046de3b4bd
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@39c70c3c8c63165bc2df0efc7dcb3b3287b69685
with:
cache-node-modules: true
node-module-directories: |
@@ -143,9 +143,9 @@ jobs:
./packages/zone.js/node_modules
./packages/zone.js/test/typings/node_modules
- name: Setup Bazel
uses: angular/dev-infra/github-actions/bazel/setup@dfe138678e4edb4789fbe40ae7792c046de3b4bd
uses: angular/dev-infra/github-actions/bazel/setup@39c70c3c8c63165bc2df0efc7dcb3b3287b69685
- name: Setup Bazel RBE
uses: angular/dev-infra/github-actions/bazel/configure-remote@dfe138678e4edb4789fbe40ae7792c046de3b4bd
uses: angular/dev-infra/github-actions/bazel/configure-remote@39c70c3c8c63165bc2df0efc7dcb3b3287b69685
with:
google_credential: ${{ secrets.RBE_TRUSTED_BUILDS_USER }}
- name: Install node modules
@@ -154,7 +154,7 @@ jobs:
yarn bazel build \
//packages/zone.js/bundles:zone.umd.js \
//packages/zone.js:npm_package \
//packages/zone.js/test/closure:closure_js \
//packages/zone.js/test/closure:closure_rjs
- run: |
rm -Rf packages/zone.js/build
@@ -166,7 +166,7 @@ jobs:
cp dist/bin/packages/zone.js/bundles/zone.umd.js packages/zone.js/build/zone.umd.js
cp dist/bin/packages/zone.js/npm_package/bundles/zone-mix.umd.js ./packages/zone.js/test/extra/
cp dist/bin/packages/zone.js/npm_package/bundles/zone-patch-electron.umd.js ./packages/zone.js/test/extra/
cp dist/bin/packages/zone.js/test/closure/zone.closure.mjs ./packages/zone.js/build/test/zone.closure.mjs
cp dist/bin/packages/zone.js/test/closure/zone.closure.js ./packages/zone.js/build/test/zone.closure.mjs
# Install
- run: yarn --cwd packages/zone.js install --frozen-lockfile --non-interactive
@@ -198,11 +198,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@dfe138678e4edb4789fbe40ae7792c046de3b4bd
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@39c70c3c8c63165bc2df0efc7dcb3b3287b69685
- name: Setup Bazel
uses: angular/dev-infra/github-actions/bazel/setup@dfe138678e4edb4789fbe40ae7792c046de3b4bd
uses: angular/dev-infra/github-actions/bazel/setup@39c70c3c8c63165bc2df0efc7dcb3b3287b69685
- name: Setup Bazel RBE
uses: angular/dev-infra/github-actions/bazel/configure-remote@dfe138678e4edb4789fbe40ae7792c046de3b4bd
uses: angular/dev-infra/github-actions/bazel/configure-remote@39c70c3c8c63165bc2df0efc7dcb3b3287b69685
- name: Install node modules
run: yarn install --frozen-lockfile
- name: Build adev to ensure it continues to work
@@ -213,4 +213,4 @@ jobs:
serviceKey: ${{ secrets.ANGULAR_DEV_SITE_DEPLOY }}
githubReleaseTrainReadToken: ${{ secrets.DOCS_DEPLOY_GITHUB_RELEASE_TRAIN_TOKEN }}
configPath: 'adev/firebase.json'
distDir: 'dist/bin/adev/build/browser'
distDir: 'dist/bin/adev/dist/browser'
+2 -2
View File
@@ -13,13 +13,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: angular/dev-infra/github-actions/pull-request-labeling@dfe138678e4edb4789fbe40ae7792c046de3b4bd
- uses: angular/dev-infra/github-actions/pull-request-labeling@39c70c3c8c63165bc2df0efc7dcb3b3287b69685
with:
angular-robot-key: ${{ secrets.ANGULAR_ROBOT_PRIVATE_KEY }}
post_approval_changes:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: angular/dev-infra/github-actions/post-approval-changes@dfe138678e4edb4789fbe40ae7792c046de3b4bd
- uses: angular/dev-infra/github-actions/post-approval-changes@39c70c3c8c63165bc2df0efc7dcb3b3287b69685
with:
angular-robot-key: ${{ secrets.ANGULAR_ROBOT_PRIVATE_KEY }}
+1 -1
View File
@@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: angular/dev-infra/github-actions/google-internal-tests@dfe138678e4edb4789fbe40ae7792c046de3b4bd
- uses: angular/dev-infra/github-actions/google-internal-tests@39c70c3c8c63165bc2df0efc7dcb3b3287b69685
with:
run-tests-guide-url: http://go/angular-g3sync-start
github-token: ${{ secrets.GITHUB_TOKEN }}
+4 -4
View File
@@ -13,17 +13,17 @@ jobs:
JOBS: 2
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@dfe138678e4edb4789fbe40ae7792c046de3b4bd
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@39c70c3c8c63165bc2df0efc7dcb3b3287b69685
with:
cache-node-modules: true
- name: Install node modules
run: yarn install --frozen-lockfile
- name: Setup Bazel
uses: angular/dev-infra/github-actions/bazel/setup@dfe138678e4edb4789fbe40ae7792c046de3b4bd
uses: angular/dev-infra/github-actions/bazel/setup@39c70c3c8c63165bc2df0efc7dcb3b3287b69685
- name: Setup Bazel Remote Caching
uses: angular/dev-infra/github-actions/bazel/configure-remote@dfe138678e4edb4789fbe40ae7792c046de3b4bd
uses: angular/dev-infra/github-actions/bazel/configure-remote@39c70c3c8c63165bc2df0efc7dcb3b3287b69685
- name: Setup Saucelabs Variables
uses: angular/dev-infra/github-actions/saucelabs@dfe138678e4edb4789fbe40ae7792c046de3b4bd
uses: angular/dev-infra/github-actions/saucelabs@39c70c3c8c63165bc2df0efc7dcb3b3287b69685
- name: Set up Sauce Tunnel Daemon
run: yarn bazel run //tools/saucelabs-daemon/background-service -- $JOBS &
env:
+1 -1
View File
@@ -9,6 +9,6 @@ jobs:
status:
runs-on: ubuntu-latest
steps:
- uses: angular/dev-infra/github-actions/unified-status-check@dfe138678e4edb4789fbe40ae7792c046de3b4bd
- uses: angular/dev-infra/github-actions/unified-status-check@39c70c3c8c63165bc2df0efc7dcb3b3287b69685
with:
angular-robot-key: ${{ secrets.ANGULAR_ROBOT_PRIVATE_KEY }}
+3 -3
View File
@@ -21,7 +21,7 @@ jobs:
workflows: ${{ steps.workflows.outputs.workflows }}
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@dfe138678e4edb4789fbe40ae7792c046de3b4bd
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@39c70c3c8c63165bc2df0efc7dcb3b3287b69685
- name: Install node modules
run: yarn -s install --frozen-lockfile
- id: workflows
@@ -36,9 +36,9 @@ jobs:
workflow: ${{ fromJSON(needs.list.outputs.workflows) }}
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@dfe138678e4edb4789fbe40ae7792c046de3b4bd
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@39c70c3c8c63165bc2df0efc7dcb3b3287b69685
- name: Setup Bazel
uses: angular/dev-infra/github-actions/bazel/setup@dfe138678e4edb4789fbe40ae7792c046de3b4bd
uses: angular/dev-infra/github-actions/bazel/setup@39c70c3c8c63165bc2df0efc7dcb3b3287b69685
- name: Install node modules
run: yarn -s install --frozen-lockfile
# We utilize the google-github-actions/auth action to allow us to get an active credential using workflow
+19 -19
View File
@@ -19,7 +19,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@dfe138678e4edb4789fbe40ae7792c046de3b4bd
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@39c70c3c8c63165bc2df0efc7dcb3b3287b69685
with:
cache-node-modules: true
- name: Install node modules
@@ -39,7 +39,7 @@ jobs:
- name: Check code format
run: yarn ng-dev format changed --check ${{ github.event.pull_request.base.sha }}
- name: Check Package Licenses
uses: angular/dev-infra/github-actions/linting/licenses@dfe138678e4edb4789fbe40ae7792c046de3b4bd
uses: angular/dev-infra/github-actions/linting/licenses@39c70c3c8c63165bc2df0efc7dcb3b3287b69685
with:
allow-dependencies-licenses: 'pkg:npm/google-protobuf@'
@@ -47,13 +47,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@dfe138678e4edb4789fbe40ae7792c046de3b4bd
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@39c70c3c8c63165bc2df0efc7dcb3b3287b69685
with:
cache-node-modules: true
- name: Setup Bazel
uses: angular/dev-infra/github-actions/bazel/setup@dfe138678e4edb4789fbe40ae7792c046de3b4bd
uses: angular/dev-infra/github-actions/bazel/setup@39c70c3c8c63165bc2df0efc7dcb3b3287b69685
- name: Setup Bazel RBE
uses: angular/dev-infra/github-actions/bazel/configure-remote@dfe138678e4edb4789fbe40ae7792c046de3b4bd
uses: angular/dev-infra/github-actions/bazel/configure-remote@39c70c3c8c63165bc2df0efc7dcb3b3287b69685
- name: Install node modules
run: yarn install --frozen-lockfile
- name: Run unit tests
@@ -65,13 +65,13 @@ jobs:
runs-on: ubuntu-latest-8core
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@dfe138678e4edb4789fbe40ae7792c046de3b4bd
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@39c70c3c8c63165bc2df0efc7dcb3b3287b69685
with:
cache-node-modules: true
- name: Setup Bazel
uses: angular/dev-infra/github-actions/bazel/setup@dfe138678e4edb4789fbe40ae7792c046de3b4bd
uses: angular/dev-infra/github-actions/bazel/setup@39c70c3c8c63165bc2df0efc7dcb3b3287b69685
- name: Setup Bazel Remote Caching
uses: angular/dev-infra/github-actions/bazel/configure-remote@dfe138678e4edb4789fbe40ae7792c046de3b4bd
uses: angular/dev-infra/github-actions/bazel/configure-remote@39c70c3c8c63165bc2df0efc7dcb3b3287b69685
- name: Install node modules
run: yarn install --frozen-lockfile --network-timeout 100000
- name: Run CI tests for framework
@@ -91,13 +91,13 @@ jobs:
runs-on: ubuntu-latest-4core
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@dfe138678e4edb4789fbe40ae7792c046de3b4bd
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@39c70c3c8c63165bc2df0efc7dcb3b3287b69685
with:
cache-node-modules: true
- name: Setup Bazel
uses: angular/dev-infra/github-actions/bazel/setup@dfe138678e4edb4789fbe40ae7792c046de3b4bd
uses: angular/dev-infra/github-actions/bazel/setup@39c70c3c8c63165bc2df0efc7dcb3b3287b69685
- name: Setup Bazel Remote Caching
uses: angular/dev-infra/github-actions/bazel/configure-remote@dfe138678e4edb4789fbe40ae7792c046de3b4bd
uses: angular/dev-infra/github-actions/bazel/configure-remote@39c70c3c8c63165bc2df0efc7dcb3b3287b69685
- name: Install node modules
run: yarn install --frozen-lockfile --network-timeout 100000
- name: Run integration CI tests for framework
@@ -108,11 +108,11 @@ jobs:
labels: ubuntu-latest-8core
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@dfe138678e4edb4789fbe40ae7792c046de3b4bd
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@39c70c3c8c63165bc2df0efc7dcb3b3287b69685
- name: Setup Bazel
uses: angular/dev-infra/github-actions/bazel/setup@dfe138678e4edb4789fbe40ae7792c046de3b4bd
uses: angular/dev-infra/github-actions/bazel/setup@39c70c3c8c63165bc2df0efc7dcb3b3287b69685
- name: Setup Bazel RBE
uses: angular/dev-infra/github-actions/bazel/configure-remote@dfe138678e4edb4789fbe40ae7792c046de3b4bd
uses: angular/dev-infra/github-actions/bazel/configure-remote@39c70c3c8c63165bc2df0efc7dcb3b3287b69685
- name: Install node modules
run: yarn install --frozen-lockfile
- name: Run tests
@@ -125,7 +125,7 @@ jobs:
labels: ubuntu-latest-4core
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@dfe138678e4edb4789fbe40ae7792c046de3b4bd
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@39c70c3c8c63165bc2df0efc7dcb3b3287b69685
with:
cache-node-modules: true
node-module-directories: |
@@ -133,16 +133,16 @@ jobs:
./packages/zone.js/node_modules
./packages/zone.js/test/typings/node_modules
- name: Setup Bazel
uses: angular/dev-infra/github-actions/bazel/setup@dfe138678e4edb4789fbe40ae7792c046de3b4bd
uses: angular/dev-infra/github-actions/bazel/setup@39c70c3c8c63165bc2df0efc7dcb3b3287b69685
- name: Setup Bazel RBE
uses: angular/dev-infra/github-actions/bazel/configure-remote@dfe138678e4edb4789fbe40ae7792c046de3b4bd
uses: angular/dev-infra/github-actions/bazel/configure-remote@39c70c3c8c63165bc2df0efc7dcb3b3287b69685
- name: Install node modules
run: yarn install --frozen-lockfile
- run: |
yarn bazel build \
//packages/zone.js/bundles:zone.umd.js \
//packages/zone.js:npm_package \
//packages/zone.js/test/closure:closure_js \
//packages/zone.js/test/closure:closure_rjs
- run: |
rm -Rf packages/zone.js/build
@@ -154,7 +154,7 @@ jobs:
cp dist/bin/packages/zone.js/bundles/zone.umd.js packages/zone.js/build/zone.umd.js
cp dist/bin/packages/zone.js/npm_package/bundles/zone-mix.umd.js ./packages/zone.js/test/extra/
cp dist/bin/packages/zone.js/npm_package/bundles/zone-patch-electron.umd.js ./packages/zone.js/test/extra/
cp dist/bin/packages/zone.js/test/closure/zone.closure.mjs ./packages/zone.js/build/test/zone.closure.mjs
cp dist/bin/packages/zone.js/test/closure/zone.closure.js ./packages/zone.js/build/test/zone.closure.mjs
# Install
- run: yarn --cwd packages/zone.js install --frozen-lockfile --non-interactive
+1 -1
View File
@@ -47,6 +47,6 @@ jobs:
# Upload the results to GitHub's code scanning dashboard.
- name: 'Upload to code-scanning'
uses: github/codeql-action/upload-sarif@181d5eefc20863364f96762470ba6f862bdef56b # v3.29.2
uses: github/codeql-action/upload-sarif@51f77329afa6477de8c49fc9c7046c15b9a4e79d # v3.29.5
with:
sarif_file: results.sarif
+2 -2
View File
@@ -7,9 +7,9 @@ export const format: FormatConfig = {
'prettier': {
'matchers': [
'**/*.{yaml,yml}',
'**/*.{js,ts,mjs,mts,cjs,cts}',
'**/*.{js,ts,mjs,mts,cjs,cts,tsx}',
'devtools/**/*.{js,ts,mjs,mts,cjs,cts,html,scss}',
'integration/**/size.json',
// Do not format d.ts files as they are generated
'!**/*.d.ts',
// Both third_party and .yarn are directories containing copied code which should
+1 -1
View File
@@ -1 +1 @@
22.17.0
22.17.1
+29
View File
@@ -8,6 +8,15 @@ function readPackage(pkg, context) {
// are resolved via these locally-built versions. e.g. compiler-cli's peer deps.
'@angular/compiler': 'workspace:*',
'@angular/compiler-cli': 'workspace:*',
'@angular/core': 'workspace:*',
'@angular/common': 'workspace:*',
'@angular/router': 'workspace:*',
'@angular/platform-browser': 'workspace:*',
'@angular/platform-browser-dynamic': 'workspace:*',
'@angular/platform-server': 'workspace:*',
'@angular/forms': 'workspace:*',
'@angular/elements': 'workspace:*',
'@angular/animations': 'workspace:*',
};
}
@@ -22,6 +31,26 @@ function readPackage(pkg, context) {
};
}
Object.entries(pkg.peerDependencies).forEach(([key, version]) => {
// Any package that has a peerDependency on rxjs or zone.js, should instead treat the peerDependency as a
// regular dependency.
if (['rxjs', 'zone.js'].includes(key)) {
pkg.dependencies = {
...pkg.dependencies,
[key]: version,
};
}
// Change all locally generated packages to directly depend on the other local packages, instead
// of expecting them as peerDependencies automatically as we do not auto install peer deps.
if (version === '0.0.0-PLACEHOLDER') {
pkg.dependencies = {
...pkg.dependencies,
[key]: 'workspace: *',
};
}
});
return pkg;
}
+20 -19
View File
@@ -126,7 +126,7 @@ groups:
])
reviewers:
users:
- alxhub
- ~alxhub
- AndrewKushnir
- atscott
- crisbeto
@@ -167,7 +167,7 @@ groups:
])
reviewers:
users:
- alxhub
- ~alxhub
- AndrewKushnir
- atscott
- crisbeto
@@ -175,7 +175,7 @@ groups:
- kirjs
- ~jelbourn
- thePunderWoman
- pkozlowski-opensource
- ~pkozlowski-opensource
- mmalerba
# =========================================================
@@ -198,10 +198,10 @@ groups:
])
reviewers:
users:
- alxhub
- ~alxhub
- jelbourn
- josephperrott
- pkozlowski-opensource
- ~pkozlowski-opensource
reviews:
request: -1 # request reviews from everyone
required: 2 # require at least 2 approvals
@@ -221,14 +221,14 @@ groups:
users:
- ~JiaLiPassion
- ~jelbourn
- alxhub
- ~alxhub
- AndrewKushnir
- atscott
- crisbeto
- devversion
- kirjs
- thePunderWoman
- pkozlowski-opensource
- ~pkozlowski-opensource
- mmalerba
# =========================================================
@@ -267,7 +267,7 @@ groups:
reviewers:
users:
- alan-agius4
- alxhub
- ~alxhub
- AndrewKushnir
- atscott
- bencodezen
@@ -278,10 +278,9 @@ groups:
- thePunderWoman
- devversion
- josephperrott
- pkozlowski-opensource
- ~pkozlowski-opensource
- mgechev
- MarkTechson
- kirjs
- mmalerba
- ~hawkgs
@@ -318,6 +317,7 @@ groups:
'.devcontainer/**/{*,.*}',
'.github/**/{*,.*}',
'.husky/**/{*,.*}',
'.gemini/**/{*,.*}',
'.ng-dev/**/{*,.*}',
'.vscode/**/{*,.*}',
'.yarn/**/{*,.*}',
@@ -334,7 +334,6 @@ groups:
'third_party/**/{*,.*}',
'tools/bazel-repo-patches/**/{*,.*}',
'tools/contributing-stats/**/{*,.*}',
'tools/esm-interop/**/{*,.*}',
'tools/gulp-tasks/**/{*,.*}',
'tools/legacy-saucelabs/**/{*,.*}',
'tools/manual_api_docs/**/{*,.*}',
@@ -367,6 +366,7 @@ groups:
users:
- ~alan-agius4
teams:
- angular-caretaker
- framework-team
# =========================================================
@@ -384,15 +384,16 @@ groups:
reviewers:
users:
- AndrewKushnir
- alxhub
- ~alxhub
- atscott
- ~jelbourn
- thePunderWoman
- pkozlowski-opensource
- ~pkozlowski-opensource
- kirjs
- mmalerba
- crisbeto
- devversion
- JeanMeche
- ~jkrems
- ~iteriani
- ~tbondwilkinson
@@ -412,17 +413,17 @@ groups:
- *no-groups-above-this-rejected
- >
contains_any_globs(files, [
'goldens/size-tracking/**/{*,.*}'
'integration/**/size.json'
])
reviewers:
users:
- alxhub
- ~alxhub
- AndrewKushnir
- atscott
- kirjs
- ~jelbourn
- thePunderWoman
- pkozlowski-opensource
- ~pkozlowski-opensource
- mmalerba
reviews:
request: 2 # Request reviews from 2 people
@@ -445,7 +446,7 @@ groups:
])
reviewers:
users:
- alxhub
- ~alxhub
- AndrewKushnir
- andrewseguin
- dgp1130
@@ -467,8 +468,8 @@ groups:
])
reviewers:
users:
- pkozlowski-opensource # Pawel Kozlowski
- alxhub # Alex Rickabaugh
- ~pkozlowski-opensource # Pawel Kozlowski
- ~alxhub # Alex Rickabaugh
- thePunderWoman # Jessica Janiuk
- AndrewKushnir # Andrew Kushnir
- atscott # Andrew Scott
+3 -7
View File
@@ -1,8 +1,7 @@
load("@aspect_bazel_lib//lib:copy_to_bin.bzl", "copy_to_bin")
load("@build_bazel_rules_nodejs//:index.bzl", "js_library")
load("@aspect_rules_js//js:defs.bzl", "js_library")
load("@npm2//:defs.bzl", "npm_link_all_packages")
load("//:yarn.bzl", "YARN_PATH")
load("//tools:defaults.bzl", "nodejs_binary")
load("//tools:defaults2.bzl", "copy_to_bin", "js_binary")
package(default_visibility = ["//visibility:public"])
@@ -11,9 +10,6 @@ exports_files([
"karma-js.conf.js",
"browser-providers.conf.js",
YARN_PATH,
"scripts/ci/bazel-payload-size.sh",
"scripts/ci/payload-size.sh",
"scripts/ci/payload-size.js",
"package.json",
"angular.json",
])
@@ -64,7 +60,7 @@ config_setting(
values = {"stamp": "true"},
)
nodejs_binary(
js_binary(
name = "yarn_vendored",
data = [".yarn/releases/yarn-1.22.22.cjs"],
entry_point = ".yarn/releases/yarn-1.22.22.cjs",
+110 -89
View File
@@ -1,45 +1,143 @@
<a name="20.0.6"></a>
# 20.0.6 (2025-07-01)
<a name="20.1.4"></a>
# 20.1.4 (2025-07-31)
### compiler
| Commit | Type | Description |
| -- | -- | -- |
| [db3c5826ee](https://github.com/angular/angular/commit/db3c5826ee0b52e5b7886087b82990340a34c1ab) | fix | exclude more safe reads expression from 2way-binding ([#62852](https://github.com/angular/angular/pull/62852)) |
### core
| Commit | Type | Description |
| -- | -- | -- |
| [c633b63e56](https://github.com/angular/angular/commit/c633b63e561d7142dd9a1f8631813cc47a169058) | fix | update symbols for new signals api ([#62284](https://github.com/angular/angular/pull/62284)) |
### http
| Commit | Type | Description |
| -- | -- | -- |
| [ab6033979a](https://github.com/angular/angular/commit/ab6033979a3b409738d55d0c01effb378473c05a) | fix | add missing http options allowed in fetch API ([#62881](https://github.com/angular/angular/pull/62881)) |
| [15670d8417](https://github.com/angular/angular/commit/15670d8417449c5b5f2990209552a1fc61420acb) | fix | propagate plain errors when parsing fails ([#62765](https://github.com/angular/angular/pull/62765)) |
<!-- CHANGELOG SPLIT MARKER -->
<a name="20.1.0-next.3"></a>
# 20.1.0-next.3 (2025-06-25)
<a name="20.1.3"></a>
# 20.1.3 (2025-07-23)
### core
| Commit | Type | Description |
| -- | -- | -- |
| [2c522efbe5](https://github.com/angular/angular/commit/2c522efbe500e7c6c9929ce76df435b3dae49c84) | fix | fix change tracking for Resource#hasValue ([#62595](https://github.com/angular/angular/pull/62595)) |
### platform-browser
| Commit | Type | Description |
| -- | -- | -- |
| [2fd1f7beb5](https://github.com/angular/angular/commit/2fd1f7beb5e524aea8dcb24c5b87cb81689363ba) | fix | resolve component resources before bootstrapping in JIT mode ([#62758](https://github.com/angular/angular/pull/62758)) |
<!-- CHANGELOG SPLIT MARKER -->
<a name="20.1.2"></a>
# 20.1.2 (2025-07-17)
### compiler
| Commit | Type | Description |
| -- | -- | -- |
| [8ad10fd63b](https://github.com/angular/angular/commit/8ad10fd63b01a906efbfa50ccccb7914610c61bd) | fix | fix detection of directive deps in JIT ([#62666](https://github.com/angular/angular/pull/62666)) |
<!-- CHANGELOG SPLIT MARKER -->
<a name="20.1.1"></a>
# 20.1.1 (2025-07-16)
### compiler
| Commit | Type | Description |
| -- | -- | -- |
| [75d2a349b4](https://github.com/angular/angular/commit/75d2a349b4d0ee1ed0489f1804dc1938046eaace) | fix | incorrect spans for left side of binary operation ([#62641](https://github.com/angular/angular/pull/62641)) |
| [70c8780c54](https://github.com/angular/angular/commit/70c8780c5443929539631a06c5e09c18d108e51b) | fix | more permissive parsing of @ characters ([#62644](https://github.com/angular/angular/pull/62644)) |
### compiler-cli
| Commit | Type | Description |
| -- | -- | -- |
| [9506cdfaad](https://github.com/angular/angular/commit/9506cdfaad2693a0350a74f4ee4bb7fa27fa3086) | fix | infer type of event target for void elements ([#62648](https://github.com/angular/angular/pull/62648)) |
### core
| Commit | Type | Description |
| -- | -- | -- |
| [26ade4a337](https://github.com/angular/angular/commit/26ade4a3370911f6c8e9c0e6504d9335d637cfe1) | fix | Ensure application remains unstable during bootstrap ([#62631](https://github.com/angular/angular/pull/62631)) |
| [a81f0faa1a](https://github.com/angular/angular/commit/a81f0faa1a72decf9bdd35b243486a510b9352ee) | fix | InputBinding marks component a dirty. ([#62613](https://github.com/angular/angular/pull/62613)) |
### http
| Commit | Type | Description |
| -- | -- | -- |
| [276836ee73](https://github.com/angular/angular/commit/276836ee7351c5d605fac5dc0abe0ae898dcfa5d) | fix | do not display warnings `Angular detected that a `HttpClient` request with the `keepalive` option was sent using XHR` when option is not true ([#62536](https://github.com/angular/angular/pull/62536)) |
### router
| Commit | Type | Description |
| -- | -- | -- |
| [5949373692](https://github.com/angular/angular/commit/59493736925d27ca26f0bb041978a51c4ced975b) | fix | handle errors from view transition readiness ([#62535](https://github.com/angular/angular/pull/62535)) |
<!-- CHANGELOG SPLIT MARKER -->
<a name="20.1.0"></a>
# 20.1.0 (2025-07-09)
### common
| Commit | Type | Description |
| -- | -- | -- |
| [58aedc37d1](https://github.com/angular/angular/commit/58aedc37d10208ca40c1b1d4468261dd9aba5356) | feat | add support for a custom EnvironmentInjector to NgComponentOutlet directive ([#54764](https://github.com/angular/angular/pull/54764)) |
| [ef10aa4005](https://github.com/angular/angular/commit/ef10aa400585fb66e1afde08be0f9fd9a70ce7f2) | feat | support decoding in NgOptimizedImage ([#61905](https://github.com/angular/angular/pull/61905)) |
### compiler
| Commit | Type | Description |
| -- | -- | -- |
| [0dcf230d52](https://github.com/angular/angular/commit/0dcf230d52694e6d3d6e55d6e675d55f9cf236bc) | feat | add support for new binary assignment operators ([#62064](https://github.com/angular/angular/pull/62064)) |
| [5a76826d26](https://github.com/angular/angular/commit/5a76826d266b4ed0ef863221571e4b6b1b16182f) | fix | only report parser errors on invalid expression ([#61793](https://github.com/angular/angular/pull/61793)) |
| [089ad0ee15](https://github.com/angular/angular/commit/089ad0ee15d6be9b2493bb67519cb59e0454a1ef) | fix | produce more accurate errors for interpolations ([#62258](https://github.com/angular/angular/pull/62258)) |
| [e9fcbb8af1](https://github.com/angular/angular/commit/e9fcbb8af12e7b4370d2e03e6004f3f2fe02c981) | fix | remove TypeScript from linker ([#61618](https://github.com/angular/angular/pull/61618)) |
### compiler-cli
| Commit | Type | Description |
| -- | -- | -- |
| [ed5062a91c](https://github.com/angular/angular/commit/ed5062a91cbd96c078736cc354925de15496aa57) | fix | add suggestion when pipe is missing ([#62146](https://github.com/angular/angular/pull/62146)) |
| [d25a6a0120](https://github.com/angular/angular/commit/d25a6a0120b111f3ddbd701d5a67a8baefd2ca0e) | fix | handle initializer APIs wrapped in type casts ([#62203](https://github.com/angular/angular/pull/62203)) |
| [e62fb359d6](https://github.com/angular/angular/commit/e62fb359d6da8e0458b18f24e6bff60602f93fc6) | feat | add experimental support for fast type declaration emission ([#61334](https://github.com/angular/angular/pull/61334)) |
| [0cf1001715](https://github.com/angular/angular/commit/0cf1001715d2f528c61735108d12e29047907d98) | feat | support host directives with direct external references in fast type declaration emission ([#61469](https://github.com/angular/angular/pull/61469)) |
| [b7ab5fa256](https://github.com/angular/angular/commit/b7ab5fa2562524a0e8dfa4f3dff740ec2d31b4c7) | fix | add signal checks to handle negated calls ([#59970](https://github.com/angular/angular/pull/59970)) |
| [77fa204ad1](https://github.com/angular/angular/commit/77fa204ad16fef561c009fcef0ab1fb92a37f986) | fix | rename flag for enabling fast type declaration emission ([#61353](https://github.com/angular/angular/pull/61353)) |
| [c439d6938d](https://github.com/angular/angular/commit/c439d6938de60cb132f7ae4d305efa5b3d853e36) | fix | symbol builder duplicating host directives ([#61240](https://github.com/angular/angular/pull/61240)) |
| [3e1baa5a95](https://github.com/angular/angular/commit/3e1baa5a9565f4930507cdf338e6f9ea7e8702a3) | fix | typo in NG2026 message ([#61325](https://github.com/angular/angular/pull/61325)) |
### core
| Commit | Type | Description |
| -- | -- | -- |
| [8163a8995e](https://github.com/angular/angular/commit/8163a8995e36bbce74e3d852613c19e56027cc24) | feat | Add `destroyed` property on `DestroyRef` ([#61849](https://github.com/angular/angular/pull/61849)) |
| [737b35b684](https://github.com/angular/angular/commit/737b35b684663bb641939f05ae12fa11b3395159) | feat | Add `destroyed` property to `EnvironmentInjector` ([#61951](https://github.com/angular/angular/pull/61951)) |
| [36a193139a](https://github.com/angular/angular/commit/36a193139ac02ee619a26445669b7c253f33ebb8) | fix | allow to set a resource in an error state ([#62253](https://github.com/angular/angular/pull/62253)) |
| [c4dd258658](https://github.com/angular/angular/commit/c4dd258658fc5e93a83c0eae13fbd8768e7b6619) | fix | avoid injecting `ErrorHandler` from a destroyed injector ([#61886](https://github.com/angular/angular/pull/61886)) |
| [3eee19d892](https://github.com/angular/angular/commit/3eee19d8926d306c7dab238e7d32c8c39bfa7a57) | fix | unable to retrieve defer blocks in tests when component injects ViewContainerRef ([#62156](https://github.com/angular/angular/pull/62156)) |
| [2e0c98bd3f](https://github.com/angular/angular/commit/2e0c98bd3f2efd1181429b486dd1cebe14385c18) | feat | support bindings in TestBed ([#62040](https://github.com/angular/angular/pull/62040)) |
| [4356e85456](https://github.com/angular/angular/commit/4356e8545666f13033bb2c4b7fa018d0b97e6f01) | fix | fakeAsync should not depend on module import order ([#61375](https://github.com/angular/angular/pull/61375)) |
| [8424b3bcd5](https://github.com/angular/angular/commit/8424b3bcd5b9c78f37dc8ba636c87775937bcc03) | fix | Fixes template outlet hydration ([#61989](https://github.com/angular/angular/pull/61989)) |
| [583b9a7be5](https://github.com/angular/angular/commit/583b9a7be56310f247dcf83dd1ce297b9c6be682) | fix | missing useExisting providers throwing for optional calls ([#61137](https://github.com/angular/angular/pull/61137)) |
| [8f65223bd8](https://github.com/angular/angular/commit/8f65223bd83ee5cdbff6a3c8e99f85d1c69f5375) | fix | update min Node.js support to 20.19, 22.12, and 24.0 ([#61499](https://github.com/angular/angular/pull/61499)) |
| [b785256b9e](https://github.com/angular/angular/commit/b785256b9e7f83c9f05fb1afd561f0af49a42e9d) | perf | avoid intermediate arrays in definition ([#61445](https://github.com/angular/angular/pull/61445)) |
| [56769de4d8](https://github.com/angular/angular/commit/56769de4d83a08b8044cd2463341cbd60d40191f) | perf | move property remapping for dom properties to compiler ([#62421](https://github.com/angular/angular/pull/62421)) |
### forms
| Commit | Type | Description |
| -- | -- | -- |
| [610bebfce9](https://github.com/angular/angular/commit/610bebfce98d879677244b2ef08b24886891ca76) | fix | Allow ControlState as reset arguments for `FormGroup`/`FormRecord` ([#55860](https://github.com/angular/angular/pull/55860)) |
| [4f0221e193](https://github.com/angular/angular/commit/4f0221e1933675b24bdbf95be3825fdacee13c00) | fix | improve select performance ([#61949](https://github.com/angular/angular/pull/61949)) |
### http
| Commit | Type | Description |
| -- | -- | -- |
| [55fa38a1e5](https://github.com/angular/angular/commit/55fa38a1e53926d114b2290c084f3540f50b7266) | feat | add cache & priority support for fetch requests in httpResource ([#62301](https://github.com/angular/angular/pull/62301)) |
| [b6ef42843c](https://github.com/angular/angular/commit/b6ef42843c49e50239b678bb4d8f01ab30589dd3) | feat | add credentials support for fetch requests in httpResource ([#62390](https://github.com/angular/angular/pull/62390)) |
| [73269cf5ce](https://github.com/angular/angular/commit/73269cf5ceb4c32473a81a101a79decd06cfe274) | feat | add keepalive support for fetch requests in httpResource ([#61833](https://github.com/angular/angular/pull/61833)) |
| [27b7ec0a62](https://github.com/angular/angular/commit/27b7ec0a6219645a5af07c2d409c34311a458374) | feat | add mode & redirect for fetch request in httpResource ([#62337](https://github.com/angular/angular/pull/62337)) |
| [f0965c7acd](https://github.com/angular/angular/commit/f0965c7acd2fc2a4a4c18e5a47f3447c4fc7c668) | feat | Add support for fetch credentials options in HttpClient ([#62354](https://github.com/angular/angular/pull/62354)) |
| [87322449a3](https://github.com/angular/angular/commit/87322449a33fc727ad8c80b6cc6d0a87a900a6fa) | feat | add support for fetch mode and redirect options in HttpClient ([#62315](https://github.com/angular/angular/pull/62315)) |
| [9791ab1b6f](https://github.com/angular/angular/commit/9791ab1b6f8694ada6a0e359003243d89d6c7c97) | feat | Add support for fetch request cache and priority options ([#61766](https://github.com/angular/angular/pull/61766)) |
| [aa861c42ff](https://github.com/angular/angular/commit/aa861c42fface06563669c188327700085774e89) | feat | add timeout option on httpResource. ([#62326](https://github.com/angular/angular/pull/62326)) |
| [c4cffe2063](https://github.com/angular/angular/commit/c4cffe2063e790d2f8e4dc8b9c9817f2c4fcc4e7) | feat | Add timeout option to HTTP requests ([#57194](https://github.com/angular/angular/pull/57194)) |
| [cfbbb08437](https://github.com/angular/angular/commit/cfbbb0843727dd7959d73c496307153234ee20b9) | feat | add warning when withCredentials overrides explicit credentials ([#62383](https://github.com/angular/angular/pull/62383)) |
### language-service
| Commit | Type | Description |
| -- | -- | -- |
| [20c1f991e6](https://github.com/angular/angular/commit/20c1f991e63b8fc3023a302964d0438bfbfba8f0) | feat | add semantic tokens for templates ([#60260](https://github.com/angular/angular/pull/60260)) |
| [cf55d1bdd4](https://github.com/angular/angular/commit/cf55d1bdd4201ed99dd876138c50a497b611acb7) | feat | Support importing the external module's export about the angular metadata. ([#61122](https://github.com/angular/angular/pull/61122)) |
| [5d2e85920e](https://github.com/angular/angular/commit/5d2e85920e714560e8d06bfb9c41d9312eeaae3b) | feat | support to fix missing required inputs diagnostic ([#50911](https://github.com/angular/angular/pull/50911)) |
### router
| Commit | Type | Description |
| -- | -- | -- |
| [9833d9ea47](https://github.com/angular/angular/commit/9833d9ea47b717293c9df0d8a5c285a3c4ad35d0) | feat | Run `loadComponent` and `loadChildren` functions in the route's injection context ([#62133](https://github.com/angular/angular/pull/62133)) |
| [7600bec71d](https://github.com/angular/angular/commit/7600bec71d65366f5eaed94a54d6b848e0a670b5) | fix | handle scrollRestoration error in restricted environments ([#62186](https://github.com/angular/angular/pull/62186)) |
### upgrade
### service-worker
| Commit | Type | Description |
| -- | -- | -- |
| [900cd37f68](https://github.com/angular/angular/commit/900cd37f68c0beca0f19ccba2e3ccd4c34bdab91) | fix | Make zoneless work with hybrid apps ([#61660](https://github.com/angular/angular/pull/61660)) |
| [c67dbda8ff](https://github.com/angular/angular/commit/c67dbda8ff76410e0bb7e4b1719125f3197227dd) | feat | support notification closes ([#61442](https://github.com/angular/angular/pull/61442)) |
| [6e1df54799](https://github.com/angular/angular/commit/6e1df5479967c2c8b0fadf75e9a9f8c33a342245) | feat | support push subscription changes ([#61856](https://github.com/angular/angular/pull/61856)) |
<!-- CHANGELOG SPLIT MARKER -->
<a name="20.0.6"></a>
# 20.0.6 (2025-07-01)
<!-- CHANGELOG SPLIT MARKER -->
@@ -67,22 +165,6 @@
<!-- CHANGELOG SPLIT MARKER -->
<a name="20.1.0-next.2"></a>
# 20.1.0-next.2 (2025-06-18)
### core
| Commit | Type | Description |
| -- | -- | -- |
| [2e0c98bd3f](https://github.com/angular/angular/commit/2e0c98bd3f2efd1181429b486dd1cebe14385c18) | feat | support bindings in TestBed ([#62040](https://github.com/angular/angular/pull/62040)) |
| [8424b3bcd5](https://github.com/angular/angular/commit/8424b3bcd5b9c78f37dc8ba636c87775937bcc03) | fix | Fixes template outlet hydration ([#61989](https://github.com/angular/angular/pull/61989)) |
| [31da435854](https://github.com/angular/angular/commit/31da435854379e2a97b9b746751617e9979f01b0) | fix | inject `APP_ID` before injector is destroyed ([#61885](https://github.com/angular/angular/pull/61885)) |
| [572c32a038](https://github.com/angular/angular/commit/572c32a03876a5dbb6d0400ab0a217541407a0f9) | fix | Wrap ErrorEvent with no error property ([#62081](https://github.com/angular/angular/pull/62081)) |
### migrations
| Commit | Type | Description |
| -- | -- | -- |
| [34adfdea82](https://github.com/angular/angular/commit/34adfdea82997c43325e541c016c5c5d6f6f4a31) | fix | more robust trailing comma removal in unused imports migration ([#62118](https://github.com/angular/angular/pull/62118)) |
<!-- CHANGELOG SPLIT MARKER -->
<a name="20.0.4"></a>
# 20.0.4 (2025-06-18)
### core
@@ -98,28 +180,6 @@
<!-- CHANGELOG SPLIT MARKER -->
<a name="20.1.0-next.1"></a>
# 20.1.0-next.1 (2025-06-11)
### common
| Commit | Type | Description |
| -- | -- | -- |
| [ef10aa4005](https://github.com/angular/angular/commit/ef10aa400585fb66e1afde08be0f9fd9a70ce7f2) | feat | support decoding in NgOptimizedImage ([#61905](https://github.com/angular/angular/pull/61905)) |
### compiler-cli
| Commit | Type | Description |
| -- | -- | -- |
| [b7ab5fa256](https://github.com/angular/angular/commit/b7ab5fa2562524a0e8dfa4f3dff740ec2d31b4c7) | fix | add signal checks to handle negated calls ([#59970](https://github.com/angular/angular/pull/59970)) |
### core
| Commit | Type | Description |
| -- | -- | -- |
| [3aa933acb7](https://github.com/angular/angular/commit/3aa933acb796c6c85181c798b5353caaae17e809) | fix | components marked for traversal resets reactive context ([#61663](https://github.com/angular/angular/pull/61663)) |
| [e81ea0c3dd](https://github.com/angular/angular/commit/e81ea0c3dd67fc86c7203de65896c3119813fe4c) | fix | unregister `onDestroy` in `outputToObservable` ([#61882](https://github.com/angular/angular/pull/61882)) |
### forms
| Commit | Type | Description |
| -- | -- | -- |
| [4f0221e193](https://github.com/angular/angular/commit/4f0221e1933675b24bdbf95be3825fdacee13c00) | fix | improve select performance ([#61949](https://github.com/angular/angular/pull/61949)) |
<!-- CHANGELOG SPLIT MARKER -->
<a name="20.0.3"></a>
# 20.0.3 (2025-06-11)
@@ -135,45 +195,6 @@
<!-- CHANGELOG SPLIT MARKER -->
<a name="20.1.0-next.0"></a>
# 20.1.0-next.0 (2025-06-04)
### compiler
| Commit | Type | Description |
| -- | -- | -- |
| [5a76826d26](https://github.com/angular/angular/commit/5a76826d266b4ed0ef863221571e4b6b1b16182f) | fix | only report parser errors on invalid expression ([#61793](https://github.com/angular/angular/pull/61793)) |
| [e9fcbb8af1](https://github.com/angular/angular/commit/e9fcbb8af12e7b4370d2e03e6004f3f2fe02c981) | fix | remove TypeScript from linker ([#61618](https://github.com/angular/angular/pull/61618)) |
### compiler-cli
| Commit | Type | Description |
| -- | -- | -- |
| [e62fb359d6](https://github.com/angular/angular/commit/e62fb359d6da8e0458b18f24e6bff60602f93fc6) | feat | add experimental support for fast type declaration emission ([#61334](https://github.com/angular/angular/pull/61334)) |
| [0cf1001715](https://github.com/angular/angular/commit/0cf1001715d2f528c61735108d12e29047907d98) | feat | support host directives with direct external references in fast type declaration emission ([#61469](https://github.com/angular/angular/pull/61469)) |
| [77fa204ad1](https://github.com/angular/angular/commit/77fa204ad16fef561c009fcef0ab1fb92a37f986) | fix | rename flag for enabling fast type declaration emission ([#61353](https://github.com/angular/angular/pull/61353)) |
| [c439d6938d](https://github.com/angular/angular/commit/c439d6938de60cb132f7ae4d305efa5b3d853e36) | fix | symbol builder duplicating host directives ([#61240](https://github.com/angular/angular/pull/61240)) |
| [3e1baa5a95](https://github.com/angular/angular/commit/3e1baa5a9565f4930507cdf338e6f9ea7e8702a3) | fix | typo in NG2026 message ([#61325](https://github.com/angular/angular/pull/61325)) |
### core
| Commit | Type | Description |
| -- | -- | -- |
| [8163a8995e](https://github.com/angular/angular/commit/8163a8995e36bbce74e3d852613c19e56027cc24) | feat | Add `destroyed` property on `DestroyRef` ([#61849](https://github.com/angular/angular/pull/61849)) |
| [4356e85456](https://github.com/angular/angular/commit/4356e8545666f13033bb2c4b7fa018d0b97e6f01) | fix | fakeAsync should not depend on module import order ([#61375](https://github.com/angular/angular/pull/61375)) |
| [583b9a7be5](https://github.com/angular/angular/commit/583b9a7be56310f247dcf83dd1ce297b9c6be682) | fix | missing useExisting providers throwing for optional calls ([#61137](https://github.com/angular/angular/pull/61137)) |
| [8f65223bd8](https://github.com/angular/angular/commit/8f65223bd83ee5cdbff6a3c8e99f85d1c69f5375) | fix | update min Node.js support to 20.19, 22.12, and 24.0 ([#61499](https://github.com/angular/angular/pull/61499)) |
| [b785256b9e](https://github.com/angular/angular/commit/b785256b9e7f83c9f05fb1afd561f0af49a42e9d) | perf | avoid intermediate arrays in definition ([#61445](https://github.com/angular/angular/pull/61445)) |
### forms
| Commit | Type | Description |
| -- | -- | -- |
| [610bebfce9](https://github.com/angular/angular/commit/610bebfce98d879677244b2ef08b24886891ca76) | fix | Allow ControlState as reset arguments for `FormGroup`/`FormRecord` ([#55860](https://github.com/angular/angular/pull/55860)) |
### language-service
| Commit | Type | Description |
| -- | -- | -- |
| [cf55d1bdd4](https://github.com/angular/angular/commit/cf55d1bdd4201ed99dd876138c50a497b611acb7) | feat | Support importing the external module's export about the angular metadata. ([#61122](https://github.com/angular/angular/pull/61122)) |
### service-worker
| Commit | Type | Description |
| -- | -- | -- |
| [c67dbda8ff](https://github.com/angular/angular/commit/c67dbda8ff76410e0bb7e4b1719125f3197227dd) | feat | support notification closes ([#61442](https://github.com/angular/angular/pull/61442)) |
| [6e1df54799](https://github.com/angular/angular/commit/6e1df5479967c2c8b0fadf75e9a9f8c33a342245) | feat | support push subscription changes ([#61856](https://github.com/angular/angular/pull/61856)) |
<!-- CHANGELOG SPLIT MARKER -->
<a name="20.0.1"></a>
# 20.0.1 (2025-06-04)
### compiler
+27 -32
View File
@@ -8,9 +8,6 @@ load("//:yarn.bzl", "YARN_LABEL")
http_archive(
name = "build_bazel_rules_nodejs",
patches = [
"//tools/esm-interop:patches/bazel/nodejs_binary_esm_support.patch",
],
sha256 = "5dd1e5dea1322174c57d3ca7b899da381d516220793d0adef3ba03b9d23baa8e",
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/5.8.3/rules_nodejs-5.8.3.tar.gz"],
)
@@ -83,14 +80,7 @@ yarn_install(
YARN_LABEL,
"//:.yarnrc",
"//:tools/npm-patches/@angular+ng-dev+0.0.0-a6dcd24107d12114198251ee5d20cda814a1986a.patch",
"//:tools/npm-patches/@bazel+jasmine+5.8.1.patch",
"//:tools/npm-patches/dagre-d3-es+7.0.11.patch",
"//tools:postinstall-patches.js",
"//tools/esm-interop:patches/npm/@angular+build-tooling+0.0.0-2670abf637fa155971cdd1f7e570a7f234922a65.patch",
"//tools/esm-interop:patches/npm/@bazel+concatjs+5.8.1.patch",
"//tools/esm-interop:patches/npm/@bazel+esbuild+5.7.1.patch",
"//tools/esm-interop:patches/npm/@bazel+protractor+5.7.1.patch",
"//tools/esm-interop:patches/npm/rxjs+6.6.7.patch",
],
# Currently disabled due to:
# 1. Missing Windows support currently.
@@ -110,6 +100,9 @@ npm_translate_lock(
"//:.pnpmfile.cjs",
"//:package.json",
"//:pnpm-workspace.yaml",
"//:tools/pnpm-patches/dagre-d3-es+7.0.11.patch",
"//adev:package.json",
"//adev/shared-docs:package.json",
"//adev/shared-docs/pipeline/api-gen:package.json",
"//integration:package.json",
"//modules:package.json",
@@ -121,13 +114,14 @@ npm_translate_lock(
"//packages/compiler-cli/linker/babel/test:package.json",
"//packages/core:package.json",
"//packages/core/test/bundling:package.json",
"//packages/elements:package.json",
"//packages/forms:package.json",
"//packages/localize:package.json",
"//packages/platform-browser:package.json",
"//packages/platform-browser-dynamic:package.json",
"//packages/platform-server:package.json",
"//packages/router:package.json",
"//packages/upgrade:package.json",
"//packages/zone.js:package.json",
"//tools/bazel/rules_angular_store:package.json",
],
npmrc = "//:.npmrc",
@@ -143,9 +137,9 @@ npm_repositories()
http_archive(
name = "aspect_rules_ts",
sha256 = "6b15ac1c69f2c0f1282e41ab469fd63cd40eb2e2d83075e19b68a6a76669773f",
strip_prefix = "rules_ts-3.6.0",
url = "https://github.com/aspect-build/rules_ts/releases/download/v3.6.0/rules_ts-v3.6.0.tar.gz",
sha256 = "09af62a0d46918d815b5f48b5ed0f5349b62c15fc42fcc3fef5c246504ff8d99",
strip_prefix = "rules_ts-3.6.3",
url = "https://github.com/aspect-build/rules_ts/releases/download/v3.6.3/rules_ts-v3.6.3.tar.gz",
)
load("@aspect_rules_ts//ts:repositories.bzl", "rules_ts_dependencies")
@@ -178,20 +172,18 @@ load("@aspect_bazel_lib//lib:repositories.bzl", "aspect_bazel_lib_dependencies")
aspect_bazel_lib_dependencies()
# Load protractor dependencies
load("@npm//@bazel/protractor:package.bzl", "npm_bazel_protractor_dependencies")
npm_bazel_protractor_dependencies()
# TODO: Remove when karma webtest is no longer used
http_archive(
name = "io_bazel_rules_webtesting",
sha256 = "e9abb7658b6a129740c0b3ef6f5a2370864e102a5ba5ffca2cea565829ed825a",
urls = ["https://github.com/bazelbuild/rules_webtesting/releases/download/0.3.5/rules_webtesting.tar.gz"],
)
# Setup the rules_webtesting toolchain
load("@io_bazel_rules_webtesting//web:repositories.bzl", "web_test_repositories")
web_test_repositories()
load("@npm//@angular/build-tooling/bazel/browsers:browser_repositories.bzl", "browser_repositories")
browser_repositories()
load("@build_bazel_rules_nodejs//toolchains/esbuild:esbuild_repositories.bzl", "esbuild_repositories")
esbuild_repositories(
@@ -237,14 +229,6 @@ sass_repositories(
yarn_script = YARN_LABEL,
)
# Register git toolchains
register_toolchains(
"@npm//@angular/build-tooling/bazel/git-toolchain:git_linux_toolchain",
"@npm//@angular/build-tooling/bazel/git-toolchain:git_macos_x86_toolchain",
"@npm//@angular/build-tooling/bazel/git-toolchain:git_macos_arm64_toolchain",
"@npm//@angular/build-tooling/bazel/git-toolchain:git_windows_toolchain",
)
# Fetch sauce connect (tool to open Saucelabs tunnel for Saucelabs browser tests)
http_archive(
name = "sauce_connect_linux_amd64",
@@ -276,7 +260,7 @@ yarn_install(
git_repository(
name = "devinfra",
commit = "dfe138678e4edb4789fbe40ae7792c046de3b4bd",
commit = "4d2f875ec29ee71e0fe1a349a99c5ab2ccb71e30",
remote = "https://github.com/angular/dev-infra.git",
)
@@ -288,6 +272,10 @@ load("@devinfra//bazel:setup_dependencies_2.bzl", "setup_dependencies_2")
setup_dependencies_2()
load("@devinfra//bazel/browsers:browser_repositories.bzl", "browser_repositories")
browser_repositories()
git_repository(
name = "rules_angular",
commit = "88ddcf8cccbfef57f8cc3dda4881f18ec739428e",
@@ -311,7 +299,7 @@ rules_angular_step3(
git_repository(
name = "rules_browsers",
commit = "800d91c06d3ac174b789ad6a9b6772f358230c40",
commit = "56ef8007ea07cd1916429bca8bb523433b0e9cdc",
remote = "https://github.com/devversion/rules_browsers.git",
)
@@ -358,3 +346,10 @@ git_repository(
load("@rules_sass//src/toolchain:repositories.bzl", "setup_rules_sass")
setup_rules_sass()
http_archive(
name = "jq.bzl",
sha256 = "7b63435aa19cc6a0cfd1a82fbdf2c7a2f0a94db1a79ff7a4469ffa94286261ab",
strip_prefix = "jq.bzl-0.1.0",
url = "https://github.com/bazel-contrib/jq.bzl/releases/download/v0.1.0/jq.bzl-v0.1.0.tar.gz",
)
+92 -133
View File
@@ -1,41 +1,21 @@
load("@bazel_skylib//lib:collections.bzl", "collections")
load("@bazel_skylib//rules:common_settings.bzl", "bool_flag")
load("@build_bazel_rules_nodejs//:index.bzl", "copy_to_bin")
load("@devinfra//bazel/remote-execution:index.bzl", "ENABLE_NETWORK")
load("@npm//@angular-devkit/architect-cli:index.bzl", "architect", "architect_test")
load("//adev/tools/local_deps:index.bzl", "ensure_local_package_deps", "link_local_packages")
load("//tools:defaults.bzl", "http_server")
load("@npm2//:defs.bzl", "npm_link_all_packages")
load("@rules_angular//src/architect:ng_application.bzl", "ng_application")
load("@rules_angular//src/architect:ng_config.bzl", "ng_config")
load("@rules_angular//src/architect:ng_test.bzl", "ng_test")
package(default_visibility = ["//visibility:public"])
npm_link_all_packages(
name = "node_modules",
)
exports_files([
"tsconfig.json",
])
# All source and configuration files required to build the docs app
APPLICATION_FILES = [
"angular.json",
"tsconfig.app.json",
"tsconfig.json",
"tsconfig.worker.json",
] + glob(
["src/**/*"],
exclude = [
"src/**/*.spec.ts",
],
) + [
"//adev/src/content/examples:embeddable",
]
TEST_FILES = APPLICATION_FILES + [
"karma.conf.js",
"test-main.ts",
"tsconfig.spec.json",
] + glob(
["src/**/*.spec.ts"],
)
APPLICATION_ASSETS = [
"//adev/src/context:llms_full",
"//adev/src/assets/images",
"//adev/src/assets/others",
"//adev/src/assets/previews",
@@ -44,77 +24,75 @@ APPLICATION_ASSETS = [
"//adev/src/assets:api",
"//adev/src/assets:content",
"//adev/src/assets:context",
]
"//adev/src/content/examples:embeddable",
] + glob(
["src/**/*"],
exclude = ["src/**/*.spec.ts"],
)
APPLICATION_DEPS = [
"@npm//@angular/docs",
"@npm//@angular/build",
"@npm//@angular-devkit/build-angular",
"@npm//@angular/animations",
"@npm//@angular/cdk",
"@npm//@angular/common",
"@npm//@angular/compiler",
"@npm//@angular/compiler-cli",
"@npm//@angular/core",
"@npm//@angular/forms",
"@npm//@angular/material",
"@npm//@angular/platform-browser",
"@npm//@angular/platform-server",
"@npm//@angular/router",
"@npm//@angular/ssr",
"@npm//@types/dom-navigation",
"@npm//fflate",
"@npm//marked",
"@npm//ngx-progressbar",
"@npm//rxjs",
"@npm//xhr2",
"@npm//typescript",
"@npm//@typescript/vfs",
"@npm//@codemirror/state",
"@npm//@codemirror/view",
"@npm//@codemirror/language",
"@npm//@codemirror/commands",
"@npm//@codemirror/search",
"@npm//@codemirror/autocomplete",
"@npm//@codemirror/lint",
"@npm//@codemirror/lang-html",
"@npm//@codemirror/lang-angular",
"@npm//@codemirror/lang-css",
"@npm//@codemirror/lang-sass",
"@npm//@codemirror/lang-javascript",
"@npm//@lezer/highlight",
"@npm//@lezer/javascript",
"@npm//@lezer/common",
"@npm//@stackblitz/sdk",
"@npm//open-in-idx",
"@npm//@webcontainer/api",
"@npm//@xterm/xterm",
"@npm//@xterm/addon-fit",
"@npm//algoliasearch",
"@npm//angular-split",
"//adev:node_modules/@angular-devkit/build-angular",
"//adev:node_modules/@codemirror/autocomplete",
"//adev:node_modules/@codemirror/commands",
"//adev:node_modules/@codemirror/lang-angular",
"//adev:node_modules/@codemirror/lang-css",
"//adev:node_modules/@codemirror/lang-html",
"//adev:node_modules/@codemirror/lang-javascript",
"//adev:node_modules/@codemirror/lang-sass",
"//adev:node_modules/@codemirror/language",
"//adev:node_modules/@codemirror/lint",
"//adev:node_modules/@codemirror/search",
"//adev:node_modules/@codemirror/state",
"//adev:node_modules/@codemirror/view",
"//adev:node_modules/@lezer/common",
"//adev:node_modules/@lezer/highlight",
"//adev:node_modules/@lezer/javascript",
"//adev:node_modules/@stackblitz/sdk",
"//adev:node_modules/@typescript/vfs",
"//adev:node_modules/@webcontainer/api",
"//adev:node_modules/@xterm/addon-fit",
"//adev:node_modules/@xterm/xterm",
"//adev:node_modules/algoliasearch",
"//adev:node_modules/angular-split",
"//adev:node_modules/fflate",
"//adev:node_modules/marked",
"//adev:node_modules/ngx-progressbar",
"//adev:node_modules/open-in-idx",
"//adev:node_modules/typescript",
"//adev:node_modules/xhr2",
"//adev:node_modules/@types/node",
"//adev:node_modules/@types/dom-navigation",
# Deep imports
"//adev:node_modules/@algolia/client-common",
"//adev:node_modules/@algolia/requester-browser-xhr",
"//adev:node_modules/@algolia/requester-node-http",
"//adev:node_modules/@lezer/css",
"//adev:node_modules/@lezer/html",
"//adev:node_modules/@lezer/lr",
"//adev:node_modules/@lezer/sass",
"//adev:node_modules/@marijn/find-cluster-break",
"//adev:node_modules/crelt",
"//adev:node_modules/style-mod",
"//adev:node_modules/w3c-keyname",
]
TEST_DEPS = APPLICATION_DEPS + [
"@npm//@types/jasmine",
"@npm//@types/node",
"@npm//jasmine",
"@npm//jasmine-core",
"@npm//karma-chrome-launcher",
"@npm//karma-coverage",
"@npm//karma-jasmine",
"@npm//karma-jasmine-html-reporter",
TEST_FILES = APPLICATION_FILES + [
"karma.conf.js",
"test-main.ts",
] + glob(["src/**/*.spec.ts"])
TEST_DEPS = [
dep
for dep in APPLICATION_DEPS
if dep != "//adev:node_modules/@types/node"
] + [
"@rules_browsers//src/browsers/chromium",
"@rules_browsers//src/browsers/firefox",
"//adev/tools:windows-chromium-path",
]
# Create `npm_link` targets for all dependencies that correspond to a
# first-party Angular package that can be built from `HEAD`.
link_local_packages(
all_deps = collections.uniq(APPLICATION_DEPS + TEST_DEPS),
)
copy_to_bin(
name = "application_files_bin",
srcs = APPLICATION_FILES,
)
ng_config(name = "ng_config")
bool_flag(
name = "full_build_adev",
@@ -146,57 +124,38 @@ config_based_architect_env = select({
config_based_architect_flags = select({
":dev_build": [
"angular-dev:build:development",
"--configuration",
"development",
],
":prod_build": [
"angular-dev:build:production",
"--configuration",
"production",
],
})
architect(
ng_application(
name = "build",
args = config_based_architect_flags + [
"--output-path=build",
"",
],
chdir = "$(RULEDIR)",
data = ensure_local_package_deps(APPLICATION_DEPS) + APPLICATION_ASSETS + [
":application_files_bin",
],
srcs = APPLICATION_FILES + APPLICATION_DEPS,
args = config_based_architect_flags,
env = config_based_architect_env,
# Network is required to inline fonts.
exec_properties = ENABLE_NETWORK,
output_dir = True,
tags = [
"no-remote-exec",
],
ng_config = ":ng_config",
node_modules = "//adev:node_modules",
project_name = "angular-dev",
)
http_server(
name = "serve",
additional_root_paths = [
"angular/adev/build/browser",
],
enable_dev_ui = True,
relax_cors = True,
deps = [":build"],
)
architect_test(
ng_test(
name = "test",
args = [
"angular-dev:test",
"--no-watch",
],
chdir = package_name(),
data = ensure_local_package_deps(TEST_DEPS) + TEST_FILES + APPLICATION_ASSETS + [
"//adev/tools:windows-chromium-path",
"@npm//@angular/build-tooling/bazel/browsers/chromium",
],
srcs = TEST_FILES + TEST_DEPS,
env = {
"CHROME_BIN": "../$(CHROMIUM)",
# Move one level up because we are in `//adev`
"CHROME_BIN": "../" + "$(CHROME-HEADLESS-SHELL)",
"CHROMEDRIVER_BIN": "../" + "$(CHROMEDRIVER)",
},
ng_config = ":ng_config",
node_modules = "//adev:node_modules",
project_name = "angular-dev",
toolchains = [
"@npm//@angular/build-tooling/bazel/browsers/chromium:toolchain_alias",
"@rules_browsers//src/browsers/chromium:toolchain_alias",
"@rules_browsers//src/browsers/firefox:toolchain_alias",
],
)
+3 -15
View File
@@ -20,16 +20,8 @@
"builder": "@angular/build:application",
"options": {
"externalDependencies": ["path"],
"define": {
// We need this until xterm 5.6.0 is released
// see https://github.com/xtermjs/xterm.js/pull/4940
"self": "this"
},
// Ensures we don't escape sandbox to the workspace root with the full node modules that
// might contain e.g. `@angular/core` from npm.
"preserveSymlinks": true,
"outputMode": "static",
"outputPath": "dist/angular-dev",
"outputPath": "dist",
"index": "src/index.html",
"browser": "src/main.ts",
"server": "src/main.server.ts",
@@ -40,16 +32,14 @@
"src/favicon.ico",
"src/robots.txt",
"src/assets",
"src/llms.txt",
"src/llms-full.txt",
"src/context"
"src/context",
"src/llms.txt"
],
"styles": ["@angular/docs/styles/global-styles.scss", "./src/local-styles.scss"],
"scripts": [],
"webWorkerTsConfig": "tsconfig.worker.json",
"optimization": {
"fonts": {
// TODO(josephperrott): enabled inline scripts
"inline": false
}
}
@@ -111,8 +101,6 @@
"cli": {
"analytics": "dca119a9-da31-47f7-a6cb-b60541037021",
"cache": {
// Disable build caching as the cache folder will just be dropped
// when run under Bazel sandboxed execution.
"enabled": false
}
}
+1 -1
View File
@@ -9,7 +9,7 @@
// Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html
const {getAdjustedChromeBinPathForWindows} = require('../adev/tools/windows-chromium-path');
const {getAdjustedChromeBinPathForWindows} = require('./tools/windows-chromium-path');
process.env.CHROME_BIN = getAdjustedChromeBinPathForWindows();
+84
View File
@@ -0,0 +1,84 @@
{
"dependencies": {
"@angular-devkit/build-angular": "20.1.3",
"@angular/animations": "workspace:*",
"@angular/build": "20.1.3",
"@angular/cdk": "20.1.3",
"@angular/cli": "20.1.3",
"@angular/common": "workspace:*",
"@angular/compiler-cli": "workspace:*",
"@angular/compiler": "workspace:*",
"@angular/core": "workspace:*",
"@angular/docs": "workspace:*",
"@angular/forms": "workspace:*",
"@angular/material": "20.1.3",
"@angular/platform-browser": "workspace:*",
"@angular/platform-server": "workspace:*",
"@angular/router": "workspace:*",
"@angular/ssr": "20.1.3",
"@codemirror/autocomplete": "6.18.6",
"@codemirror/commands": "6.8.1",
"@codemirror/lang-angular": "0.1.4",
"@codemirror/lang-css": "6.3.1",
"@codemirror/lang-html": "6.4.9",
"@codemirror/lang-javascript": "6.2.4",
"@codemirror/lang-sass": "6.0.2",
"@codemirror/language": "6.11.2",
"@codemirror/lint": "6.8.5",
"@codemirror/search": "6.5.11",
"@codemirror/state": "6.5.2",
"@codemirror/view": "6.38.1",
"@lezer/common": "1.2.3",
"@lezer/highlight": "1.2.1",
"@lezer/javascript": "1.5.1",
"@stackblitz/sdk": "1.11.0",
"@types/dom-navigation": "1.0.6",
"@types/jasmine": "5.1.8",
"@types/jsdom": "21.1.7",
"@types/node": "24.1.0",
"@typescript/vfs": "1.6.1",
"@webcontainer/api": "1.6.1",
"@xterm/addon-fit": "0.10.0",
"@xterm/xterm": "5.5.0",
"algoliasearch": "5.35.0",
"angular-split": "20.0.0",
"diff": "8.0.2",
"emoji-regex": "10.4.0",
"fflate": "0.8.2",
"html-entities": "2.6.0",
"jasmine-core": "5.9.0",
"jsdom": "26.1.0",
"karma-chrome-launcher": "3.2.0",
"karma-coverage": "2.2.1",
"karma-jasmine-html-reporter": "2.1.0",
"karma-jasmine": "5.1.0",
"marked": "16.1.1",
"mermaid": "11.9.0",
"ngx-progressbar": "14.0.0",
"open-in-idx": "0.1.1",
"playwright-core": "1.54.1",
"preact-render-to-string": "6.5.13",
"preact": "10.27.0",
"prettier": "3.6.2",
"rxjs": "7.8.2",
"shiki": "3.8.1",
"tinyglobby": "0.2.14",
"tslib": "2.8.1",
"typescript": "5.8.3",
"xhr2": "0.2.1",
"zone.js": "0.15.1",
"@algolia/client-common": "5.35.0",
"@algolia/requester-browser-xhr": "5.35.0",
"@algolia/requester-node-http": "5.35.0",
"@lezer/css": "1.3.0",
"@lezer/html": "1.3.10",
"@lezer/lr": "1.4.2",
"@lezer/sass": "1.1.0",
"@marijn/find-cluster-break": "1.0.2",
"crelt": "1.0.6",
"style-mod": "4.1.2",
"w3c-keyname": "2.2.8"
}
}
+7 -31
View File
@@ -1,12 +1,8 @@
load("@aspect_bazel_lib//lib:copy_to_directory.bzl", "copy_to_directory")
load("@aspect_rules_ts//ts:defs.bzl", rules_js_tsconfig = "ts_config")
load("//adev/shared-docs:defaults.bzl", "ng_project")
load("//tools:defaults.bzl", "pkg_npm")
load("//tools:defaults2.bzl", "ng_package")
load("//adev/shared-docs:defaults.bzl", "ng_package", "ng_project", "ts_config")
package(default_visibility = ["//visibility:public"])
rules_js_tsconfig(
ts_config(
name = "tsconfig_build",
src = "tsconfig.json",
visibility = [
@@ -14,7 +10,7 @@ rules_js_tsconfig(
],
)
rules_js_tsconfig(
ts_config(
name = "tsconfig_test",
src = "tsconfig-test.json",
visibility = [
@@ -22,7 +18,7 @@ rules_js_tsconfig(
],
deps = [
":tsconfig_build",
"//:node_modules/@types/jasmine",
"//adev:node_modules/@types/jasmine",
],
)
@@ -53,12 +49,12 @@ ng_package(
"//adev/shared-docs/pipeline:_playground.bzl",
"//adev/shared-docs/pipeline:_stackblitz.bzl",
"//adev/shared-docs/pipeline:_tutorial.bzl",
"//adev/shared-docs/pipeline:playground.mjs",
"//adev/shared-docs/pipeline:stackblitz.mjs",
"//adev/shared-docs/pipeline:tutorial.mjs",
"//adev/shared-docs/pipeline/examples/stackblitz:stackblitz.mjs",
"//adev/shared-docs/pipeline/examples/template:files",
"//adev/shared-docs/pipeline/guides:guides.mjs",
"//adev/shared-docs/pipeline/guides:guides-no-mermaid.mjs",
"//adev/shared-docs/pipeline/tutorials:playground.mjs",
"//adev/shared-docs/pipeline/tutorials:tutorial.mjs",
"//adev/shared-docs/pipeline/tutorials/common:files",
"//adev/shared-docs/styles",
],
@@ -70,23 +66,3 @@ ng_package(
":docs_rjs",
],
)
copy_to_directory(
name = "pkg_middle",
srcs = [
":pkg",
],
replace_prefixes = {
"pkg": "",
},
)
# Temporarily include this intermediate `pkg_npm` so that the rest of the adev tooling is able to
# properly performing linking using information from rules_nodejs toolchain providers.
pkg_npm(
name = "npm_package",
package_name = "@angular/docs",
nested_packages = [
":pkg_middle",
],
)
@@ -15,6 +15,6 @@ ng_project(
"//adev/shared-docs/components/search-dialog:__pkg__",
],
deps = [
"//packages/core:core_rjs",
"//adev:node_modules/@angular/core",
],
)
@@ -1,5 +1,4 @@
load("//adev/shared-docs:defaults.bzl", "ng_project", "ts_project")
load("//tools:defaults2.bzl", "ng_web_test_suite", "sass_binary")
load("//adev/shared-docs:defaults.bzl", "ng_project", "sass_binary", "ts_project", "zoneless_web_test_suite")
package(default_visibility = ["//visibility:private"])
@@ -17,11 +16,11 @@ ng_project(
"//adev/shared-docs/components/viewers:__pkg__",
],
deps = [
"//adev:node_modules/@angular/common",
"//adev:node_modules/@angular/core",
"//adev:node_modules/@angular/router",
"//adev/shared-docs/interfaces:interfaces_rjs",
"//adev/shared-docs/services:services_rjs",
"//packages/common:common_rjs",
"//packages/core:core_rjs",
"//packages/router:router_rjs",
],
)
@@ -38,17 +37,15 @@ ts_project(
),
deps = [
":breadcrumb_rjs",
"//adev:node_modules/@angular/core",
"//adev:node_modules/@angular/platform-browser",
"//adev:node_modules/@angular/router",
"//adev/shared-docs/interfaces:interfaces_rjs",
"//adev/shared-docs/services:services_rjs",
"//packages/core:core_rjs",
"//packages/core/testing:testing_rjs",
"//packages/platform-browser:platform-browser_rjs",
"//packages/router:router_rjs",
"//packages/router/testing:testing_rjs",
],
)
ng_web_test_suite(
zoneless_web_test_suite(
name = "test",
deps = [":test_lib_rjs"],
)
@@ -12,7 +12,7 @@ import {Breadcrumb} from './breadcrumb.component';
import {NavigationState} from '../../services';
import {NavigationItem} from '../../interfaces';
import {By} from '@angular/platform-browser';
import {RouterTestingModule} from '@angular/router/testing';
import {provideRouter} from '@angular/router';
import {provideZonelessChangeDetection} from '@angular/core';
describe('Breadcrumb', () => {
@@ -23,8 +23,9 @@ describe('Breadcrumb', () => {
navigationStateSpy = jasmine.createSpyObj('NavigationState', ['activeNavigationItem']);
TestBed.configureTestingModule({
imports: [Breadcrumb, RouterTestingModule],
imports: [Breadcrumb],
providers: [
provideRouter([]),
provideZonelessChangeDetection(),
{
provide: NavigationState,
@@ -1,5 +1,4 @@
load("//adev/shared-docs:defaults.bzl", "ng_project", "ts_project")
load("//tools:defaults2.bzl", "ng_web_test_suite", "sass_binary")
load("//adev/shared-docs:defaults.bzl", "ng_project", "sass_binary", "ts_project", "zoneless_web_test_suite")
package(default_visibility = ["//visibility:private"])
@@ -16,10 +15,10 @@ ng_project(
"//adev/shared-docs/components:__pkg__",
],
deps = [
"//adev:node_modules/@angular/common",
"//adev:node_modules/@angular/core",
"//adev/shared-docs/providers:providers_rjs",
"//adev/shared-docs/utils:utils_rjs",
"//packages/common:common_rjs",
"//packages/core:core_rjs",
],
)
@@ -36,14 +35,13 @@ ts_project(
),
deps = [
":cookie-popup_rjs",
"//adev:node_modules/@angular/core",
"//adev/shared-docs/providers:providers_rjs",
"//adev/shared-docs/testing:testing_rjs",
"//packages/core:core_rjs",
"//packages/core/testing:testing_rjs",
],
)
ng_web_test_suite(
zoneless_web_test_suite(
name = "test",
deps = [":test_lib_rjs"],
)
@@ -1,7 +1,4 @@
load("//adev/shared-docs:defaults.bzl", "ng_project", "ts_project")
load("//tools:defaults.bzl", "karma_web_test_suite")
package(default_visibility = ["//visibility:private"])
load("//adev/shared-docs:defaults.bzl", "ng_project", "ts_project", "zoneless_web_test_suite")
ng_project(
name = "copy-source-code-button",
@@ -16,10 +13,10 @@ ng_project(
"//adev/shared-docs/components/viewers:__pkg__",
],
deps = [
"//:node_modules/@angular/cdk",
"//adev:node_modules/@angular/cdk",
"//adev:node_modules/@angular/common",
"//adev:node_modules/@angular/core",
"//adev/shared-docs/components/icon:icon_rjs",
"//packages/common:common_rjs",
"//packages/core:core_rjs",
],
)
@@ -31,14 +28,13 @@ ts_project(
),
deps = [
":copy-source-code-button_rjs",
"//:node_modules/@angular/cdk",
"//packages/core:core_rjs",
"//packages/core/testing:testing_rjs",
"//packages/platform-browser:platform-browser_rjs",
"//adev:node_modules/@angular/cdk",
"//adev:node_modules/@angular/core",
"//adev:node_modules/@angular/platform-browser",
],
)
karma_web_test_suite(
zoneless_web_test_suite(
name = "test",
deps = [":test_lib"],
deps = [":test_lib_rjs"],
)
@@ -6,7 +6,7 @@
* found in the LICENSE file at https://angular.dev/license
*/
import {ComponentFixture, TestBed, fakeAsync, tick} from '@angular/core/testing';
import {ComponentFixture, TestBed} from '@angular/core/testing';
import {
CONFIRMATION_DISPLAY_TIME_MS,
@@ -74,7 +74,8 @@ describe('CopySourceCodeButton', () => {
expect(copySpy.calls.argsFor(0)[0].trim()).toBe(expectedCodeToBeCopied);
});
it(`should set ${SUCCESSFULLY_COPY_CLASS_NAME} for ${CONFIRMATION_DISPLAY_TIME_MS} ms when copy was executed properly`, fakeAsync(() => {
it(`should set ${SUCCESSFULLY_COPY_CLASS_NAME} for ${CONFIRMATION_DISPLAY_TIME_MS} ms when copy was executed properly`, () => {
const clock = jasmine.clock().install();
component.code.set('example');
fixture.detectChanges();
@@ -85,13 +86,15 @@ describe('CopySourceCodeButton', () => {
expect(button).toHaveClass(SUCCESSFULLY_COPY_CLASS_NAME);
tick(CONFIRMATION_DISPLAY_TIME_MS);
clock.tick(CONFIRMATION_DISPLAY_TIME_MS);
fixture.detectChanges();
expect(button).not.toHaveClass(SUCCESSFULLY_COPY_CLASS_NAME);
}));
clock.uninstall();
});
it(`should set ${FAILED_COPY_CLASS_NAME} for ${CONFIRMATION_DISPLAY_TIME_MS} ms when copy failed`, fakeAsync(() => {
it(`should set ${FAILED_COPY_CLASS_NAME} for ${CONFIRMATION_DISPLAY_TIME_MS} ms when copy failed`, async () => {
const clock = jasmine.clock().install();
component.code.set('example');
copySpy.and.throwError('Fake copy error');
@@ -104,11 +107,12 @@ describe('CopySourceCodeButton', () => {
expect(button).toHaveClass(FAILED_COPY_CLASS_NAME);
tick(CONFIRMATION_DISPLAY_TIME_MS);
clock.tick(CONFIRMATION_DISPLAY_TIME_MS);
fixture.detectChanges();
expect(button).not.toHaveClass(FAILED_COPY_CLASS_NAME);
}));
clock.uninstall();
});
});
@Component({
+3 -4
View File
@@ -1,5 +1,4 @@
load("//adev/shared-docs:defaults.bzl", "ng_project")
load("//tools:defaults2.bzl", "sass_binary")
load("//adev/shared-docs:defaults.bzl", "ng_project", "sass_binary")
package(default_visibility = ["//visibility:private"])
@@ -21,8 +20,8 @@ ng_project(
"//adev/shared-docs/components/viewers:__pkg__",
],
deps = [
"//packages/common:common_rjs",
"//packages/core:core_rjs",
"//adev:node_modules/@angular/common",
"//adev:node_modules/@angular/core",
],
)
@@ -1,6 +1,4 @@
load("//adev/shared-docs:defaults.bzl", "ng_project", "ts_project")
load("//tools:defaults.bzl", "karma_web_test_suite")
load("//tools:defaults2.bzl", "sass_binary")
load("//adev/shared-docs:defaults.bzl", "ng_project", "sass_binary", "ts_project", "zoneless_web_test_suite")
package(default_visibility = ["//visibility:private"])
@@ -17,14 +15,14 @@ ng_project(
"//adev/shared-docs/components:__pkg__",
],
deps = [
"//:node_modules/@angular/material",
"//adev:node_modules/@angular/common",
"//adev:node_modules/@angular/core",
"//adev:node_modules/@angular/material",
"//adev:node_modules/@angular/router",
"//adev/shared-docs/components/icon:icon_rjs",
"//adev/shared-docs/interfaces:interfaces_rjs",
"//adev/shared-docs/pipes:pipes_rjs",
"//adev/shared-docs/services:services_rjs",
"//packages/common:common_rjs",
"//packages/core:core_rjs",
"//packages/router:router_rjs",
],
)
@@ -44,17 +42,15 @@ ts_project(
),
deps = [
":navigation-list_rjs",
"//adev:node_modules/@angular/core",
"//adev:node_modules/@angular/platform-browser",
"//adev:node_modules/@angular/router",
"//adev/shared-docs/interfaces:interfaces_rjs",
"//adev/shared-docs/services:services_rjs",
"//packages/core:core_rjs",
"//packages/core/testing:testing_rjs",
"//packages/platform-browser:platform-browser_rjs",
"//packages/router:router_rjs",
"//packages/router/testing:testing_rjs",
],
)
karma_web_test_suite(
zoneless_web_test_suite(
name = "test",
deps = [":test_lib"],
deps = [":test_lib_rjs"],
)
@@ -7,15 +7,23 @@
<li class="docs-faceted-list-item">
@if (item.path) {
@if (item.isExternal) {
<a
[href]="item.path" target="_blank"
<a
[href]="item.path"
target="_blank"
[matTooltip]="item.label"
[matTooltipDisabled]="item.label.length < 27"
matTooltipPosition="after"
[attr.aria-label]="item.label"
[matTooltipClass]="'API-tooltip'"
>
<span [class.docs-external-link]="item.isExternal" class="docs-faceted-list-item-text">{{ item.label }}</span>
<span
[class.docs-external-link]="item.isExternal"
class="docs-faceted-list-item-text"
>
{{ item.label }}
<ng-container *ngTemplateOutlet="itemStatus; context: {$implicit: item}" />
</span>
@if (item.children && item.level! > 1 && !item.isExpanded) {
<docs-icon>chevron_right</docs-icon>
}
@@ -23,13 +31,6 @@
} @else {
<a
[routerLink]="'/' + item.path"
routerLinkActive="docs-faceted-list-item-active"
[routerLinkActiveOptions]="{ exact: true }"
(click)="emitClickOnLink()"
@@ -39,7 +40,11 @@
[attr.aria-label]="item.label"
[matTooltipClass]="'API-tooltip'"
>
<span class="docs-faceted-list-item-text">{{item.label}}</span>
<span class="docs-faceted-list-item-text">
{{item.label}}
<ng-container *ngTemplateOutlet="itemStatus; context: {$implicit: item}" />
</span>
@if (item.children && !item.isExpanded) {
<docs-icon>chevron_right</docs-icon>
}
@@ -48,14 +53,18 @@
} @else {
<!-- Nav Section Header -->
@if (item.level !== collapsableLevel() && item.level !== expandableLevel()) {
<div class="docs-secondary-nav-header"
<div
class="docs-secondary-nav-header"
[matTooltip]="item.label"
[matTooltipDisabled]="item.label.length < 27"
matTooltipPosition="after"
[attr.aria-label]="item.label"
[matTooltipClass]="'API-tooltip'"
>
<span class="docs-faceted-list-item-text">{{item.label}}</span>
<span class="docs-faceted-list-item-text">
{{item.label}}
<ng-container *ngTemplateOutlet="itemStatus; context: {$implicit: item}" />
</span>
</div>
}
@@ -83,7 +92,10 @@
@if (item.children && item.level === collapsableLevel()) {
<docs-icon>arrow_back</docs-icon>
}
<span class="docs-faceted-list-item-text">{{ item.label }}</span>
<span class="docs-faceted-list-item-text">
{{ item.label }}
<ng-container *ngTemplateOutlet="itemStatus; context: {$implicit: item}" />
</span>
</button>
}
}
@@ -96,3 +108,11 @@
</ng-template>
<ng-container *ngTemplateOutlet="navigationList; context: {$implicit: navigationItems()}" />
<ng-template let-item #itemStatus>
@if (item.status === 'new') {
<span class="tag docs-new-item">New</span>
} @else if (item.status === 'updated') {
<span class="tag docs-updated-item">Updated</span>
}
</ng-template>
@@ -59,6 +59,32 @@
font-family: var(--icons);
}
}
.tag {
--label-theme: var(--symbolic-purple);
color: var(--label-theme);
background: color-mix(in srgb, var(--label-theme) 10%, white);
margin-inline-start: 0.5rem;
border-radius: 0.25rem;
font-size: 0.7rem;
padding: 0.25rem 0.5rem;
.docs-dark-mode & {
background: color-mix(in srgb, var(--label-theme) 17%, #272727);
}
.docs-light-mode & {
background: color-mix(in srgb, var(--label-theme) 10%, white);
}
&.docs-new-item {
--label-theme: var(--symbolic-green);
}
&.docs-updated-item {
--label-theme: var(--symbolic-blue);
}
}
}
.docs-secondary-nav-header {
@@ -151,11 +177,11 @@ a,
}
}
::ng-deep .API-tooltip{
.mat-mdc-tooltip-surface{
::ng-deep .API-tooltip {
.mat-mdc-tooltip-surface {
max-width: unset;
width:auto;
width: auto;
word-break: keep-all;
white-space: pre;
}
}
}
@@ -1,6 +1,4 @@
load("//adev/shared-docs:defaults.bzl", "ng_project", "ts_project")
load("//tools:defaults.bzl", "karma_web_test_suite")
load("//tools:defaults2.bzl", "sass_binary")
load("//adev/shared-docs:defaults.bzl", "ng_project", "sass_binary", "ts_project", "zoneless_web_test_suite")
package(default_visibility = ["//visibility:private"])
@@ -17,8 +15,12 @@ ng_project(
"//adev/shared-docs/components:__pkg__",
],
deps = [
"//:node_modules/@angular/cdk",
"//:node_modules/rxjs",
"//adev:node_modules/@angular/cdk",
"//adev:node_modules/@angular/common",
"//adev:node_modules/@angular/core",
"//adev:node_modules/@angular/forms",
"//adev:node_modules/@angular/router",
"//adev:node_modules/rxjs",
"//adev/shared-docs/components/algolia-icon:algolia-icon_rjs",
"//adev/shared-docs/components/search-history:search-history_rjs",
"//adev/shared-docs/components/text-field:text-field_rjs",
@@ -26,10 +28,6 @@ ng_project(
"//adev/shared-docs/interfaces:interfaces_rjs",
"//adev/shared-docs/pipes:pipes_rjs",
"//adev/shared-docs/services:services_rjs",
"//packages/common:common_rjs",
"//packages/core:core_rjs",
"//packages/forms:forms_rjs",
"//packages/router:router_rjs",
],
)
@@ -46,20 +44,18 @@ ts_project(
),
deps = [
":search-dialog_rjs",
"//adev:node_modules/@angular/core",
"//adev:node_modules/@angular/platform-browser",
"//adev:node_modules/@angular/router",
"//adev/shared-docs/components/algolia-icon:algolia-icon_rjs",
"//adev/shared-docs/interfaces:interfaces_rjs",
"//adev/shared-docs/providers:providers_rjs",
"//adev/shared-docs/services:services_rjs",
"//adev/shared-docs/testing:testing_rjs",
"//packages/core:core_rjs",
"//packages/core/testing:testing_rjs",
"//packages/platform-browser:platform-browser_rjs",
"//packages/router:router_rjs",
"//packages/router/testing:testing_rjs",
],
)
karma_web_test_suite(
zoneless_web_test_suite(
name = "test",
deps = [":test_lib"],
deps = [":test_lib_rjs"],
)
@@ -14,8 +14,7 @@ import {ALGOLIA_CLIENT, Search} from '../../services';
import {FakeEventTarget} from '../../testing/index';
import {By} from '@angular/platform-browser';
import {AlgoliaIcon} from '../algolia-icon/algolia-icon.component';
import {RouterTestingModule} from '@angular/router/testing';
import {Router} from '@angular/router';
import {Router, provideRouter} from '@angular/router';
import {ApplicationRef, provideZonelessChangeDetection, ResourceStatus} from '@angular/core';
import {SearchResult} from '../../interfaces';
@@ -32,8 +31,9 @@ describe('SearchDialog', () => {
searchResults.and.returnValue([]);
TestBed.configureTestingModule({
imports: [SearchDialog, RouterTestingModule],
imports: [SearchDialog],
providers: [
provideRouter([]),
provideZonelessChangeDetection(),
{provide: ENVIRONMENT, useValue: {algolia: {index: 'fakeIndex'}}},
{provide: ALGOLIA_CLIENT, useValue: {search: searchResults}},
@@ -84,7 +84,7 @@ export class SearchDialog {
this.searchQuery.set(value);
});
// Thinkig about refactoring this to a single afterRenderEffect ?
// Thinking about refactoring this to a single afterRenderEffect ?
// Answer: It won't have the same behavior
effect(() => {
this.items();
@@ -1,6 +1,4 @@
load("//adev/shared-docs:defaults.bzl", "ng_project", "ts_project")
load("//tools:defaults.bzl", "karma_web_test_suite")
load("//tools:defaults2.bzl", "sass_binary")
load("//adev/shared-docs:defaults.bzl", "ng_project", "sass_binary", "ts_project", "zoneless_web_test_suite")
package(default_visibility = ["//visibility:private"])
@@ -23,12 +21,12 @@ ng_project(
"//adev/shared-docs/components/search-dialog:__pkg__",
],
deps = [
"//:node_modules/@angular/cdk",
"//adev:node_modules/@angular/cdk",
"//adev:node_modules/@angular/core",
"//adev:node_modules/@angular/router",
"//adev/shared-docs/directives:directives_rjs",
"//adev/shared-docs/pipes:pipes_rjs",
"//adev/shared-docs/services:services_rjs",
"//packages/core:core_rjs",
"//packages/router:router_rjs",
],
)
@@ -38,15 +36,14 @@ ts_project(
srcs = ["search-history.component.spec.ts"],
deps = [
":search-history_rjs",
"//adev:node_modules/@angular/core",
"//adev:node_modules/@angular/platform-browser",
"//adev/shared-docs/services:services_rjs",
"//adev/shared-docs/testing:testing_rjs",
"//packages/core:core_rjs",
"//packages/core/testing:testing_rjs",
"//packages/platform-browser:platform-browser_rjs",
],
)
karma_web_test_suite(
zoneless_web_test_suite(
name = "test",
deps = [":test_lib"],
deps = [":test_lib_rjs"],
)
@@ -6,8 +6,8 @@
* found in the LICENSE file at https://angular.dev/license
*/
import {provideZonelessChangeDetection} from '@angular/core';
import {ComponentFixture, fakeAsync, flushMicrotasks, TestBed} from '@angular/core/testing';
import {provideZonelessChangeDetection, ApplicationRef} from '@angular/core';
import {ComponentFixture, TestBed} from '@angular/core/testing';
import {By} from '@angular/platform-browser';
import {provideRouter} from '@angular/router';
@@ -50,59 +50,54 @@ const ITEMS: HistoryItem[] = [
},
];
function loadItems(history: SearchHistory) {
async function loadItems(history: SearchHistory) {
for (const item of ITEMS) {
// Since adding an item sets a timestamp which is later
// used for sorting the items array, we artificially
// tick forward the clock and then flush the microtask queue
// to ensure proper/expected order. This is needed since we
// are updating the internal signal multiple times consecutively.
jasmine.clock().tick(100);
// used for sorting the items array, we
// update the clock by awaiting a timeout.
history.addItem(item);
flushMicrotasks();
await new Promise((resolve) => setTimeout(resolve, 5));
}
const favorite = ITEMS.filter((i) => i.isFavorite);
for (const item of favorite) {
jasmine.clock().tick(100);
history.makeFavorite(item);
flushMicrotasks();
await new Promise((resolve) => setTimeout(resolve, 5));
}
TestBed.tick();
await TestBed.inject(ApplicationRef).whenStable();
}
describe('SearchHistoryComponent', () => {
let fixture: ComponentFixture<SearchHistoryComponent>;
let history: SearchHistory;
beforeEach(fakeAsync(async () => {
jasmine.clock().uninstall();
jasmine.clock().install();
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [SearchHistoryComponent],
providers: [
provideZonelessChangeDetection(),
{provide: LOCAL_STORAGE, useClass: MockLocalStorage},
provideRouter([]),
],
}).compileComponents();
});
fixture = TestBed.createComponent(SearchHistoryComponent);
history = TestBed.inject(SearchHistory);
loadItems(history);
await loadItems(history);
fixture.detectChanges();
}));
afterEach(() => {
jasmine.clock().uninstall();
TestBed.tick();
await TestBed.inject(ApplicationRef).whenStable();
});
it('should render all items', () => {
it('should render all items', async () => {
const recent = fixture.debugElement.queryAll(By.css(RECENT_ITEMS));
const favorite = fixture.debugElement.queryAll(By.css(FAV_ITEMS));
expect(history.items().recent[0].id).toBe('a');
expect(history.items().recent[1].id).toBe('b');
expect(recent.map((el) => el.nativeElement.innerText)).toEqual(['Item A', 'Item B']);
expect(favorite.map((el) => el.nativeElement.innerText)).toEqual(['Item C']);
});
@@ -113,7 +108,7 @@ describe('SearchHistoryComponent', () => {
);
firstRecent.nativeElement.click();
fixture.detectChanges();
TestBed.tick();
const recent = fixture.debugElement.queryAll(By.css(RECENT_ITEMS));
expect(recent.map((el) => el.nativeElement.innerText)).toEqual(['Item B']);
@@ -125,12 +120,12 @@ describe('SearchHistoryComponent', () => {
);
firstRecent.nativeElement.click();
fixture.detectChanges();
TestBed.tick();
const recent = fixture.debugElement.queryAll(By.css(RECENT_ITEMS));
expect(recent.map((el) => el.nativeElement.innerText)).toEqual(['Item B']);
const favorite = fixture.debugElement.queryAll(By.css(FAV_ITEMS));
expect(favorite.map((el) => el.nativeElement.innerText)).toEqual(['Item C', 'Item A']);
expect(favorite.map((el) => el.nativeElement.innerText)).toEqual(['Item A', 'Item C']);
});
});
@@ -1,5 +1,4 @@
load("//adev/shared-docs:defaults.bzl", "ng_project", "ts_project")
load("//tools:defaults2.bzl", "ng_web_test_suite", "sass_binary")
load("//adev/shared-docs:defaults.bzl", "ng_project", "sass_binary", "ts_project", "zoneless_web_test_suite")
package(default_visibility = ["//visibility:private"])
@@ -16,9 +15,9 @@ ng_project(
"//adev/shared-docs/components:__pkg__",
],
deps = [
"//packages/common:common_rjs",
"//packages/core:core_rjs",
"//packages/forms:forms_rjs",
"//adev:node_modules/@angular/common",
"//adev:node_modules/@angular/core",
"//adev:node_modules/@angular/forms",
],
)
@@ -35,12 +34,11 @@ ts_project(
),
deps = [
":select_rjs",
"//packages/core:core_rjs",
"//packages/core/testing:testing_rjs",
"//adev:node_modules/@angular/core",
],
)
ng_web_test_suite(
zoneless_web_test_suite(
name = "test",
deps = [":test_lib_rjs"],
)
@@ -1,5 +1,4 @@
load("//adev/shared-docs:defaults.bzl", "ng_project", "ts_project")
load("//tools:defaults2.bzl", "ng_web_test_suite", "sass_binary")
load("//adev/shared-docs:defaults.bzl", "ng_project", "sass_binary", "ts_project", "zoneless_web_test_suite")
package(default_visibility = ["//visibility:private"])
@@ -16,9 +15,9 @@ ng_project(
"//adev/shared-docs/components:__pkg__",
],
deps = [
"//packages/common:common_rjs",
"//packages/core:core_rjs",
"//packages/forms:forms_rjs",
"//adev:node_modules/@angular/common",
"//adev:node_modules/@angular/core",
"//adev:node_modules/@angular/forms",
],
)
@@ -35,12 +34,11 @@ ts_project(
),
deps = [
":slide-toggle_rjs",
"//packages/core:core_rjs",
"//packages/core/testing:testing_rjs",
"//adev:node_modules/@angular/core",
],
)
ng_web_test_suite(
zoneless_web_test_suite(
name = "test",
deps = [":test_lib_rjs"],
)
@@ -1,5 +1,4 @@
load("//adev/shared-docs:defaults.bzl", "ng_project", "ts_project")
load("//tools:defaults2.bzl", "ng_web_test_suite", "sass_binary")
load("//adev/shared-docs:defaults.bzl", "ng_project", "sass_binary", "ts_project", "zoneless_web_test_suite")
package(default_visibility = ["//visibility:private"])
@@ -17,12 +16,12 @@ ng_project(
"//adev/shared-docs/components/viewers:__pkg__",
],
deps = [
"//adev:node_modules/@angular/common",
"//adev:node_modules/@angular/core",
"//adev:node_modules/@angular/router",
"//adev/shared-docs/components/icon:icon_rjs",
"//adev/shared-docs/interfaces:interfaces_rjs",
"//adev/shared-docs/services:services_rjs",
"//packages/common:common_rjs",
"//packages/core:core_rjs",
"//packages/router:router_rjs",
],
)
@@ -42,17 +41,15 @@ ts_project(
),
deps = [
":table-of-contents_rjs",
"//adev:node_modules/@angular/core",
"//adev:node_modules/@angular/router",
"//adev/shared-docs/interfaces:interfaces_rjs",
"//adev/shared-docs/providers:providers_rjs",
"//adev/shared-docs/services:services_rjs",
"//packages/core:core_rjs",
"//packages/core/testing:testing_rjs",
"//packages/router:router_rjs",
"//packages/router/testing:testing_rjs",
],
)
ng_web_test_suite(
zoneless_web_test_suite(
name = "test",
deps = [":test_lib_rjs"],
)
@@ -8,7 +8,7 @@
import {ComponentFixture, TestBed} from '@angular/core/testing';
import {TableOfContents} from './table-of-contents.component';
import {RouterTestingModule} from '@angular/router/testing';
import {provideRouter} from '@angular/router';
import {TableOfContentsItem, TableOfContentsLevel} from '../../interfaces/index';
import {TableOfContentsLoader} from '../../services/index';
import {WINDOW} from '../../providers/index';
@@ -41,8 +41,9 @@ describe('TableOfContents', () => {
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [TableOfContents, RouterTestingModule],
imports: [TableOfContents],
providers: [
provideRouter([]),
provideZonelessChangeDetection(),
{
provide: WINDOW,
@@ -1,5 +1,4 @@
load("//adev/shared-docs:defaults.bzl", "ng_project", "ts_project")
load("//tools:defaults2.bzl", "ng_web_test_suite", "sass_binary")
load("//adev/shared-docs:defaults.bzl", "ng_project", "sass_binary", "ts_project", "zoneless_web_test_suite")
package(default_visibility = ["//visibility:private"])
@@ -17,10 +16,10 @@ ng_project(
"//adev/shared-docs/components/search-dialog:__pkg__",
],
deps = [
"//adev:node_modules/@angular/common",
"//adev:node_modules/@angular/core",
"//adev:node_modules/@angular/forms",
"//adev/shared-docs/components/icon:icon_rjs",
"//packages/common:common_rjs",
"//packages/core:core_rjs",
"//packages/forms:forms_rjs",
],
)
@@ -37,12 +36,11 @@ ts_project(
),
deps = [
":text-field_rjs",
"//packages/core:core_rjs",
"//packages/core/testing:testing_rjs",
"//adev:node_modules/@angular/core",
],
)
ng_web_test_suite(
zoneless_web_test_suite(
name = "test",
deps = [":test_lib_rjs"],
)
@@ -1,5 +1,4 @@
load("//adev/shared-docs:defaults.bzl", "ng_project", "ts_project")
load("//tools:defaults2.bzl", "ng_web_test_suite", "sass_binary")
load("//adev/shared-docs:defaults.bzl", "ng_project", "sass_binary", "ts_project", "zoneless_web_test_suite")
package(default_visibility = ["//visibility:private"])
@@ -16,11 +15,11 @@ ng_project(
"//adev/shared-docs/components:__pkg__",
],
deps = [
"//adev:node_modules/@angular/common",
"//adev:node_modules/@angular/core",
"//adev/shared-docs/components/icon:icon_rjs",
"//adev/shared-docs/directives:directives_rjs",
"//adev/shared-docs/providers:providers_rjs",
"//packages/common:common_rjs",
"//packages/core:core_rjs",
],
)
@@ -37,13 +36,12 @@ ts_project(
),
deps = [
":top-level-banner_rjs",
"//adev:node_modules/@angular/core",
"//adev/shared-docs/providers:providers_rjs",
"//packages/core:core_rjs",
"//packages/core/testing:testing_rjs",
],
)
ng_web_test_suite(
zoneless_web_test_suite(
name = "test",
deps = [":test_lib_rjs"],
)
+14 -19
View File
@@ -1,6 +1,4 @@
load("//adev/shared-docs:defaults.bzl", "ng_project", "ts_project")
load("//tools:defaults.bzl", "karma_web_test_suite")
load("//tools:defaults2.bzl", "sass_binary")
load("//adev/shared-docs:defaults.bzl", "ng_project", "sass_binary", "ts_project", "zoneless_web_test_suite")
package(default_visibility = ["//visibility:private"])
@@ -19,17 +17,17 @@ ng_project(
"//adev/shared-docs/components:__pkg__",
],
deps = [
"//:node_modules/@angular/cdk",
"//:node_modules/@angular/material",
"//:node_modules/rxjs",
"//adev:node_modules/@angular/cdk",
"//adev:node_modules/@angular/common",
"//adev:node_modules/@angular/core",
"//adev:node_modules/@angular/material",
"//adev:node_modules/@angular/router",
"//adev:node_modules/rxjs",
"//adev/shared-docs/components/breadcrumb:breadcrumb_rjs",
"//adev/shared-docs/components/copy-source-code-button:copy-source-code-button_rjs",
"//adev/shared-docs/components/table-of-contents:table-of-contents_rjs",
"//adev/shared-docs/interfaces:interfaces_rjs",
"//adev/shared-docs/providers:providers_rjs",
"//packages/common:common_rjs",
"//packages/core:core_rjs",
"//packages/router:router_rjs",
],
)
@@ -54,8 +52,11 @@ ts_project(
),
deps = [
":viewers_rjs",
"//:node_modules/@angular/cdk",
"//:node_modules/@angular/material",
"//adev:node_modules/@angular/cdk",
"//adev:node_modules/@angular/core",
"//adev:node_modules/@angular/material",
"//adev:node_modules/@angular/platform-browser",
"//adev:node_modules/@angular/router",
"//adev/shared-docs/components/breadcrumb:breadcrumb_rjs",
"//adev/shared-docs/components/copy-source-code-button:copy-source-code-button_rjs",
"//adev/shared-docs/components/icon:icon_rjs",
@@ -63,16 +64,10 @@ ts_project(
"//adev/shared-docs/interfaces:interfaces_rjs",
"//adev/shared-docs/providers:providers_rjs",
"//adev/shared-docs/services:services_rjs",
"//packages/core:core_rjs",
"//packages/core/testing:testing_rjs",
"//packages/platform-browser:platform-browser_rjs",
"//packages/platform-browser/animations:animations_rjs",
"//packages/router:router_rjs",
"//packages/router/testing:testing_rjs",
],
)
karma_web_test_suite(
zoneless_web_test_suite(
name = "test",
deps = [":test_lib"],
deps = [":test_lib_rjs"],
)
@@ -6,7 +6,7 @@
* found in the LICENSE file at https://angular.dev/license
*/
import {CommonModule, DOCUMENT, isPlatformBrowser, Location} from '@angular/common';
import {DOCUMENT, isPlatformBrowser, Location} from '@angular/common';
import {
ApplicationRef,
ChangeDetectionStrategy,
@@ -18,9 +18,7 @@ import {
EnvironmentInjector,
inject,
Injector,
Input,
PLATFORM_ID,
SimpleChanges,
Type,
ViewContainerRef,
ViewEncapsulation,
@@ -6,7 +6,7 @@
* found in the LICENSE file at https://angular.dev/license
*/
import {ComponentFixture, TestBed, waitForAsync} from '@angular/core/testing';
import {ComponentFixture, TestBed} from '@angular/core/testing';
import {ExampleViewer} from './example-viewer.component';
import {ExampleMetadata, ExampleViewerContentLoader} from '../../../interfaces';
import {EXAMPLE_VIEWER_CONTENT_LOADER} from '../../../providers';
@@ -48,7 +48,7 @@ describe('ExampleViewer', () => {
fixture.detectChanges();
});
it('should set file extensions as tab names when all files have different extension', waitForAsync(async () => {
it('should set file extensions as tab names when all files have different extension', async () => {
componentRef.setInput(
'metadata',
getMetadata({
@@ -66,9 +66,9 @@ describe('ExampleViewer', () => {
expect(component.tabs()![0].name).toBe('TS');
expect(component.tabs()![1].name).toBe('HTML');
expect(component.tabs()![2].name).toBe('CSS');
}));
});
it('should generate correct code content for multi file mode when it is expanded', waitForAsync(async () => {
it('should generate correct code content for multi file mode when it is expanded', async () => {
componentRef.setInput(
'metadata',
getMetadata({
@@ -86,7 +86,7 @@ describe('ExampleViewer', () => {
expect(component.tabs()![0].code).toBe('typescript file');
expect(component.tabs()![1].code).toBe('html file');
expect(component.tabs()![2].code).toBe('css file');
}));
});
it('should set file names as tab names when there is at least one duplication', async () => {
componentRef.setInput(
@@ -107,14 +107,14 @@ describe('ExampleViewer', () => {
expect(component.tabs()![2].name).toBe('another-example.ts');
});
it('should expand button not appear when there is no hidden line', waitForAsync(async () => {
it('should expand button not appear when there is no hidden line', async () => {
componentRef.setInput('metadata', getMetadata());
await component.renderExample();
const button = fixture.debugElement.query(By.css('button[aria-label="Expand code example"]'));
expect(button).toBeNull();
}));
});
it('should have line with hidden line class when expand button is present', waitForAsync(async () => {
it('should have line with hidden line class when expand button is present', async () => {
const expectedCodeSnippetContent =
'typescript code<br/>' + '<div class="line">hidden line</div>';
@@ -136,9 +136,9 @@ describe('ExampleViewer', () => {
const hiddenLine = fixture.debugElement.query(By.css('div[class="line hidden"]'));
expect(hiddenLine).toBeTruthy();
}));
});
it('should have no more line with hidden line class when expand button is clicked', waitForAsync(async () => {
it('should have no more line with hidden line class when expand button is clicked', async () => {
const expectedCodeSnippetContent =
'typescript code<br/>' + '<div class="line">hidden line</div>';
@@ -166,9 +166,9 @@ describe('ExampleViewer', () => {
const hiddenLine = fixture.debugElement.query(By.css('div[class="line hidden"]'));
expect(hiddenLine).toBeNull();
}));
});
it('should set exampleComponent when metadata contains path and preview is true', waitForAsync(async () => {
it('should set exampleComponent when metadata contains path and preview is true', async () => {
exampleContentSpy.loadPreview.and.resolveTo(ExampleComponent);
componentRef.setInput(
'metadata',
@@ -179,9 +179,9 @@ describe('ExampleViewer', () => {
);
await component.renderExample();
expect(component.exampleComponent).toBe(ExampleComponent);
}));
});
it('should display GitHub button when githubUrl is provided and there is preview', waitForAsync(async () => {
it('should display GitHub button when githubUrl is provided and there is preview', async () => {
exampleContentSpy.loadPreview.and.resolveTo(ExampleComponent);
componentRef.setInput(
'metadata',
@@ -199,9 +199,9 @@ describe('ExampleViewer', () => {
);
expect(githubButton).toBeTruthy();
expect(githubButton.nativeElement.href).toBe(component.githubUrl);
}));
});
it('should display StackBlitz button when stackblitzUrl is provided and there is preview', waitForAsync(async () => {
it('should display StackBlitz button when stackblitzUrl is provided and there is preview', async () => {
exampleContentSpy.loadPreview.and.resolveTo(ExampleComponent);
componentRef.setInput(
'metadata',
@@ -219,9 +219,9 @@ describe('ExampleViewer', () => {
);
expect(stackblitzButton).toBeTruthy();
expect(stackblitzButton.nativeElement.href).toBe(component.stackblitzUrl);
}));
});
it('should set expanded flag in metadata after toggleExampleVisibility', waitForAsync(async () => {
it('should set expanded flag in metadata after toggleExampleVisibility', async () => {
componentRef.setInput('metadata', getMetadata());
await component.renderExample();
component.toggleExampleVisibility();
@@ -231,10 +231,10 @@ describe('ExampleViewer', () => {
expect(await tab.getLabel()).toBe('TS');
component.toggleExampleVisibility();
expect(component.expanded()).toBeFalse();
}));
});
// TODO(josephperrott): enable once the docs-viewer/example-viewer circle is sorted out.
xit('should call clipboard service when clicked on copy source code', waitForAsync(async () => {
xit('should call clipboard service when clicked on copy source code', async () => {
const expectedCodeSnippetContent = 'typescript code';
componentRef.setInput(
'metadata',
@@ -256,9 +256,9 @@ describe('ExampleViewer', () => {
button.click();
expect(spy.calls.argsFor(0)[0]?.trim()).toBe(expectedCodeSnippetContent);
}));
});
it('should call clipboard service when clicked on copy example link', waitForAsync(async () => {
it('should call clipboard service when clicked on copy example link', async () => {
componentRef.setInput('metadata', getMetadata());
component.expanded.set(true);
fixture.detectChanges();
@@ -270,8 +270,8 @@ describe('ExampleViewer', () => {
By.css('button.docs-example-copy-link'),
).nativeElement;
button.click();
expect(spy.calls.argsFor(0)[0].trim()).toBe(`${window.origin}/context.html#example-1`);
}));
expect(spy.calls.argsFor(0)[0].trim()).toBe(`${window.location.href}#example-1`);
});
});
const getMetadata = (value: Partial<ExampleMetadata> = {}): ExampleMetadata => {
+50 -3
View File
@@ -1,25 +1,72 @@
load("//tools:defaults2.bzl", _ng_project = "ng_project", _ts_project = "ts_project")
load("@aspect_bazel_lib//lib:copy_to_bin.bzl", _copy_to_bin = "copy_to_bin")
load("@aspect_bazel_lib//lib:copy_to_directory.bzl", _copy_to_directory = "copy_to_directory")
load("@aspect_rules_esbuild//esbuild:defs.bzl", _esbuild = "esbuild")
load("@devinfra//bazel/private:path_relative_to_label.bzl", _path_relative_to_label = "path_relative_to_label")
load(
"//tools:defaults2.bzl",
_jasmine_test = "jasmine_test",
_js_binary = "js_binary",
_js_library = "js_library",
_js_run_binary = "js_run_binary",
_ng_package = "ng_package",
_ng_project = "ng_project",
_sass_binary = "sass_binary",
_sass_library = "sass_library",
_ts_config = "ts_config",
_ts_project = "ts_project",
_zoneless_jasmine_test = "zoneless_jasmine_test",
_zoneless_web_test_suite = "zoneless_web_test_suite",
)
def ts_project(name, tsconfig = None, testonly = False, **kwargs):
ts_config = _ts_config
ng_package = _ng_package
jasmine_test = _jasmine_test
sass_binary = _sass_binary
sass_library = _sass_library
copy_to_bin = _copy_to_bin
copy_to_directory = _copy_to_directory
esbuild = _esbuild
js_binary = _js_binary
js_library = _js_library
js_run_binary = _js_run_binary
path_relative_to_label = _path_relative_to_label
zoneless_jasmine_test = _zoneless_jasmine_test
def ts_project(name, tsconfig = None, testonly = False, enable_runtime_rnjs_interop = False, **kwargs):
if tsconfig == None:
if native.package_name().startswith("adev/shared-docs"):
tsconfig = "//adev/shared-docs:tsconfig_test" if testonly else "//adev/shared-docs:tsconfig_build"
_ts_project(
name = name,
enable_runtime_rnjs_interop = enable_runtime_rnjs_interop,
tsconfig = tsconfig,
testonly = testonly,
**kwargs
)
def ng_project(name, tsconfig = None, testonly = False, **kwargs):
def ng_project(name, tsconfig = None, testonly = False, enable_runtime_rnjs_interop = False, **kwargs):
if tsconfig == None:
if native.package_name().startswith("adev/shared-docs"):
tsconfig = "//adev/shared-docs:tsconfig_test" if testonly else "//adev/shared-docs:tsconfig_build"
_ng_project(
name = name,
enable_runtime_rnjs_interop = enable_runtime_rnjs_interop,
tsconfig = tsconfig,
testonly = testonly,
**kwargs
)
def zoneless_web_test_suite(deps = [], **kwargs):
# Provide required modules for the imports in //tools/testing/browser_tests.init.mts
deps = deps + [
"//:node_modules/@angular/compiler",
"//:node_modules/@angular/core",
"//:node_modules/@angular/platform-browser",
]
_zoneless_web_test_suite(
deps = deps,
tsconfig = "//adev/shared-docs:tsconfig_test",
**kwargs
)
@@ -1,5 +1,4 @@
load("//adev/shared-docs:defaults.bzl", "ng_project", "ts_project")
load("//tools:defaults2.bzl", "ng_web_test_suite")
load("//adev/shared-docs:defaults.bzl", "ng_project", "ts_project", "zoneless_web_test_suite")
package(default_visibility = ["//visibility:private"])
@@ -12,8 +11,8 @@ ng_project(
"//adev/shared-docs/directives:__pkg__",
],
deps = [
"//packages/common:common_rjs",
"//packages/core:core_rjs",
"//adev:node_modules/@angular/common",
"//adev:node_modules/@angular/core",
],
)
@@ -25,15 +24,13 @@ ts_project(
),
deps = [
":click-outside_rjs",
"//packages/core:core_rjs",
"//packages/core/testing:testing_rjs",
"//packages/platform-browser:platform-browser_rjs",
"//packages/router:router_rjs",
"//packages/router/testing:testing_rjs",
"//adev:node_modules/@angular/core",
"//adev:node_modules/@angular/platform-browser",
"//adev:node_modules/@angular/router",
],
)
ng_web_test_suite(
zoneless_web_test_suite(
name = "test",
deps = [":test_lib_rjs"],
)
@@ -8,7 +8,7 @@
import {Component} from '@angular/core';
import {ComponentFixture, TestBed} from '@angular/core/testing';
import {RouterTestingModule} from '@angular/router/testing';
import {provideRouter} from '@angular/router';
import {ClickOutside} from './click-outside.directive';
import {By} from '@angular/platform-browser';
@@ -18,7 +18,8 @@ describe('ClickOutside', () => {
beforeEach(() => {
TestBed.configureTestingModule({
imports: [ExampleComponent, RouterTestingModule],
imports: [ExampleComponent],
providers: [provideRouter([])],
});
fixture = TestBed.createComponent(ExampleComponent);
component = fixture.componentInstance;
@@ -1,5 +1,4 @@
load("//adev/shared-docs:defaults.bzl", "ng_project", "ts_project")
load("//tools:defaults2.bzl", "ng_web_test_suite")
load("//adev/shared-docs:defaults.bzl", "ng_project", "ts_project", "zoneless_web_test_suite")
package(default_visibility = ["//visibility:private"])
@@ -12,11 +11,11 @@ ng_project(
"//adev/shared-docs/directives:__pkg__",
],
deps = [
"//adev:node_modules/@angular/common",
"//adev:node_modules/@angular/core",
"//adev:node_modules/@angular/router",
"//adev/shared-docs/providers:providers_rjs",
"//adev/shared-docs/utils:utils_rjs",
"//packages/common:common_rjs",
"//packages/core:core_rjs",
"//packages/router:router_rjs",
],
)
@@ -28,16 +27,14 @@ ts_project(
),
deps = [
":external-link_rjs",
"//adev:node_modules/@angular/core",
"//adev:node_modules/@angular/platform-browser",
"//adev:node_modules/@angular/router",
"//adev/shared-docs/providers:providers_rjs",
"//packages/core:core_rjs",
"//packages/core/testing:testing_rjs",
"//packages/platform-browser:platform-browser_rjs",
"//packages/router:router_rjs",
"//packages/router/testing:testing_rjs",
],
)
ng_web_test_suite(
zoneless_web_test_suite(
name = "test",
deps = [":test_lib_rjs"],
)
@@ -8,10 +8,9 @@
import {Component} from '@angular/core';
import {ExternalLink} from './external-link.directive';
import {RouterLink} from '@angular/router';
import {provideRouter, RouterLink} from '@angular/router';
import {ComponentFixture, TestBed} from '@angular/core/testing';
import {WINDOW} from '../../providers';
import {RouterTestingModule} from '@angular/router/testing';
import {By} from '@angular/platform-browser';
describe('ExternalLink', () => {
@@ -24,8 +23,9 @@ describe('ExternalLink', () => {
beforeEach(() => {
TestBed.configureTestingModule({
imports: [ExampleComponentWithLinks, RouterTestingModule],
imports: [ExampleComponentWithLinks],
providers: [
provideRouter([]),
{
provide: WINDOW,
useValue: fakeWindow,
@@ -11,8 +11,8 @@ ng_project(
"//adev/shared-docs/directives:__pkg__",
],
deps = [
"//:node_modules/@angular/cdk",
"//adev:node_modules/@angular/cdk",
"//adev:node_modules/@angular/core",
"//adev/shared-docs/interfaces:interfaces_rjs",
"//packages/core:core_rjs",
],
)
+4 -4
View File
@@ -25,9 +25,9 @@ ts_project(
],
),
deps = [
"//:node_modules/@types/node",
"//:node_modules/@webcontainer/api",
"//packages/core:core_rjs",
"//packages/router:router_rjs",
"//adev:node_modules/@angular/core",
"//adev:node_modules/@angular/router",
"//adev:node_modules/@types/node",
"//adev:node_modules/@webcontainer/api",
],
)
@@ -15,4 +15,5 @@ export interface NavigationItem {
level?: number;
parent?: NavigationItem;
contentPath?: string;
status?: 'new' | 'updated';
}
+1 -1
View File
@@ -20,7 +20,7 @@
"fflate": "^0.8.2",
"html-entities": "~2.6.0",
"jsdom": "~26.1.0",
"marked": "~16.0.0",
"marked": "~16.1.0",
"mermaid": "^11.0.0",
"shiki": "^3.0.0",
"tinyglobby": "^0.2.12"
+21 -113
View File
@@ -1,10 +1,4 @@
load("@aspect_rules_js//js:defs.bzl", "js_library")
load("@build_bazel_rules_nodejs//:index.bzl", "nodejs_binary")
# BEGIN-DEV-ONLY
# This section is only used here in the dev-infra repo as the resulting bundle is published in
# the package.
load("//tools:defaults.bzl", "esbuild_esm_bundle")
load("//adev/shared-docs:defaults.bzl", "js_binary", "js_library")
package(default_visibility = ["//adev/shared-docs/pipeline:__subpackages__"])
@@ -13,90 +7,6 @@ js_library(
srcs = ["esbuild.config.mjs"],
)
esbuild_esm_bundle(
name = "stackblitz-bundle",
entry_point = "//adev/shared-docs/pipeline/examples/stackblitz:index.mts",
# JSDOM should not be bundled because it has workers and dynamic imports.
external = ["jsdom"],
metafile = False,
output = "stackblitz.mjs",
platform = "node",
target = "es2022",
visibility = ["//visibility:public"],
deps = [
"//adev/shared-docs/pipeline/examples/stackblitz:index",
],
)
esbuild_esm_bundle(
name = "previews-bundle",
entry_point = "//adev/shared-docs/pipeline/examples/previews:index.mts",
external = [
"typescript",
],
metafile = False,
output = "previews.mjs",
platform = "node",
target = "es2022",
visibility = ["//visibility:public"],
deps = [
"//adev/shared-docs/pipeline/examples/previews:index",
"@npm//typescript",
],
)
esbuild_esm_bundle(
name = "zip-bundle",
entry_point = "//adev/shared-docs/pipeline/examples/zip:index.mts",
metafile = False,
output = "zip.mjs",
platform = "node",
target = "es2022",
visibility = ["//visibility:public"],
deps = [
"//adev/shared-docs/pipeline/examples/zip:index",
],
)
esbuild_esm_bundle(
name = "playground-bundle",
entry_point = "//adev/shared-docs/pipeline/tutorials:playground.mts",
metafile = False,
output = "playground.mjs",
platform = "node",
target = "es2022",
visibility = ["//visibility:public"],
deps = [
"//adev/shared-docs/pipeline/tutorials:playground",
],
)
esbuild_esm_bundle(
name = "tutorial-bundle",
entry_point = "//adev/shared-docs/pipeline/tutorials:tutorial.mts",
metafile = False,
output = "tutorial.mjs",
platform = "node",
target = "es2022",
visibility = ["//visibility:public"],
deps = [
"//adev/shared-docs/pipeline/tutorials",
],
)
esbuild_esm_bundle(
name = "navigation-bundle",
entry_point = "//adev/shared-docs/pipeline/navigation:index.mts",
metafile = False,
output = "navigation.mjs",
platform = "node",
target = "es2022",
visibility = ["//visibility:public"],
deps = [
"//adev/shared-docs/pipeline/navigation",
],
)
exports_files([
"_guides.bzl",
"_stackblitz.bzl",
@@ -107,38 +17,36 @@ exports_files([
"BUILD.bazel",
])
# END-DEV-ONLY
nodejs_binary(
js_binary(
name = "stackblitz",
data = [
"@npm//jsdom",
"//adev:node_modules/jsdom",
],
entry_point = "//adev/shared-docs/pipeline:stackblitz.mjs",
entry_point = "//adev/shared-docs/pipeline/examples/stackblitz:stackblitz.mjs",
visibility = ["//visibility:public"],
)
nodejs_binary(
js_binary(
name = "previews",
data = [
"@npm//typescript",
"//adev:node_modules/typescript",
],
entry_point = "//adev/shared-docs/pipeline:previews.mjs",
entry_point = "//adev/shared-docs/pipeline/examples/previews:previews.mjs",
visibility = ["//visibility:public"],
)
nodejs_binary(
js_binary(
name = "zip",
entry_point = "//adev/shared-docs/pipeline:zip.mjs",
entry_point = "//adev/shared-docs/pipeline/examples/zip:zip.mjs",
visibility = ["//visibility:public"],
)
nodejs_binary(
js_binary(
name = "markdown",
data = [
"@npm//jsdom",
"@npm//mermaid",
"@npm//playwright-core",
"//adev:node_modules/jsdom",
"//adev:node_modules/mermaid",
"//adev:node_modules/playwright-core",
"@rules_browsers//src/browsers/chromium",
],
entry_point = "//adev/shared-docs/pipeline/guides:guides.mjs",
@@ -149,29 +57,29 @@ nodejs_binary(
visibility = ["//visibility:public"],
)
nodejs_binary(
js_binary(
name = "markdown_no_mermaid",
data = [
"@npm//jsdom",
"//adev:node_modules/jsdom",
],
entry_point = "//adev/shared-docs/pipeline/guides:guides-no-mermaid.mjs",
visibility = ["//visibility:public"],
)
nodejs_binary(
js_binary(
name = "playground",
entry_point = "//adev/shared-docs/pipeline:playground.mjs",
entry_point = "//adev/shared-docs/pipeline/tutorials:playground.mjs",
visibility = ["//visibility:public"],
)
nodejs_binary(
js_binary(
name = "tutorial",
entry_point = "//adev/shared-docs/pipeline:tutorial.mjs",
entry_point = "//adev/shared-docs/pipeline/tutorials:tutorial.mjs",
visibility = ["//visibility:public"],
)
nodejs_binary(
js_binary(
name = "navigation",
entry_point = "//adev/shared-docs/pipeline:navigation.mjs",
entry_point = "//adev/shared-docs/pipeline/navigation:navigation.mjs",
visibility = ["//visibility:public"],
)
+12 -10
View File
@@ -1,5 +1,4 @@
load("@build_bazel_rules_nodejs//:providers.bzl", "run_node")
load("@devinfra//bazel/private:path_relative_to_label.bzl", "path_relative_to_label")
load("//adev/shared-docs:defaults.bzl", "path_relative_to_label")
def _generate_guides(ctx):
"""Implementation of the markdown rule"""
@@ -30,23 +29,26 @@ def _generate_guides(ctx):
# For each input file "xxx.md", we want to write an output file "xxx.html"
html_outputs += [ctx.actions.declare_file("%s.html" % relative_basepath)]
# Define an action that runs the nodejs_binary executable. This is the main thing that this
# rule does. If mermaid blocks are enabled then a different executable is used.
# Define an action that runs the executable.
if (ctx.attr.mermaid_blocks):
run_node(
ctx = ctx,
ctx.actions.run(
inputs = depset(ctx.files.srcs + ctx.files.data),
executable = "_generate_guides",
executable = ctx.executable._generate_guides,
outputs = html_outputs,
arguments = [args],
env = {
"BAZEL_BINDIR": ".",
},
)
else:
run_node(
ctx = ctx,
ctx.actions.run(
inputs = depset(ctx.files.srcs + ctx.files.data),
executable = "_generate_guides_no_mermaid",
executable = ctx.executable._generate_guides_no_mermaid,
outputs = html_outputs,
arguments = [args],
env = {
"BAZEL_BINDIR": ".",
},
)
# The return value describes what the rule is producing. In this case we need to specify
+5 -5
View File
@@ -1,5 +1,3 @@
load("@build_bazel_rules_nodejs//:providers.bzl", "run_node")
def _generate_nav_items(ctx):
"""Implementation of the navigation items data generator rule"""
@@ -25,12 +23,14 @@ def _generate_nav_items(ctx):
# Add the path to the output file to the arguments.
args.add(json_output.path)
run_node(
ctx = ctx,
ctx.actions.run(
inputs = depset(ctx.files.srcs),
executable = "_generate_nav_items",
executable = ctx.executable._generate_nav_items,
outputs = [json_output],
arguments = [args],
env = {
"BAZEL_BINDIR": ".",
},
)
# The return value describes what the rule is producing. In this case we need to specify
+5 -5
View File
@@ -1,5 +1,3 @@
load("@build_bazel_rules_nodejs//:providers.bzl", "run_node")
def _generate_playground(ctx):
"""Implementation of the playground generator rule"""
@@ -29,12 +27,14 @@ def _generate_playground(ctx):
ctx.runfiles(files = ctx.files.common_srcs)
run_node(
ctx = ctx,
ctx.actions.run(
inputs = depset(ctx.files.playground_srcs + ctx.files.common_srcs),
executable = "_generate_playground",
executable = ctx.executable._generate_playground,
outputs = [playground_directory],
arguments = [args],
env = {
"BAZEL_BINDIR": ".",
},
)
# The return value describes what the rule is producing. In this case we need to specify
+9 -7
View File
@@ -1,5 +1,3 @@
load("@build_bazel_rules_nodejs//:providers.bzl", "run_node")
def _generate_previews_impl(ctx):
"""Implementation of the previews generator rule"""
@@ -9,8 +7,10 @@ def _generate_previews_impl(ctx):
# Set the arguments for the actions inputs and out put location.
args = ctx.actions.args()
# Path to the examples for which previews are being generated.
args.add(ctx.attr.example_srcs.label.package)
# Path to the examples for which previews are being generated. Because examples are
# generated files, we need to look in the bin_dir subpath for them instead of the
# execPath
args.add("{}/{}".format(ctx.bin_dir.path, ctx.attr.example_srcs.label.package))
# Path to the preview map template.
args.add(ctx.file._template_src)
@@ -20,12 +20,14 @@ def _generate_previews_impl(ctx):
ctx.runfiles(files = ctx.files._template_src)
run_node(
ctx = ctx,
ctx.actions.run(
inputs = depset(ctx.files.example_srcs + ctx.files._template_src),
executable = "_generate_previews",
executable = ctx.executable._generate_previews,
outputs = [ts_output],
arguments = [args],
env = {
"BAZEL_BINDIR": ".",
},
)
# The return value describes what the rule is producing. In this case we need to specify
+5 -4
View File
@@ -1,5 +1,3 @@
load("@build_bazel_rules_nodejs//:providers.bzl", "run_node")
def _generate_stackblitz(ctx):
"""Implementation of the stackblitz generator rule"""
@@ -35,12 +33,15 @@ def _generate_stackblitz(ctx):
ctx.runfiles(files = ctx.files.template_srcs)
run_node(
ctx.actions.run(
ctx = ctx,
inputs = depset(ctx.files.example_srcs + ctx.files.template_srcs),
executable = "_generate_stackblitz",
executable = ctx.executable._generate_stackblitz,
outputs = [html_output, tmp_directory],
arguments = [args],
env = {
"BAZEL_BINDIR": ".",
},
)
# The return value describes what the rule is producing. In this case we need to specify
+5 -5
View File
@@ -1,5 +1,3 @@
load("@build_bazel_rules_nodejs//:providers.bzl", "run_node")
def _generate_tutorial(ctx):
"""Implementation of the tutorial generator rule"""
@@ -29,12 +27,14 @@ def _generate_tutorial(ctx):
ctx.runfiles(files = ctx.files.common_srcs)
run_node(
ctx = ctx,
ctx.actions.run(
inputs = depset(ctx.files.tutorial_srcs + ctx.files.common_srcs),
executable = "_generate_tutorial",
executable = ctx.executable._generate_tutorial,
outputs = [tutorial_directory],
arguments = [args],
env = {
"BAZEL_BINDIR": ".",
},
)
# The return value describes what the rule is producing. In this case we need to specify
+5 -4
View File
@@ -1,5 +1,3 @@
load("@build_bazel_rules_nodejs//:providers.bzl", "run_node")
def _generate_zip(ctx):
"""Implementation of the zip generator rule"""
@@ -35,12 +33,15 @@ def _generate_zip(ctx):
ctx.runfiles(files = ctx.files.template_srcs)
run_node(
ctx.actions.run(
ctx = ctx,
inputs = depset(ctx.files.example_srcs + ctx.files.template_srcs),
executable = "_generate_zip",
executable = ctx.executable._generate_zip,
outputs = [zip_output, tmp_directory],
arguments = [args],
env = {
"BAZEL_BINDIR": ".",
},
)
# The return value describes what the rule is producing. In this case we need to specify
@@ -1,5 +1,4 @@
load("@aspect_rules_js//js:defs.bzl", "js_binary")
load("//adev/shared-docs:defaults.bzl", "ts_project")
load("//adev/shared-docs:defaults.bzl", "js_binary", "ts_project")
package(default_visibility = ["//adev/shared-docs/pipeline/api-gen:__subpackages__"])
@@ -15,9 +14,8 @@ ts_project(
# TODO(rules_js): Explore how this could work alternatively at runtime with the module names.
"//adev/shared-docs/pipeline/api-gen:node_modules/@angular/compiler-cli",
"//adev/shared-docs/pipeline/api-gen:node_modules/@angular/compiler",
"//:node_modules/@bazel/runfiles",
"//:node_modules/@types/node",
"//:node_modules/typescript",
"//adev:node_modules/@types/node",
"//adev:node_modules/typescript",
],
)
@@ -31,9 +31,6 @@ def _extract_api_to_json(ctx):
args.add(json_output.path)
# Pass the import path map
# TODO: consider module_mappings_aspect to deal with path mappings instead of manually
# specifying them
# https://github.com/bazelbuild/rules_nodejs/blob/5.x/internal/linker/link_node_modules.bzl#L236
path_map = {}
for target, path in ctx.attr.import_map.items():
files = target.files.to_list()
@@ -45,8 +42,7 @@ def _extract_api_to_json(ctx):
# Pass the set of (optional) extra entries
args.add_joined(ctx.files.extra_entries, join_with = ",")
# Define an action that runs the nodejs_binary executable. This is
# the main thing that this rule does.
# Define an action that runs the executable.
ctx.actions.run(
inputs = depset(ctx.files.srcs + ctx.files.extra_entries),
executable = ctx.executable._extract_api_to_json,
@@ -125,7 +125,7 @@ function getEntriesFromMembers(entry: DocEntry): string[] {
}
function hasMembers(entry: DocEntry): entry is InterfaceEntry | ClassEntry {
return 'members' in entry;
return 'members' in entry && Array.isArray(entry.members);
}
main();
@@ -1,6 +1,5 @@
load("//adev/shared-docs:defaults.bzl", "ts_project")
load("//adev/shared-docs:defaults.bzl", "ts_project", "zoneless_jasmine_test")
load("//adev/shared-docs/pipeline/api-gen/extraction:extract_api_to_json.bzl", "extract_api_to_json")
load("//tools:defaults2.bzl", "jasmine_test")
package(default_visibility = ["//adev/shared-docs/pipeline/api-gen:__subpackages__"])
@@ -51,16 +50,14 @@ ts_project(
glob(["*.spec.mts"]) + [
"fake-examples.mts",
],
interop_deps = [
"@angular//packages/compiler-cli",
],
deps = [
"//:node_modules/@types/node",
"//adev:node_modules/@angular/compiler-cli",
"//adev:node_modules/@types/node",
"//adev/shared-docs/pipeline/api-gen/extraction:extract_api_to_json_lib_rjs",
],
)
jasmine_test(
zoneless_jasmine_test(
name = "unit_tests",
data = [":unit_test_lib_rjs"],
)
@@ -1,50 +1,39 @@
load("@angular//tools/esm-interop:index.bzl", "nodejs_binary")
load("@devinfra//bazel/esbuild:index.bzl", "esbuild_esm_bundle")
load("//adev/shared-docs:defaults.bzl", "ts_project")
load("//adev/shared-docs:defaults.bzl", "esbuild", "js_binary", "ts_project")
package(default_visibility = ["//adev/shared-docs/pipeline/api-gen:__subpackages__"])
esbuild_esm_bundle(
esbuild(
name = "bin",
entry_point = ":index.mts",
external = [
"@angular/compiler-cli",
],
metafile = False,
format = "esm",
output = "bin.mjs",
platform = "node",
target = "es2022",
deps = [
":generate_api_manifest_lib",
"@angular//packages/compiler-cli",
":generate_api_manifest_lib_rjs",
"//adev:node_modules/@angular/compiler-cli",
],
)
ts_project(
name = "generate_api_manifest_lib",
srcs = glob(["**/*.mts"]),
interop_deps = [
"@angular//packages/compiler-cli",
],
deps = [
"//:node_modules/@bazel/runfiles",
"//:node_modules/@types/node",
"//adev:node_modules/@angular/compiler-cli",
"//adev:node_modules/@types/node",
],
)
# Action binary for the api_gen bazel rule.
nodejs_binary(
js_binary(
name = "generate_api_manifest",
data = [
":bin",
"@angular//packages/compiler-cli",
],
entry_point = "bin.mjs",
# Note: Using the linker here as we need it for ESM. The linker is not
# super reliably when running concurrently on Windows- but we have existing
# actions using the linker. An alternative would be to:
# - bundle the Angular compiler into a CommonJS bundle
# - use the patched resolution- but also patch the ESM imports (similar to how FW does it).
visibility = ["//visibility:public"],
)
@@ -1,5 +1,3 @@
load("@build_bazel_rules_nodejs//:providers.bzl", "run_node")
def _generate_api_manifest(ctx):
"""Implementation of the generate_api_manifest rule"""
@@ -17,14 +15,15 @@ def _generate_api_manifest(ctx):
manifest = ctx.actions.declare_file("manifest.json")
args.add(manifest.path)
# Define an action that runs the nodejs_binary executable. This is
# the main thing that this rule does.
run_node(
ctx = ctx,
# Define an action that runs the executable.
ctx.actions.run(
inputs = depset(ctx.files.srcs),
executable = "_generate_api_manifest",
executable = ctx.executable._generate_api_manifest,
outputs = [manifest],
arguments = [args],
env = {
"BAZEL_BINDIR": ".",
},
)
# The return value describes what the rule is producing. In this case we need to specify
@@ -1,7 +1,6 @@
load("//adev/shared-docs:defaults.bzl", "ts_project")
load("//adev/shared-docs:defaults.bzl", "ts_project", "zoneless_jasmine_test")
load("//adev/shared-docs/pipeline/api-gen/extraction:extract_api_to_json.bzl", "extract_api_to_json")
load("//adev/shared-docs/pipeline/api-gen/manifest:generate_api_manifest.bzl", "generate_api_manifest")
load("//tools:defaults2.bzl", "jasmine_test")
generate_api_manifest(
name = "test",
@@ -27,15 +26,13 @@ ts_project(
srcs = [
"manifest.spec.mts",
],
interop_deps = [
"//packages/compiler-cli",
],
deps = [
"//adev:node_modules/@angular/compiler-cli",
"//adev/shared-docs/pipeline/api-gen/manifest:generate_api_manifest_lib_rjs",
],
)
jasmine_test(
zoneless_jasmine_test(
name = "unit_tests",
data = [
":unit_test_lib_rjs",
@@ -1,18 +1,16 @@
load("@build_bazel_rules_nodejs//:index.bzl", "nodejs_binary")
load("@devinfra//bazel/esbuild:index.bzl", "esbuild_esm_bundle")
load("//adev/shared-docs:defaults.bzl", "ts_project")
load("//adev/shared-docs:defaults.bzl", "esbuild", "js_binary", "ts_project")
package(default_visibility = ["//adev/shared-docs/pipeline/api-gen:__subpackages__"])
esbuild_esm_bundle(
esbuild(
name = "bin",
entry_point = ":index.mts",
metafile = False,
format = "esm",
output = "bin.mjs",
platform = "node",
target = "es2022",
deps = [
":render_api_to_html_lib",
":render_api_to_html_lib_rjs",
],
)
@@ -28,16 +26,16 @@ ts_project(
"entities.mts",
],
),
enable_runtime_rnjs_interop = True,
deps = [
":entities_rjs",
"//:node_modules/@bazel/runfiles",
"//:node_modules/@types/node",
"//:node_modules/html-entities",
"//:node_modules/marked",
"//:node_modules/preact",
"//:node_modules/preact-render-to-string",
"//:node_modules/prettier",
"//:node_modules/shiki",
"//adev:node_modules/@types/node",
"//adev:node_modules/html-entities",
"//adev:node_modules/marked",
"//adev:node_modules/preact",
"//adev:node_modules/preact-render-to-string",
"//adev:node_modules/prettier",
"//adev:node_modules/shiki",
],
)
@@ -53,7 +51,7 @@ ts_project(
)
# Action binary for the api_gen bazel rule.
nodejs_binary(
js_binary(
name = "render_api_to_html",
data = [
":render_api_to_html_lib",
@@ -62,8 +60,7 @@ nodejs_binary(
# Do not use the NodeJS linker because:
# - it's brittle and causes race conditions on Windows.
# - it requires additional work to setup the runtime linker.
templated_args = [
"--bazel_patch_module_resolver",
fixed_args = [
"--node_options=--preserve-symlinks-main",
],
visibility = ["//visibility:public"],
@@ -120,7 +120,11 @@ export interface EnumEntry extends DocEntry {
/** Documentation entity for an Angular decorator. */
export interface DecoratorEntry extends DocEntry {
decoratorType: DecoratorType;
members: PropertyEntry[];
signatures?: {
parameters: ParameterEntry[];
jsdocTags: JsDocTagEntry[];
}[];
members: MemberEntry[];
}
/** Documentation entity for an Angular directives and components. */
@@ -142,7 +142,10 @@ export function isDeprecatedEntry<T extends HasJsDocTags>(entry: T): boolean {
}
export function getDeprecatedEntry<T extends HasJsDocTags>(entry: T) {
return entry.jsdocTags.find((tag) => tag.name === 'deprecated')?.comment ?? null;
const comment = entry.jsdocTags.find((tag) => tag.name === 'deprecated')?.comment;
// Dropping the eventual version number in front of the comment.
return comment?.match(/(?:\d+(?:\.\d+)?\s*)?(.*)/s)?.[1] ?? null;
}
/** Gets whether the given entry has a given JsDoc tag. */
@@ -70,11 +70,7 @@ export type PipeEntryRenderable = PipeEntry &
members: MemberEntryRenderable[];
};
export type DecoratorEntryRenderable = DecoratorEntry &
DocEntryRenderable &
HasRenderableToc & {
members: MemberEntryRenderable[];
};
export type DecoratorEntryRenderable = DecoratorEntry & DocEntryRenderable & HasRenderableToc;
/** Documentation entity for a TypeScript enum augmented transformed content for rendering. */
export type EnumEntryRenderable = EnumEntry &
@@ -18,13 +18,15 @@ def _render_api_to_html(ctx):
args.add(html_output_directory.path)
outputs = [html_output_directory]
# Define an action that runs the nodejs_binary executable. This is
# the main thing that this rule does.
# Define an action that runs the executable.
ctx.actions.run(
inputs = depset(ctx.files.srcs),
executable = ctx.executable._render_api_to_html,
outputs = outputs,
arguments = [args],
env = {
"BAZEL_BINDIR": ".",
},
)
# The return value describes what the rule is producing. In this case we need to specify
@@ -19,7 +19,11 @@ import {
isInterfaceEntry,
isTypeAliasEntry,
} from './entities/categorization.mjs';
import {CliCommandRenderable, DocEntryRenderable} from './entities/renderables.mjs';
import {
ClassEntryRenderable,
CliCommandRenderable,
DocEntryRenderable,
} from './entities/renderables.mjs';
import {ClassReference} from './templates/class-reference';
import {CliCommandReference} from './templates/cli-reference';
import {ConstantReference} from './templates/constant-reference';
@@ -28,6 +32,7 @@ import {EnumReference} from './templates/enum-reference';
import {FunctionReference} from './templates/function-reference';
import {InitializerApiFunction} from './templates/initializer-api-function';
import {TypeAliasReference} from './templates/type-alias-reference';
import {DecoratorReference} from './templates/decorator-reference';
import {setCurrentSymbol} from './symbol-context.mjs';
/** Given a doc entry, get the transformed version of the entry for rendering. */
@@ -37,8 +42,11 @@ export function renderEntry(renderable: DocEntryRenderable | CliCommandRenderabl
return render(CliCommandReference(renderable));
}
if (isClassEntry(renderable) || isInterfaceEntry(renderable) || isDecoratorEntry(renderable)) {
return render(ClassReference(renderable));
if (isClassEntry(renderable) || isInterfaceEntry(renderable)) {
return render(ClassReference(renderable as ClassEntryRenderable));
}
if (isDecoratorEntry(renderable)) {
return render(DecoratorReference(renderable));
}
if (isConstantEntry(renderable)) {
return render(ConstantReference(renderable));
@@ -43,17 +43,36 @@ export function codeToHtml(code: string, language: string | undefined): string {
return html;
}
/**
* This function is used to post-process the HTML generated by Shiki
*/
export function replaceKeywordFromShikiHtml(
keyword: string,
shikiHtml: string,
replaceWith = '',
replaceWith: string,
): string {
return (
shikiHtml
// remove the leading space of the element after the "function" element
.replace(new RegExp(`(<[^>]*>${keyword}<\\/\\w+><[^>]*>)(\\s)(\\w+<\\/\\w+>)`, 'g'), '$1$3')
// Shiki requires the keyword function for highlighting functions signatures
// We don't want to display it so we remove elements with the keyword
.replace(new RegExp(`<[^>]*>${keyword}<\\/\\w+>`, 'g'), replaceWith)
// remove the leading space of the element after the keyword
.replace(
new RegExp(`(<[^>]*>(?:${keyword})<\\/\\w+><[^>]*>)(\\s)(\\w+<\\/\\w+>)`, 'g'),
'$1$3',
)
// Shiki requires the keywords (eg. function,interface) for highlighting signatures
// here we are replacing it
.replace(new RegExp(`<[^>]*>(?:${keyword})<\\/\\w+>`, 'g'), replaceWith)
);
}
export function insertParenthesesForDecoratorInShikiHtml(shikiHtml: string): string {
// TODO: Look if we can use JSDom instead of regex
return shikiHtml.replace(
// This will match a structure like this:
// @<span>decoratorName</span><span> {</span><span>...</span><span> }</span>
// and insert a parenthese around the curly braces
// @<span>decoratorName</span><span> ({</span><span>...</span><span> })</span>
/(@\s*<[^>]*>.*?<\/\w+>\s*<[^>]*>)(\s*\{)(<\/\w+>.*<[^>]*>)(\s*\})(<\/\w+>)/gms,
'$1({$3})$5',
);
}
@@ -8,11 +8,7 @@
import {Fragment, h} from 'preact';
import {PipeEntry} from '../entities.mjs';
import {
ClassEntryRenderable,
DecoratorEntryRenderable,
PipeEntryRenderable,
} from '../entities/renderables.mjs';
import {ClassEntryRenderable, PipeEntryRenderable} from '../entities/renderables.mjs';
import {ClassMemberList} from './class-member-list';
import {HeaderApi} from './header-api';
import {
@@ -26,11 +22,10 @@ import {SectionApi} from './section-api';
import {SectionHeading} from './section-heading';
import {codeToHtml} from '../shiki/shiki.mjs';
import {RawHtml} from './raw-html';
import {DeprecationWarning} from './deprecation-warning';
/** Component to render a class API reference document. */
export function ClassReference(
entry: ClassEntryRenderable | DecoratorEntryRenderable | PipeEntryRenderable,
) {
export function ClassReference(entry: ClassEntryRenderable | PipeEntryRenderable) {
return (
<div className={API_REFERENCE_CONTAINER}>
<HeaderApi entry={entry} />
@@ -44,6 +39,7 @@ export function ClassReference(
) : (
''
)}
<DeprecationWarning entry={entry} />
<SectionApi entry={entry} />
{entry.members.length > 0 ? (
<div class={REFERENCE_MEMBERS}>
@@ -22,25 +22,27 @@ export function CliCommandReference(entry: CliCommandRenderable) {
<HeaderCli command={entry} />
{[entry.name, ...entry.aliases].map((command) => (
<div class="docs-code docs-reference-cli-toc">
<code>
<div className={'shiki line cli'}>
ng {commandName(entry, command)}
{entry.argumentsLabel ? (
<button member-id={'Arguments'} className="shiki-ln-line-argument">
{entry.argumentsLabel}
</button>
) : (
<></>
)}
{entry.hasOptions ? (
<button member-id={'Options'} className="shiki-ln-line-option">
[options]
</button>
) : (
<></>
)}
</div>
</code>
<pre class="docs-mini-scroll-track">
<code>
<div className={'shiki line cli'}>
ng {commandName(entry, command)}
{entry.argumentsLabel ? (
<button member-id={'Arguments'} className="shiki-ln-line-argument">
{entry.argumentsLabel}
</button>
) : (
<></>
)}
{entry.hasOptions ? (
<button member-id={'Options'} className="shiki-ln-line-option">
[options]
</button>
) : (
<></>
)}
</div>
</code>
</pre>
</div>
))}
<RawHtml value={entry.htmlDescription} />
@@ -13,12 +13,14 @@ import {SectionDescription} from './section-description';
import {SectionUsageNotes} from './section-usage-notes';
import {SectionApi} from './section-api';
import {API_REFERENCE_CONTAINER} from '../styling/css-classes.mjs';
import {DeprecationWarning} from './deprecation-warning';
/** Component to render a constant API reference document. */
export function ConstantReference(entry: ConstantEntryRenderable) {
return (
<div className={API_REFERENCE_CONTAINER}>
<HeaderApi entry={entry} />
<DeprecationWarning entry={entry} />
<SectionApi entry={entry} />
<SectionDescription entry={entry} />
<SectionUsageNotes entry={entry} />
@@ -0,0 +1,27 @@
/*!
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/
import {h} from 'preact';
import {HeaderApi} from './header-api';
import {SectionDescription} from './section-description';
import {SectionUsageNotes} from './section-usage-notes';
import {SectionApi} from './section-api';
import {API_REFERENCE_CONTAINER} from '../styling/css-classes.mjs';
import {DecoratorEntryRenderable} from '../entities/renderables.mjs';
/** Component to render a decorator API reference document. */
export function DecoratorReference(entry: DecoratorEntryRenderable) {
return (
<div className={API_REFERENCE_CONTAINER}>
<HeaderApi entry={entry} />
<SectionApi entry={entry} />
<SectionDescription entry={entry} />
<SectionUsageNotes entry={entry} />
</div>
);
}
@@ -13,13 +13,16 @@ export function DeprecatedLabel(props: {
entry:
| {deprecated: {version: string | undefined} | undefined}
| {deprecationMessage: string | null};
hideLabel?: true;
}) {
const entry = props.entry;
if ('deprecationMessage' in entry && entry.deprecationMessage !== null) {
return (
<div className={'docs-deprecation-message'}>
<span className={`${PARAM_KEYWORD_CLASS_NAME} docs-deprecated`}>@deprecated</span>
{!props.hideLabel && (
<span className={`${PARAM_KEYWORD_CLASS_NAME} docs-deprecated`}>@deprecated</span>
)}
<span dangerouslySetInnerHTML={{__html: entry.deprecationMessage}}></span>
</div>
);
@@ -0,0 +1,27 @@
/*!
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/
import {h} from 'preact';
import {DeprecatedLabel} from './deprecated-label';
export function DeprecationWarning(props: {
entry:
| {deprecated: {version: string | undefined} | undefined}
| {deprecationMessage: string | null};
}) {
const entry = props.entry;
return (
'deprecationMessage' in entry &&
entry.deprecationMessage && (
<div class="docs-alert docs-alert-important">
<p>Deprecation warning</p>
<DeprecatedLabel entry={entry} hideLabel={true} />
</div>
)
);
}
@@ -13,12 +13,14 @@ import {SectionDescription} from './section-description';
import {SectionApi} from './section-api';
import {API_REFERENCE_CONTAINER, REFERENCE_MEMBERS} from '../styling/css-classes.mjs';
import {ClassMember} from './class-member';
import {DeprecationWarning} from './deprecation-warning';
/** Component to render a enum API reference document. */
export function EnumReference(entry: EnumEntryRenderable) {
return (
<div className={API_REFERENCE_CONTAINER}>
<HeaderApi entry={entry} />
<DeprecationWarning entry={entry} />
<SectionApi entry={entry} />
{entry.members.length > 0 ? (
<div class={REFERENCE_MEMBERS}>
@@ -27,6 +27,7 @@ import {HighlightTypeScript} from './highlight-ts';
import {SectionApi} from './section-api';
import {SectionDescription} from './section-description';
import {SectionUsageNotes} from './section-usage-notes';
import {DeprecationWarning} from './deprecation-warning';
export const signatureCard = (
name: string,
@@ -70,6 +71,7 @@ export function FunctionReference(entry: FunctionEntryRenderable) {
return (
<div className={API_REFERENCE_CONTAINER}>
<HeaderApi entry={entry} />
<DeprecationWarning entry={entry} />
<SectionApi entry={entry} />
<div className={REFERENCE_MEMBERS}>
{entry.signatures.map((s, i) =>
@@ -13,12 +13,14 @@ import {SectionDescription} from './section-description';
import {SectionUsageNotes} from './section-usage-notes';
import {SectionApi} from './section-api';
import {API_REFERENCE_CONTAINER} from '../styling/css-classes.mjs';
import {DeprecationWarning} from './deprecation-warning';
/** Component to render a type alias API reference document. */
export function TypeAliasReference(entry: TypeAliasEntryRenderable) {
return (
<div className={API_REFERENCE_CONTAINER}>
<HeaderApi entry={entry} />
<DeprecationWarning entry={entry} />
<SectionApi entry={entry} />
<SectionDescription entry={entry} />
<SectionUsageNotes entry={entry} />
@@ -1,6 +1,5 @@
load("//adev/shared-docs:defaults.bzl", "ts_project")
load("//adev/shared-docs:defaults.bzl", "ts_project", "zoneless_jasmine_test")
load("//adev/shared-docs/pipeline/api-gen/rendering:render_api_to_html.bzl", "render_api_to_html")
load("//tools:defaults2.bzl", "jasmine_test")
render_api_to_html(
name = "test",
@@ -19,18 +18,17 @@ ts_project(
],
),
deps = [
"//:node_modules/@bazel/runfiles",
"//:node_modules/@types/jsdom",
"//:node_modules/jsdom",
"//adev:node_modules/@types/jsdom",
"//adev:node_modules/jsdom",
"//adev/shared-docs/pipeline/api-gen/rendering:render_api_to_html_lib_rjs",
],
)
jasmine_test(
zoneless_jasmine_test(
name = "unit_tests",
data = [
":unit_test_lib_rjs",
"//:node_modules/jsdom",
"//adev:node_modules/jsdom",
] + glob([
"**/*.json",
]),
@@ -6,7 +6,7 @@
* found in the LICENSE file at https://angular.dev/license
*/
import {runfiles} from '@bazel/runfiles';
import {resolve} from 'path';
import {readFile} from 'fs/promises';
import {JSDOM} from 'jsdom';
import {configureMarkedGlobally} from '../marked/configuration.mjs';
@@ -22,7 +22,7 @@ describe('CLI docs to html', () => {
await initHighlighter();
await configureMarkedGlobally();
const entryContent = await readFile(runfiles.resolvePackageRelative('fake-cli-entries.json'), {
const entryContent = await readFile(resolve('./fake-cli-entries.json'), {
encoding: 'utf-8',
});
@@ -6,7 +6,6 @@
* found in the LICENSE file at https://angular.dev/license
*/
import {runfiles} from '@bazel/runfiles';
import {readFile} from 'fs/promises';
import {JSDOM} from 'jsdom';
import {configureMarkedGlobally} from '../marked/configuration.mjs';
@@ -14,6 +13,7 @@ import {getRenderable} from '../processing.mjs';
import {renderEntry} from '../rendering.mjs';
import {initHighlighter} from '../shiki/shiki.mjs';
import {setSymbols} from '../symbol-context.mjs';
import {resolve} from 'path';
// Note: The tests will probably break if the schema of the api extraction changes.
// All entries in the fake-entries are extracted from Angular's api.
@@ -27,7 +27,7 @@ describe('markdown to html', () => {
await initHighlighter();
await configureMarkedGlobally();
const entryContent = await readFile(runfiles.resolvePackageRelative('fake-entries.json'), {
const entryContent = await readFile(resolve('./fake-entries.json'), {
encoding: 'utf-8',
});
const entryJson = JSON.parse(entryContent) as any;
@@ -6,13 +6,13 @@
* found in the LICENSE file at https://angular.dev/license
*/
import {runfiles} from '@bazel/runfiles';
import {readFile} from 'fs/promises';
import {DocEntryRenderable} from '../entities/renderables.mjs';
import {configureMarkedGlobally} from '../marked/configuration.mjs';
import {getRenderable} from '../processing.mjs';
import {initHighlighter} from '../shiki/shiki.mjs';
import {setSymbols} from '../symbol-context.mjs';
import {resolve} from 'path';
// Note: The tests will probably break if the schema of the api extraction changes.
// All entries in the fake-entries are extracted from Angular's api.
@@ -25,7 +25,7 @@ describe('renderable', () => {
await initHighlighter();
await configureMarkedGlobally();
const entryContent = await readFile(runfiles.resolvePackageRelative('fake-entries.json'), {
const entryContent = await readFile(resolve('./fake-entries.json'), {
encoding: 'utf-8',
});
const entryJson = JSON.parse(entryContent) as any;
@@ -12,6 +12,7 @@ import {
FunctionSignatureMetadata,
GenericEntry,
MemberEntry,
DecoratorEntry,
MemberTags,
ParameterEntry,
PropertyEntry,
@@ -34,12 +35,21 @@ import {
import {CodeLineRenderable} from '../entities/renderables.mjs';
import {HasModuleName, HasRenderableToc} from '../entities/traits.mjs';
import {getModuleName} from '../symbol-context.mjs';
import {codeToHtml, replaceKeywordFromShikiHtml} from '../shiki/shiki.mjs';
import {
codeToHtml,
insertParenthesesForDecoratorInShikiHtml,
replaceKeywordFromShikiHtml,
} from '../shiki/shiki.mjs';
import {filterLifecycleMethods, mergeGettersAndSetters} from './member-transforms.mjs';
import {getLinkToModule} from './url-transforms.mjs';
import {formatJs} from './format-code.mjs';
const INDENT = ' ';
const SPACE = ' ';
const LN_BREAK = '\n';
const INDENTED_NEW_LINE = `${LN_BREAK}${INDENT}`;
// Allows to generate links for code lines.
interface CodeTableOfContentsData {
// The contents of code block.
@@ -71,7 +81,7 @@ export async function addRenderableCodeToc<T extends DocEntry & HasModuleName>(
// For now we only format functions with prettier
let formattedCode: string | null = null;
if (entry.entryType === EntryType.Function) {
if (entry.entryType === EntryType.Function || entry.entryType === EntryType.Decorator) {
formattedCode = await formatJs(metadata.contents);
}
@@ -81,12 +91,23 @@ export async function addRenderableCodeToc<T extends DocEntry & HasModuleName>(
// Shiki requires a keyword for correct formating of Decorators
// We use an interface and then replace it with a '@'
codeWithSyntaxHighlighting = replaceKeywordFromShikiHtml(
'interface',
'class|function',
codeWithSyntaxHighlighting,
'@',
);
// if (entry.entryType === EntryType.InterfaceLikeDecorator) {
// We need to add parentheses around the curly braces for this kind of decorators
codeWithSyntaxHighlighting = insertParenthesesForDecoratorInShikiHtml(
codeWithSyntaxHighlighting,
);
// }
}
// Note: Don't expect enum value in signatures to be linked correctly
// as shiki already splits them into separate span blocks.
// Only the enum itself will recieve a link
codeWithSyntaxHighlighting = addApiLinksToHtml(codeWithSyntaxHighlighting);
// shiki returns the lines wrapped by 2 node : 1 pre node, 1 code node.
// As leveraging jsdom isn't trivial here, we rely on a regex to extract the line nodes
const pattern = /(.*?)<code.*?>(.*?)<\/code>(.*)/s;
@@ -104,12 +125,7 @@ export async function addRenderableCodeToc<T extends DocEntry & HasModuleName>(
const insideCode = match[2];
const afterCode = match[3];
// Note: Don't expect enum value in signatures to be linked correctly
// as skihi already splits them into separate span blocks.
// Only the enum itself will recieve a link
const codeWithLinks = addApiLinksToHtml(insideCode);
const lines = splitLines(codeWithLinks);
const lines = splitLines(insideCode);
const groups = groupCodeLines(lines, metadata, entry);
return {
@@ -142,17 +158,27 @@ function groupCodeLines(lines: string[], metadata: CodeTableOfContentsData, entr
}, new Map<string, CodeLineRenderable[]>());
}
export function mapDocEntryToCode(entry: DocEntry): CodeTableOfContentsData {
function mapDocEntryToCode(entry: DocEntry): CodeTableOfContentsData {
const isDeprecated = isDeprecatedEntry(entry);
const deprecatedLineNumbers = isDeprecated ? [0] : [];
if (isClassEntry(entry)) {
const members = filterLifecycleMethods(mergeGettersAndSetters(entry.members));
return getCodeTocData(members, true, isDeprecated);
if (isClassEntry(entry) || (isDecoratorEntry(entry) && isClassLikeDecorator(entry))) {
const members = filterLifecycleMethods(mergeGettersAndSetters(entry.members!));
return getCodeTocData(members, isDeprecated);
}
if (isDecoratorEntry(entry)) {
return getCodeTocData(entry.members, true, isDeprecated);
if (isDecoratorEntry(entry) && !isClassLikeDecorator(entry)) {
return {
contents: entry
.signatures!.map((sig) =>
sig.parameters
.map((param) => `${param.name}${param.isOptional ? '?' : ''}: ${param.type}`)
.join(', '),
)
.join(LN_BREAK),
codeLineNumbersWithIdentifiers: new Map<number, string>(),
deprecatedLineNumbers: [],
};
}
if (isConstantEntry(entry)) {
@@ -164,17 +190,18 @@ export function mapDocEntryToCode(entry: DocEntry): CodeTableOfContentsData {
}
if (isEnumEntry(entry)) {
return getCodeTocData(entry.members, true, isDeprecated);
return getCodeTocData(entry.members, isDeprecated);
}
if (isInterfaceEntry(entry)) {
return getCodeTocData(mergeGettersAndSetters(entry.members), true, isDeprecated);
return getCodeTocData(mergeGettersAndSetters(entry.members), isDeprecated);
}
if (isFunctionEntry(entry)) {
const codeLineNumbersWithIdentifiers = new Map<number, string>();
const hasSingleSignature = entry.signatures.length === 1;
// Specifically handling the case of overloaded functions
if (entry.signatures.length > 0) {
const initialMetadata: CodeTableOfContentsData = {
contents: '',
@@ -186,7 +213,7 @@ export function mapDocEntryToCode(entry: DocEntry): CodeTableOfContentsData {
(acc: CodeTableOfContentsData, curr: FunctionSignatureMetadata, index: number) => {
const lineNumber = index;
acc.codeLineNumbersWithIdentifiers.set(lineNumber, `${curr.name}_${index}`);
acc.contents += getMethodCodeLine(curr, [], hasSingleSignature, true);
acc.contents += getFunctionCodeLine(curr, []);
// We don't want to add line break after the last item
if (!hasSingleSignature && index < entry.signatures.length - 1) {
@@ -203,8 +230,7 @@ export function mapDocEntryToCode(entry: DocEntry): CodeTableOfContentsData {
}
return {
// It is important to add the function keyword as shiki will only highlight valid ts
contents: `function ${getMethodCodeLine(entry.implementation, [], true)}`,
contents: getMethodCodeLine(entry.implementation, []),
codeLineNumbersWithIdentifiers,
deprecatedLineNumbers,
};
@@ -281,25 +307,20 @@ export function mapDocEntryToCode(entry: DocEntry): CodeTableOfContentsData {
};
}
// TODO(matthieu): This whole part should be refactored to rely on a formatter (like prettier)
// to handle formatting (See also #59211)
/** Generate code ToC data for list of members. */
function getCodeTocData(
members: MemberEntry[],
hasPrefixLine: boolean,
isDeprecated: boolean,
): CodeTableOfContentsData {
function getCodeTocData(members: MemberEntry[], isDeprecated: boolean): CodeTableOfContentsData {
const initialMetadata: CodeTableOfContentsData = {
contents: '',
codeLineNumbersWithIdentifiers: new Map<number, string>(),
deprecatedLineNumbers: isDeprecated ? [0] : [],
};
// In case when hasPrefixLine is true we should take it into account when we're generating
// `codeLineNumbersWithIdentifiers` below.
const skip = !!hasPrefixLine ? 1 : 0;
let lineNumber = skip;
let lineNumber = 1;
return members.reduce((acc: CodeTableOfContentsData, curr: MemberEntry, index: number) => {
const setTocData = (entry: DocEntry | MemberEntry, content: string) => {
acc.contents += ` ${content.trim()}\n`;
acc.contents += `${INDENTED_NEW_LINE}${content}`;
acc.codeLineNumbersWithIdentifiers.set(lineNumber, entry.name);
if (isDeprecatedEntry(entry)) {
acc.deprecatedLineNumbers.push(lineNumber);
@@ -309,14 +330,17 @@ function getCodeTocData(
};
if (isClassMethodEntry(curr)) {
// class methods
if (curr.signatures.length > 0) {
curr.signatures.forEach((signature) => {
setTocData(signature, getMethodCodeLine(signature, curr.memberTags));
});
} else {
// Constructors, methods on interfaces, Decorators
setTocData(curr, getMethodCodeLine(curr.implementation, curr.memberTags));
}
} else {
// class props
setTocData(curr, getCodeLine(curr));
}
return acc;
@@ -337,24 +361,21 @@ function getPropertyCodeLine(member: PropertyEntry): string {
const isOptional = isOptionalMember(member);
const tags = getTags(member);
return `${tags.join(' ')} ${member.name}${markOptional(isOptional)}: ${member.type};`;
return `${tags.join(SPACE)}${tags.length ? SPACE : ''}${member.name}${markOptional(isOptional)}: ${member.type};`;
}
/** Map method entry to text */
function getMethodCodeLine(
member: FunctionSignatureMetadata,
memberTags: MemberTags[] = [],
displayParamsInNewLines: boolean = false,
isFunction: boolean = false,
): string {
function getMethodCodeLine(member: FunctionSignatureMetadata, memberTags: MemberTags[]): string {
const generics = makeGenericsText(member.generics);
return (
`${memberTags.join(SPACE)}${memberTags.length ? ' ' : ''}${member.name}${generics}(` +
`${member.params.map((param) => mapParamEntry(param)).join(`, `)}` +
`): ${member.returnType};`
);
}
displayParamsInNewLines &&= member.params.length > 0;
return `${isFunction ? 'function' : ''}${memberTags.join(' ')} ${member.name}${generics}(${displayParamsInNewLines ? '\n ' : ''}${member.params
.map((param) => mapParamEntry(param))
.join(`,${displayParamsInNewLines ? '\n ' : ' '}`)}${
displayParamsInNewLines ? '\n' : ''
}): ${member.returnType};`.trim();
function getFunctionCodeLine(member: FunctionSignatureMetadata, memberTags: MemberTags[]) {
return `function ${getMethodCodeLine(member, memberTags).trim()}`;
}
function mapParamEntry(entry: ParameterEntry) {
@@ -366,13 +387,13 @@ function mapParamEntry(entry: ParameterEntry) {
function getGetterCodeLine(member: PropertyEntry): string {
const tags = getTags(member);
return `${tags.join(' ')} get ${member.name}(): ${member.type};`;
return `${tags.join(SPACE)} get ${member.name}(): ${member.type};`;
}
function getSetterCodeLine(member: PropertyEntry): string {
const tags = getTags(member);
return `${tags.join(' ')} set ${member.name}(value: ${member.type});`;
return `${tags.join(SPACE)} set ${member.name}(value: ${member.type});`;
}
function markOptional(isOptional: boolean): string {
@@ -455,33 +476,40 @@ function appendPrefixAndSuffix(entry: DocEntry, codeTocData: CodeTableOfContents
firstLine: string,
lastLine: string,
) => {
data.contents = `${firstLine}\n${data.contents}${lastLine}`;
data.contents = `${firstLine}${data.contents}${lastLine}`;
};
if (isClassEntry(entry) || isInterfaceEntry(entry)) {
const generics = makeGenericsText(entry.generics);
const extendsStr = entry.extends ? ` extends ${entry.extends}` : '';
// TODO: remove the ? when we distinguish Class & Decorator entries
const implementsStr =
entry.implements?.length > 0 ? ` implements ${entry.implements.join(' ,')}` : '';
entry.implements.length > 0 ? ` implements ${entry.implements.join(' ,')}` : '';
const signature = `${entry.name}${generics}${extendsStr}${implementsStr}`;
if (isClassEntry(entry)) {
const abstractPrefix = entry.isAbstract ? 'abstract ' : '';
appendFirstAndLastLines(codeTocData, `${abstractPrefix}class ${signature} {`, `}`);
appendFirstAndLastLines(codeTocData, `${abstractPrefix}class ${signature} {`, `\n}`);
}
if (isInterfaceEntry(entry)) {
appendFirstAndLastLines(codeTocData, `interface ${signature} {`, `}`);
appendFirstAndLastLines(codeTocData, `interface ${signature} {`, `\n}`);
}
}
if (isEnumEntry(entry)) {
appendFirstAndLastLines(codeTocData, `enum ${entry.name} {`, `}`);
appendFirstAndLastLines(codeTocData, `enum ${entry.name} {`, `\n}`);
}
if (isDecoratorEntry(entry)) {
appendFirstAndLastLines(codeTocData, `interface ${entry.name} ({`, `})`);
if (isClassLikeDecorator(entry)) {
appendFirstAndLastLines(codeTocData, `class ${entry.name} {`, `\n}`);
} else {
let lines = splitLines(codeTocData.contents);
if (lines.length === 0) {
codeTocData.contents = `function ${entry.name}()`;
} else {
codeTocData.contents = lines.map((line) => `function ${entry.name}(${line})`).join('\n');
}
}
}
}
@@ -497,11 +525,11 @@ export function addApiLinksToHtml(htmlString: string): string {
// The captured content ==> vvvvvvvv
/(?<!<a[^>]*>)(<(?:(?:span)|(?:code))(?!\sdata-skip-anchor)[^>]*>\s*)([^<]*?)(\s*<\/(?:span|code)>)/g,
(type: string, span1: string, potentialSymbolName: string, span2: string) => {
let [symbol, subSymbol] = potentialSymbolName.split(/(?:#|\.)/) as [string, string?];
const [symbol, subSymbol] = potentialSymbolName.split(/(?:#|\.)/) as [string, string?];
// mySymbol() => mySymbol
const symbolWithoutInvocation = symbol.replace(/\([^)]*\);?/g, '');
const moduleName = getModuleName(symbolWithoutInvocation)!;
const moduleName = getModuleName(symbolWithoutInvocation);
if (moduleName) {
return `${span1}<a href="${getLinkToModule(moduleName, symbol, subSymbol)}">${potentialSymbolName}</a>${span2}`;
@@ -555,3 +583,7 @@ export function makeGenericsText(generics: GenericEntry[] | undefined): string {
return parts.join('');
}
function isClassLikeDecorator(entry: DecoratorEntry): boolean {
return !!entry.members;
}

Some files were not shown because too many files have changed in this diff Show More