2498 Commits

Author SHA1 Message Date
Joey Perrott e3103fe60d build: migrate devtools to use new sass ruleset (#62298)
Use the new sass ruleset for bazel sass building in devtools

PR Close #62298
2025-06-27 09:26:16 +00:00
Joey Perrott 3e0437f902 build: migrate adev to use new sass ruleset (#62298)
Use the new sass ruleset for bazel sass building in adev

PR Close #62298
2025-06-27 09:26:16 +00:00
Joey Perrott 31e3eb20f9 build: migrate to use web test runner rules (#62294)
Migrate karma tests throughout the repo to use the new web test runner based rule instead

PR Close #62294
2025-06-26 17:20:49 +00:00
Joey Perrott eddc296b94 build: migrate final non-zone.js jasmine tests (#62170)
Migrate the final remaining non-zone.js package jasmine tests to the new toolchain

PR Close #62170
2025-06-24 08:48:00 +00:00
Joey Perrott 4e26ef996b build: migrate to using new jasmine_test (#62132)
Migrate additional targets to jasmine_test

PR Close #62132
2025-06-19 10:04:46 +02:00
Joey Perrott f201df9b83 build: migrate to using new jasmine_test (#62106)
Use the new jasmine_test based on rules_js instead of jasmine_node_test from rules_nodejs

PR Close #62106
2025-06-18 17:59:50 +02:00
Joey Perrott 8403bc731b build: migrate to usages of @devinfra// instead of @npm//@angular/build-tooling (#62050)
Use workspace imported devinfra deps instead of npm dep

PR Close #62050
2025-06-16 10:23:30 +02:00
Paul Gschwendtner d16c1cf462 build: migrate packages/core/test to new jasmine_test rule (#61902)
Migrates `packages/core/test` to the new `jasmine_test` rule. As part of
this, we are also removing an unnecessary/unused test fixture.

PR Close #61902
2025-06-12 10:00:10 +02:00
Paul Gschwendtner 7c43fa6932 build: update node loader to support zone.js (#61902)
Temporarily updates the new Node loader to work with `zone.js` `.mjs`
files that are still ending up at runtime due to this package using
`ts_library`.

PR Close #61902
2025-06-12 10:00:10 +02:00
Paul Gschwendtner a696ce2267 build: add jasmine_test macro for replacing jasmine_node_test legacy rule (#61902)
This commit introduces the new `jasmine_test` macro that can be an
"almost" drop-in replacement for `jasmine_test`.

PR Close #61902
2025-06-12 10:00:10 +02:00
Paul Gschwendtner ff3d2278f6 build: add small comment for ng_package_link_interop.bzl (#61902)
This should make the intent a little more clearer if someone
just looks at this file.

PR Close #61902
2025-06-12 10:00:10 +02:00
Joey Perrott 135c594443 refactor: use zone.js from npm instead of packages/zone.js throughout repo (#61978)
Use zone.js from npm isntead of from the repo going forward

PR Close #61978
2025-06-10 12:02:36 -07:00
Paul Gschwendtner 23e3c6a7c9 build: introduce NodeJS loader for rules_js Node execution (#61895)
For the `rules_js` migration, we are facing the problem where
our current Angular code is shipped as ESM, but we aren't fully
there yet with fully compliant strict ESM during development.

That is because we lack explicit import extensions, and it's also a
different story how this would work in Google3, if we were to add them.

In addition, we cross-import from our packages using npm module names.
This works well for TS, for ESBuild because those can respect path
mappings— but at runtime, when executing native `jasmine_test`'s— such
mappings aren't respected. The options here are:

- avoid module imports in the repo (impossible; undesired)
- use pre-bundling of all NodeJS execution involving npm package code
  (slower, extra build action cost)
- wire up a simple NodeJS loader (supported via official APIs) to simply
  account for our cases (preferred and similar to what we experimented
  with for the last year(s); and worked well)

This commit implements the last option and allows for an easy migration
to `rules_js`, and also is pretty reasonable. Long-term we can resolve
the extension problem if we e.g. migrate to real explicit extensions + a
proper TS module resolution like e.g. `nodenext`.

PR Close #61895
2025-06-05 13:33:52 +02:00
Paul Gschwendtner 8564cf48d8 build: replace all ng_package with new rule from rules_angular (#61862)
Replaces all `ng_package` rule with the new rule from `rules_angular`.

PR Close #61862
2025-06-05 07:34:50 +00:00
Paul Gschwendtner a24fb53a73 build: remove packages/bazel (#61862)
Removes the `@angular/bazel` package as we no longer need it. Yay!

It's replaced by `rules_angular`.

PR Close #61862
2025-06-05 07:34:50 +00:00
Paul Gschwendtner a9a7654cbf build: migrate packages/compiler-cli to ts_project (#61862)
This commit migrates the remaining pieces of `compiler-cli` to
`ts_project`. This involves a few more things during migration:

- the `ng_module` ngc_wrapped rule broke as part of this change, so we
  switched it to `ts_project` too. This logic is soon gone anyway.

- we needed an extra pnpm "package.json" for the linker babel test. This test is
  loading from the real compiler-cli npm package. Babel needs a real
  node module for this, so this solution seems reasonable. It may be
  worth exploring in the future to move this test into an integration
  test though.

- the older integrationtest in compiler-cli is removed as the coverage
  is much better with the compliance test suite and this test.

PR Close #61862
2025-06-05 07:34:49 +00:00
Paul Gschwendtner 4fa276214c build: rework benchmarks and examples in modules/ to new optimization rule
We are dropping the custom ESBuild and Terser pipeline from dev-infra
and instead leverage the Angular CLI directly. This commit adjusts
the benchmarks to use this new rule.
2025-05-30 10:01:23 +02:00
Paul Gschwendtner f521b6c99f build: rework symbol extractor to support lazy/common chunks
Since we are going to replace our `app_bundle` rule (custom ESBuild +
Terser pipeline) with the real Angular CLI where shared/lazy/common
chunks may exist, we need to update the symbol extractor to support
multiple files.

We could have just merged all symbols, but this commit tries to do
better by detecting what symbols are loaded eagerly vs. lazily. This
will be very useful for e.g. defer tests or other lazy features we are
introducing in the feature.
2025-05-30 10:01:23 +02:00
Paul Gschwendtner 845f8dfd38 build: fix app_bundle rule after migrating packages/compiler
The `app_bundle` rule does not work after the migration of
`packages/compiler` to `ts_project` because the `.mjs` extensions are
now missing in the non npm-package output.

This causes runtime errors as `.js` is not recognized as ESM. Switching
to the real npm package for usage, fixes this issue.
2025-05-30 10:01:23 +02:00
Paul Gschwendtner aa0c46f4f3 build: migrate packages/compiler to ts_project
Migrates `packages/compiler` to `ts_project`.
2025-05-30 10:01:23 +02:00
Joey Perrott 3731cce85d build: migrate examples to use rules_js (#61650)
Migrate examples to use ng_project and ts_project for building

PR Close #61650
2025-05-26 11:01:00 +00:00
Joey Perrott 308404eca7 build: update common's locales to use rules_js (#61629)
Use ts_project to build the common locales

PR Close #61629
2025-05-26 10:18:15 +00:00
Joey Perrott d366a9811d build: update tools directory to use rules_js for building (#61657)
Use ts_project for building the tools directory targets

PR Close #61657
2025-05-26 09:58:03 +00:00
Alan Agius f355fbc446 build: disable esbuild metadata file generation (#61636)
Disables creation of the esbuild meta.json file, which is not utilized in the build process. This streamlines the output and avoids generating unused artifacts.

PR Close #61636
2025-05-26 08:57:44 +00:00
Joey Perrott 9eefc5dcd4 build: migrate localize package to use rules_js (#61613)
Use ts_project to build localize package

PR Close #61613
2025-05-26 08:53:55 +00:00
Joey Perrott 6187b5b0b3 build: migrate language service to use rules_js (#61575)
Migrate language service to build using ts_project

PR Close #61575
2025-05-21 14:58:21 +00:00
Joey Perrott 3cc0910928 build: update compiler-cli to not be stamped when used for the compiler in ng_project (#61535)
The compiler-cli package needs to be unstamped and will the resulting generated code will be stamped as expected.

PR Close #61535
2025-05-21 09:16:06 +00:00
Alan Agius 30e081287d fix(core): update min Node.js support to 20.19, 22.12, and 24.0 (#61500)
This is to match the versions of the Angular CLI.

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

PR Close #61500
2025-05-20 14:17:20 +00:00
Joey Perrott a66e71d338 build: migrate adev to use ng_project (#61345)
Move all of adev to use ng_project instead of ng_module

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

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

PR Close #61486
2025-05-20 08:44:56 +00:00
Paul Gschwendtner 49166757d0 build: migrate packages/core/schematics to ts_project (#61414)
Migrates `packages/core/schematics` to `ts_project`. As part of this,
this commit cleans up some of the mixed module types and tsconfigs in
the folder. A single tsconfig (and it's test variant) are now used.

For the shipped schematics, we explicitly use the `.cjs` extension, so
that the bundles are properly recognized as CommonJS; even if they are
part of the `type: module` `@angular/core` package.

The `package.json` with `type: commonjs` is removed from
`packages/core/schematics` as it's no longer needed given the explicit
extension & caused issues as schematics are compiled with ESM but are
only later bundled for shipping & some tests as ESM.

PR Close #61414
2025-05-16 14:51:24 +00:00
Paul Gschwendtner c582292d0b build: update legacy ESM interop rules to support explicit .js entrypoints (#61414)
As we migrate more and more code to `ts_project`, we are ending up with
`.js` file extensions (ts_library did generate `.mjs` magically).

Since we don't want to get into the business of migrating
`nodejs_binary` targets at this point (in some cases we might)— we
should support pointing to such files.

PR Close #61414
2025-05-16 14:51:24 +00:00
Paul Gschwendtner 31d5ae93a0 build: migrate more targets of @angular/core to ts_project (#61414)
Migrates more targets of `@angular/core` to `ts_project`. Remaining are:

 - tests
 - schematics

PR Close #61414
2025-05-16 14:51:24 +00:00
Kristiyan Kostadinov 47edecd76e build: fix symbol extractor script (#61407)
* Fixes that the symbol extractor approval script was broken after some recent build changes.
* Fixes the `run_all_symbol_extractor_tests` script which wasn't resolving any targets, because the rule name changed.

PR Close #61407
2025-05-16 13:59:12 +00:00
Jan Martin ee1146ee1f docs: call out the available variables in track expressions (#61252)
At least to me it was surprising that values from the surrounding
"lexical-ish" scope weren't available in `track <expr>`.

PR Close #61252
2025-05-16 07:51:12 +00:00
Joey Perrott 1055354672 build: use common macro to define tsconfig for service worker (#61341)
Define the tsconfig for service worker instead of manually including the tsconfig on each target

PR Close #61341
2025-05-14 10:43:28 -07:00
Paul Gschwendtner 7a3039c093 build: add modified version of tsec that can work with interop (#61335)
As we roll out more PRs that migrate to `ts_project`, we need to make
sure that we don't break existing `tsec` targets. This PR copies the
original `tsec` Starlark code and adjusts it to work with the interop.

Note that we don't patch as this would unnecessarily complicate this
file that only exists during migration. Long-term, after migration, we
either need to consider switching to the new ESLint plugin that is being
worked on (I'm in contact with the team), or we send a CL to update the
Tsec Starlark code to keep our changes minimal and avoid scope increase.

PR Close #61335
2025-05-14 08:35:14 -07:00
Paul Gschwendtner 116550f680 build: fix ts_project interop to properly create linker mappings (#61335)
This commit fixes that the interop targets weren't properly creating
linker mappings in some cases. This could break spec bundling.

PR Close #61335
2025-05-14 08:35:14 -07:00
Paul Gschwendtner 063c3ad281 refactor: update packages/core:{core,src} to ts_project (#61335)
Updates `packages/core:core` and `packages/core/src/...` to `ts_project`
of `rules_js`.

PR Close #61335
2025-05-14 08:35:14 -07:00
Paul Gschwendtner 5c1d2eb262 build: support new ng_project rule (#61335)
Supports the `ng_project` rule with the local compiler-cli version
from HEAD.

PR Close #61335
2025-05-14 08:35:14 -07:00
Paul Gschwendtner 1b4b44e476 refactor: add explicit types for exports relying on inferred call return type (#61312)
As part of the Bazel toolchain migration we noticed that implicit types
generated by the TypeScript compiler sometimes end up referencing types
from other packages (i.e. cross-package imports).

These imports currently work just because the Bazel `ts_library` and
`ng_module` rules automatically inserted a `<amd-module
name="@angular/x" />` into `.d.ts` of packages. This helped TS figure
out how to import a given file. Notably this is custom logic that is not
occuring in vanilla TS or Angular compilations—so we will drop this
magic as part of the toolchain cleanup!

To improve code quality and keep the existing behavior working, we are
doing the following:

- adding a lint rule that reduces the risk of such imports breaking. The
  failure scenario without the rule is that API goldens show unexpected
  diffs, and types might be duplicated in a different package!

- keeping the `<amd-module` headers, but we manually insert them into
  the package entry-points. This should ensure we don't regress
  anywhere; while we also improved general safety around this above.

Long-term, isolated declarations or a lint rule from eslint-typescript
can make this even more robust.

PR Close #61312
2025-05-13 22:45:19 +00:00
Joey Perrott 345d3d8f8a build: migrate adev shared-docs package to use ts_project (#61218)
Migrate the build rules for shared docs to use ts_project

PR Close #61218
2025-05-09 16:30:44 +00:00
Paul Gschwendtner 1ce146bdbe build: migrate compiler-cli/src/ngtsc to ts_project (#61181)
Migrates all of `compiler-cli/src/ngtsc` to `ts_project`. This change
was generated using Gemini.

PR Close #61181
2025-05-09 15:59:47 +00:00
Paul Gschwendtner b590dfb8ae build: migrate manual_api_docs to rules_js (#61181)
Migrates `manual_api_docs` to `rules_js`. Since compiler CLI is ESM
compiled but doesn't have extensions, we can either bundle or simply use
the dependency as type only. This is easier and sufficient for this
use-case.

PR Close #61181
2025-05-09 15:59:47 +00:00
Paul Gschwendtner b07a2dfce1 build: prepare for compiler-cli to be using ts_project (#61181)
Prepare the compiler-cli package for being ready for migration
to `ts_project`.

PR Close #61181
2025-05-09 15:59:47 +00:00
Paul Gschwendtner 2bd9edf0b2 build: migrate symbol-extractor to ts_project (#61197)
Migrates the symbol-extractor code to `ts_project`.

PR Close #61197
2025-05-08 09:24:30 -07:00
Paul Gschwendtner 051d90a4cc build: remove irrelevant madge circular deps tests (#61197)
We don't need this tooling anymore because we are already validating
that there are no circular dependencies via the `ng-dev` tooling that
checks `.ts` files directly.

Also these tests never actually failed to my knowledge.

PR Close #61197
2025-05-08 09:24:30 -07:00
Joey Perrott 1c610a57de build: set up ts_project interop for rules_js migration (#61087)
The `ts_project` interop rule that we've built was also used in the
Angular CLI migration, and it allows us to mix `ts_project` and
`ts_library` targets; enabling an incremental migration. Additionally
set up the `ng_project` to replace `ng_module`.

PR Close #61087
2025-05-02 09:12:23 -07:00
Matthieu Riegler 8f803aa81a build: Run browsers tests without platform-browser-dynamic (#60937) (#61060)
Use the regular `platform-browser` providers instead.

PR Close #61060
2025-04-30 08:21:02 -07:00