Commit graph

66 commits

Author SHA1 Message Date
Shuaib Hasan Akib
0c6604f478 refactor(common): update copyright to Google LLC
Replaces outdated Google Inc copyright headers with Google LLC to align with current licensing standards.
2026-02-09 07:51:36 -08:00
Joey Perrott
aa92f19307 build: update to bazel version 8.4.2
Update bazel to use version 8.4.2
2025-12-08 10:21:59 -08:00
Joey Perrott
eb80c3075f build: update symbol extractor tests to stabalize the order of the symbols listed (#64389)
Update to ensure that the symbols in the list of extracted symbols is consistent even when multiple bundle files are extracted from.

PR Close #64389
2025-10-13 11:12:54 -07:00
Joey Perrott
2fcafb65c5 build: rename defaults2.bzl to defaults.bzl (#63383)
Use defaults.bzl for the common macros

PR Close #63383
2025-08-25 15:45:01 -07:00
Joey Perrott
82cc576e6f build: use pnpm as the package manager instead of yarn (#62924)
Use pnpm instead of yarn as the package manager and interaction tool for the repo

PR Close #62924
2025-07-31 22:06:27 +00:00
Joey Perrott
cbc258eec8 build: remove ts_project_interop infrastructure (#62908)
Remove the interop macros and final usages

PR Close #62908
2025-07-31 09:12:58 +00:00
Joey Perrott
49b7729e88 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:27 +00:00
Joey Perrott
32c00ab416 build: standardize usage of js_binary (#62860)
Remove usages of nodejs_binary and use a commonly defined js_binary macro

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

PR Close #62804
2025-07-25 10:04:55 +02:00
Joey Perrott
3a0cfd544d build: migrate to using new jasmine_test (#62086)
Use the new jasmine_test based on rules_js instead of jasmine_node_test from rules_nodejs

PR Close #62086
2025-06-18 08:27:26 +02:00
Paul Gschwendtner
6dade56bb3 build: rework symbol extractor to support lazy/common chunks (#61566)
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.

PR Close #61566
2025-05-29 14:39:11 -04:00
Kristiyan Kostadinov
92cbd7a412 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:09 +00:00
Paul Gschwendtner
a1bf58e32e build: migrate symbol-extractor to ts_project (#61156)
Migrates the symbol-extractor code to `ts_project`.

PR Close #61156
2025-05-07 11:28:59 -07:00
Andrew Kushnir
a16ba58e2b build: add build step to the symbol extractor script (#60573)
This commit adds a step where we build all found targets in parallel, which speeds up the process of completing symbol extractor test/update.

PR Close #60573
2025-03-27 18:13:04 +00:00
Jessica Janiuk
4b312aeb43 ci: fix over extraction of init symbols in symbol tests (#60493)
This omits including any init_ symbols in the symbol tests that were unnecessary and causing friction.

PR Close #60493
2025-03-20 12:31:34 -07:00
Johnson Chu
a6cdbec09f refactor: remove unnecessary TSLint rule flags (#59365)
There are many TSLint rule flags in the source code that have no effect, and they can be safely removed to keep the code clean.

PR Close #59365
2025-01-07 16:06:21 +00:00
Kristiyan Kostadinov
8230388aa8 build: simplify symbol tests format (#59147)
Switches the goldens for the symbol tests to be an array of strings, rather than an array of objects where each object only has a `name` property. This makes more compact, easier to read and easier to avoid merge conflicts.

PR Close #59147
2024-12-12 14:59:13 -08:00
Joey Perrott
9dbe6fc18b refactor: update license text to point to angular.dev (#57901)
Update license text to point to angular.dev instead of angular.io

PR Close #57901
2024-09-24 15:33:00 +02:00
Joey Perrott
fd544159e3 ci: complete migration to prettier formatting (#55580)
Format the remaining unformatted files in the repository

PR Close #55580
2024-04-29 14:00:16 -07:00
Joey Perrott
dc62446ef7 refactor: migrate tools to prettier formatting (#53947)
Migrate formatting to prettier for tools directory from clang-format

PR Close #53947
2024-01-16 19:17:49 -08:00
Paul Gschwendtner
b97d591ff4 build: improve debugging of symbol extractor tests (#49000)
Always print the path to the JS input file so that its easy to jump to
it.

PR Close #49000
2023-02-13 09:12:50 +01:00
Paul Gschwendtner
90c2088679 build: make devmode a noop and ensure it never runs (#48521)
This is basically a pre-step for combining devmode and prodmode into a
single compilation. We are already achieving this now, and can claim
with confidence that we reduced possible actions by half. This is
especially important now that prodmode is used more often, but rules
potentially still using the devmode ESM sources. We can avoid double
compilations (which existed before the whole ESM migration too!).

We will measure this more when we have more concrete documentation
of the changes & a better planning document.

Changes:

  * ts_library will no longer generate devmode `d.ts`. Definitions are
    generated as part of prodmode. That way only prodmode can be exposed
    via providers.
  * applied the same to `ng_module`.
  * updates migrations to bundle because *everything* using `ts_library`
    is now ESM. This is actually also useful in the future if
    schematics rely on e.g. the compiler.
  * updates schematics for localize to also bundle. similar reason as
    above.

PR Close #48521
2022-12-19 19:50:45 +00:00
Paul Gschwendtner
04e9696cf5 refactor: update tools tests and scripts to work with Bazel ESM (#48521)
* The Karma Bazel Saucelabs binary needs to use `.mjs` as everything in
  the repo w/Bazel is supposed to be ESM.
* The symbol extractor test is updated to no longer use CommonJS
  features like `require.resolve`.

PR Close #48521
2022-12-19 19:50:44 +00:00
Paul Gschwendtner
13d3039c7d refactor: convert AIO tooling scripts used in Bazel to ESM (#48521)
Since the Bazel setup in this repo will now always use ESM,
the tooling scripts/binaries in AIO need to be switched to ESM
too. Most of the scripts are already ESM, but a few had to be converted.

Note that the Dgeni generation does not use ESM because it's unaffected
and the Dgeni CLI is used. In the future we could also update the Dgeni
setup to ESM but there is no need currently.

PR Close #48521
2022-12-19 19:50:44 +00:00
Paul Gschwendtner
810351ab4c refactor: update symbol extractor test tool to work with ESM (#48521)
The symbol extractor test tool now runs with ESM too. This commit
makes it ESM compatible.

PR Close #48521
2022-12-19 19:50:42 +00:00
Paul Gschwendtner
eac5280bec build: support template make variables in nodejs_binary/test (#48521)
We modified the macros of `nodejs_binary/test` to have a rule
in between that requests the `.mjs` output. This works fine but
breaks make variable substitution for `templated_args` because
Bazel requires referenced labels to be part of the explicit `data`.

The rule in between breaks this, so we add a new argument that
can be used for such "template"/"args" data dependencies.

This can be removed when everything is ESM and we don't need
the rule in between.

PR Close #48521
2022-12-19 19:50:41 +00:00
Paul Gschwendtner
95555658cf build: disable bazel nodejs linker to improve stability on windows (#45872)
The NodeJS Bazel linker does not work well on Windows because there
is no sandboxing and linker processes from different tests will attempt
to modify the same `node_modules`, causing concurrency race conditions
and resulting in flakiness.

PR Close #45872
2022-05-04 16:20:57 -07:00
Paul Gschwendtner
c3a5568143 build: update symbol extractor to support IIFE bundles using arrow-functions (#44490)
Updates the symbol extractor to support IIFE bundles using
arrow-functions instead of function declarations. This is in preparation
for running symbol extraction tests with the overhauled optimization
pipeline for Angular v13, relying on ESBuild internally.

Also removes rollup-specific code that does not seem to be relevant
anymore / rollup will be replaced anyway.

PR Close #44490
2022-01-04 12:14:14 -08:00
Alex Rickabaugh
aadfad739b build: remove view engine build infrastructure (#43884)
This commit removes --config=viewengine and makes Ivy the default for
building Angular.

PR Close #43884
2021-11-23 21:10:06 +00:00
Joey Perrott
00d801122c build: Use Ivy compiler for bazel builds by default (#43862)
Setting the angular_ivy_enabled environment variable to True will default Bazel builds to use the Ivy
compiler rather than defaulting to ViewEngine.

PR Close #43862
2021-10-19 10:06:54 -07:00
Alan Agius
e7b647fc06 refactor(dev-infra): remove dependency on minimist (#43644)
Refactor scripts to use `yargs`. The main motivation for this is to align and use a single parser.

PR Close #43644
2021-10-04 17:31:03 -07:00
Paul Gschwendtner
8d7f1098d8 refactor: make all imports compatible with ESM/CJS output. (#43431)
As outlined in the previous commit which enabled the `esModuleInterop`
TypeScript compiler option, we need to update all namespace imports
for `typescript` to default imports. This is needed to allow for
TypeScript to be imported at runtime from an ES module.

Similar changes are needed for modules like `semver` where the types incorrectly
suggest named exports that will not exist at runtime when imported from ESM.

This commit refactors all imports to match with the lint rule we have
configured in the previous commit. See the previous commit for more
details on why certain imports have been changed.

A special case are the imports to `@babel/core` and `@babel/types`. For
these a special interop is needed as both default imports, or named
imports break the other module format. e.g default imports would work
well for ESM, but it breaks for CJS. For CJS, the named imports would
only work, but in ESM, only the default export exist. We work around
this for now until the devmode is using ESM as well (which would be
consistent with prodmode and gives us more valuable test results). More
details on the interop can be found in the `babel_core.ts` files (two
interops are needed for both localize/or the compiler-cli).

PR Close #43431
2021-10-01 18:28:45 +00:00
Paul Gschwendtner
6e7ef195a5 test: update size goldens to reflect new ES2020 terser v5 output (#43431)
For APF v13, terser has been updated to v5, and the prodmode output
has changed from ES2015 to ES2020. This results in some changes in
the symbol extractor test. Here are the two causes of changes:

* As said in the previous commit, Terser drops the initializer for
  variables which are set to `undefined`. We have updated the symbol
  extractor to always capture such declarations w/o initializer now.

  This means that a couple of declarations that a couple of new
  symbols are captured now. These previously didn't have an initializer
  even without Terser, and just didn't show up before.

* Terser changed its inline mechanism for functions that recursively
  call themselves. Such functions are no longer inlined and therefore
  show up in goldens now.

PR Close #43431
2021-10-01 18:28:42 +00:00
Paul Gschwendtner
c781521606 build: update symbol extractor test to work with terser v5 (#43431)
Updates the symbol extractor test to work with Terser v5 that
drops the variable declaration initializer if it is explicitly set
to `undefined`. We want to capture such identifiers in the bundles
as otherwise the majority of top-level declarations which are intially
set to `undefined` would be hidden in size goldens.

PR Close #43431
2021-10-01 18:28:42 +00:00
Paul Gschwendtner
fd9a7ca8c9 build: update to latest version of rules_nodejs v3.3.0 (#41599)
Updates to the latest version of `rules_nodejs` that supports
the most recent NodeJS lts version v14.16.1.

Additionally the latest version of `rules_nodejs` provides
[a package for runfile resolution](https://github.com/bazelbuild/rules_nodejs/pull/2568) w/ types that we can leverage.

PR Close #41599
2021-04-13 17:37:28 -07:00
Joey Perrott
b8b8535f40 build: update tools directory for latest changes in rules_nodejs (#40710)
Update the scripts/tooling in the tools directory to handle the changes in the latest
version of rules_nodejs.

PR Close #40710
2021-02-09 10:48:43 -08:00
Andrew Kushnir
8dbd2204c3 fix(dev-infra): fix yarn symbol-extractor command (#40163)
The `yarn symbol-extractor:check` and `yarn symbol-extractor:update` commands don't seem to work currently -
the script is unable to calculate the list of relevant targets. Running the `bazel query ...` command used in the
script fails due to the missing quotes around the query argument. This commit fixes the problem by updating the
script to wrap query argument into single quotes.

PR Close #40163
2021-01-06 10:31:24 -08:00
Joey Perrott
593bd594e3 build: create temporary script for symbol extractor tests (#38819)
Creates a temporary script to running all symbol extractor tests.

PR Close #38819
2020-09-14 16:54:39 -07:00
Joey Perrott
284c70ee9d build: add tag to symbol-extractor tests (#38819)
Add a tag to symbol-extractor tests to allow for bazel querying.

PR Close #38819
2020-09-14 16:54:36 -07:00
Paul Gschwendtner
e382632473 build: fix symbol extractor not dealing with ES2015 classes (#38093)
We recently reworked our `ng_rollup_bundle` rule to no longer output
ESM5 and to optimize applications properly (previously applications were
not optimized properly due to incorrect build optimizer setup).

This change meant that a lot of symbols have been removed from the
golden correctly. See: fd65958b88

Unfortunately though, a few symbols have been accidentally removed
because they are now part of the bundle as ES2015 classes which the
symbol extractor does not pick up. This commit fixes the symbol
extractor to capture ES2015 classes. We also update the golden to
reflect this change.

PR Close #38093
2020-07-16 13:54:23 -07:00
Joey Perrott
d1ea1f4c7f build: update license headers to reference Google LLC (#37205)
Update the license headers throughout the repository to reference Google LLC
rather than Google Inc, for the required license headers.

PR Close #37205
2020-05-26 14:26:58 -04:00
Joey Perrott
698b0288be build: reformat repo to new clang@1.4.0 (#36613)
PR Close #36613
2020-04-14 12:08:36 -07:00
Greg Magolan
63fbc71439 build: don't use deprecated $(location) pre-declared variable (#36308)
$(location) is not recommended in the bazel docs as depending on context it will either return the value of $(execpath) or $(rootpath). rules_nodejs now supports $(rootpath) and $(execpath) in templated_args of nodejs_binary.

PR Close #36308
2020-03-31 11:02:56 -07:00
Joey Perrott
4022376b3f build: update scripting and tooling to rely on define=angular_ivy_enabled instream of define=compile (#33983)
We need to migrate to using angular_ivy_enabled value to determine whether to use
Ivy or ViewEngine for package building scripts and for size-tracking and
symbol-extract tooling.

PR Close #33983
2019-11-26 16:38:40 -05:00
Matias Niemelä
9c13d6e8e6 refactor(ivy): rename tView.firstTemplatePass to tView.firstCreatePass (#31270)
PR Close #31270
2019-11-04 21:39:23 +00:00
Greg Magolan
4ee354da99 build: switch to @build_bazel_rules_nodejs//:index.bzl load point (#33433)
The defs.bzl load point will be removed for the rules_nodejs 1.0 release.

PR Close #33433
2019-10-28 10:10:48 -07:00
Kara Erickson
64fd0d6db9 refactor(core): rename ngComponentDef to ɵcmp (#33088)
Component defs are not considered public API, so the property
that contains them should be prefixed with Angular's marker
for "private" ('ɵ') to discourage apps from relying on def
APIs directly.

This commit adds the prefix and shortens the name from
`ngComponentDef` to `cmp`. This is because property names
cannot be minified by Uglify without turning on property
mangling (which most apps have turned off) and are thus
size-sensitive.

Note that the other "defs" (ngDirectiveDef, etc) will be
prefixed and shortened in follow-up PRs, in an attempt to
limit how large and conflict-y this change is.

PR Close #33088
2019-10-11 15:45:22 -07:00
Alex Eagle
ef0b2cc74d build: convert entry_point to label (#30627)
PR Close #30627
2019-06-11 00:03:11 +00:00
Paul Gschwendtner
dd59b1d371 build: unable to accept new symbol-extractor golden on windows (#30127)
Currently when working on Windows, it's not possible to accept a new
golden for a `symbol-extractor` Bazel test. This is because the generated
executable output from the `nodejs_binary` rule (without a macro) misses
a Windows executable wrapper that sets up the proper environment
variables for the runfiles. Causing the following failure on Windows:

```
 >>>> FAIL: RUNFILES environment variable is not set. <<<<
```

PR Close #30127
2019-04-26 16:35:51 -07:00
Greg Magolan
ea09430039 build: rules_nodejs 0.26.0 & use @npm instead of @ngdeps now that downstream angular build uses angular bundles (#28871)
PR Close #28871
2019-02-28 12:06:36 -08:00