Commit graph

2389 commits

Author SHA1 Message Date
Joey Perrott
6462ddd178 build: set up initial adev guide (#53208)
Set up the pipeline for guides in adev with first exampele, animations

PR Close #53208
2023-11-29 20:37:44 +00:00
Jeremy Elbourn
64db486edc build: add rules for generating block/element API data (#52480)
Adds build rules for "artificially" generating `DocEntry` collections for block and element APIs. The two rules are very similar, but _just_ different enough that it's worth having two separate implementations.

PR Close #52480
2023-11-02 11:02:08 -07:00
Jeremy Elbourn
a3abe1671c build: add target to generate api manifest (#52472)
This adds a target to generate a manifest of all public api symbols. The majority of inputs are generated from the extraction rules, but API entries that don't have a TypeScript source symbol (elements and blocks) are defined in hand-written json collections.

PR Close #52472
2023-11-02 11:00:59 -07:00
Jeremy Elbourn
fcc000e803 build: add targets for api doc generation (#52034)
This adds `generate_api_docs` targets to all of the packages for which we publish api reference docs. One known issue here is that any type information that comes from another package (e.g. router depending on core) currently resolve to `any` because the other sources are not available in the program. This can be tackled in a follow-up commit.

This commit also updates the install patch for `@angular/build-tools` to use the local version of compiler-cli.

PR Close #52034
2023-10-10 16:18:50 -07:00
Joey Perrott
f93352481b ci: migrate saucelabs bazel job to Github Actions (#51945)
Use Github Actions to run saucelabs bazel jobs

PR Close #51945
2023-10-05 09:18:34 -07:00
Alan Agius
0ee0f780e4 build: update dependency jasmine to v5 (#51820)
The patch is to fix upstream bug in `@bazel/jasmine`. See: bazelbuild/rules_nodejs#3691

PR Close #51820
2023-09-19 18:40:16 +02:00
Kristiyan Kostadinov
52cc7f839b build: align with internal tsconfig options (#51728)
Currently internally Angular has some customized tsconfig files, because we don't align with the tsconfig of the rest of g3. These changes enable `noImplicitReturns` and `noPropertyAccessFromIndexSignature` to align better with the internal config.

PR Close #51728
2023-09-12 11:39:42 -07:00
Alan Agius
4798ec4166 fix(zone.js): add conditional exports to zone.js package (#51652)
This is needed to better support native ESM modules and avoid the otherwise necessary deep imports like `zone.js/fesm2015/zone-node.js` due to disallowed directory imports.

PR Close #51652
2023-09-06 16:37:26 +00:00
Paul Gschwendtner
eab92167e5 build: enable video recording for saucelabs bazel tests (#51533)
We temporarily enable video recording for Saucelabs bazel tests. We are
seeing some flakiness here, and before we can replace the legacy job,
we should understand why the browsers sometimes disconnect.

PR Close #51533
2023-08-30 19:44:45 +00:00
Paul Gschwendtner
8a22c60ec0 build: improve debug logging of saucelabs daemon (#51533)
We should print more specific details about a browser being used
for tests. This will help us debug timeout/flakiness easier.

PR Close #51533
2023-08-30 19:44:45 +00:00
Paul Gschwendtner
a671020f0b build: increase idle timeout for saucelabs daemon (#51533)
Saucelabs seemingly has increased the maximum idle timeout. So we
leverage that to improve stability of our tests. Useful when e.g.
the heartbeat webdriver commands are for some reasons delayed.

PR Close #51533
2023-08-30 19:44:45 +00:00
Paul Gschwendtner
8cffdf36f7 build: update angular dev-infra and chromium (#50772)
Updates Angular dev-infra and Chromium. Fixed up version of
https://github.com/angular/angular/pull/50111

PR Close #50772
2023-06-20 17:20:49 +02:00
BrianDGLS
1e10df1c20 refactor(devtools): run spell check on tools dir (#50445)
Fix typo found in tools dir.

PR Close #50445
2023-05-24 13:56:56 +00:00
Paul Gschwendtner
4dc528d402 build: remove unused bash utilities from legacy build (#50427)
Removes an unused bash utility file that existed back when we
built using a Bash script.

PR Close #50427
2023-05-23 17:19:34 +00:00
Paul Gschwendtner
f7b8fb3c97 build: remove unused gulp helper script (#50428)
We still seem to be having Gulp installed for the ZoneJS changelog
generation. Arguably this can be replaced with a simpler JS script,
but in either case, this commit removes an unused file from the old
Gulp task setup.

PR Close #50428
2023-05-23 17:18:56 +00:00
Greg Magolan
0604285866 build: address last bit of review feedback for saucelabs daemon (#50430)
Follow-up to https://github.com/angular/angular/pull/50393.

PR Close #50430
2023-05-23 17:17:58 +00:00
Greg Magolan
34d73019f3 build: start only the minimum number of Saucelabs browsers required (#50393)
This should save on Saucelabs resources so that if only one saucelabs test is run then only one set of browsers will be started.

PR Close #50393
2023-05-23 14:12:28 +00:00
Greg Magolan
51d22fa98d build: address review feedback; should be ready to land now... additional chars to meet commit msg formatting requirements (#49200)
plus more additional chars here

PR Close #49200
2023-05-15 09:21:46 -07:00
Greg Magolan
fd35d9c646 build: address review feedback; added scripts/test/run-saucelabs-tests.sh script for local testing (#49200)
more chars to meet the linters requirements

PR Close #49200
2023-05-15 09:21:46 -07:00
Greg Magolan
5a9059be38 build: share Saucelabs browsers between karma test targets using background Saucelabs daemon and custom karma launcher (#49200)
This upgrades the Saucelabs Bazel step on CI to use the more efficient Saucelabs daemon

PR Close #49200
2023-05-15 09:21:46 -07:00
Angular Robot
59e332cc1e build: update dependency build_bazel_rules_nodejs to v5.8.2 (#49910)
See associated pull request for more information.

PR Close #49910
2023-04-18 20:45:24 +00:00
Alan Agius
77bdf77968 build: combine @bazel/concatjs patches (#49714)
This commit combines all the `@bazel/concatjs` patches

PR Close #49714
2023-04-05 10:54:29 -07:00
Alan Agius
6161c50214 build: force benchpress to be compiled with ES2020 (#49559)
Benchpress requires a decent amount of work to be ES2022 compliant. This will be done in a followup PR.

PR Close #49559
2023-03-23 08:18:45 -07:00
Alan Agius
00ef8dbf00 build: update ts_library to produce ES2022 (#49559)
This commit patches `ts_library` to be able to produce `ES2022`. Also, updates the build tsconfig and sets `useDefineForClassFields` to `false` to keep the same behaviour of `ng_module`.

PR Close #49559
2023-03-23 08:18:45 -07:00
Andrew Scott
589b66b379 Revert "build: update ts_library to produce ES2022 (#49332)" (#49554)
This reverts commit 262c989c81.

PR Close #49554
2023-03-22 14:34:25 -07:00
Andrew Scott
e917a81771 Revert "build: force benchpress to be compiled with ES2020 (#49332)" (#49554)
This reverts commit 132c00c2f8.

PR Close #49554
2023-03-22 14:34:25 -07:00
Alan Agius
132c00c2f8 build: force benchpress to be compiled with ES2020 (#49332)
Benchpress requires a decent amount of work to be ES2022 compliant. This will be done in a followup PR.

PR Close #49332
2023-03-22 14:00:20 -07:00
Alan Agius
262c989c81 build: update ts_library to produce ES2022 (#49332)
This commit patches `ts_library` to be able to produce `ES2022`. Also, updates the build tsconfig and sets `useDefineForClassFields` to `false` to keep the same behaviour of `ng_module`.

PR Close #49332
2023-03-22 14:00:20 -07:00
Paul Gschwendtner
c241f63e8d refactor(compiler-cli): remove unused class decorator downlevel code (#49351)
The decorator downlevel transform is never used for actual class
decorators because Angular class decorators rely on immediate execution
for JIT. Initially we also supported downleveling of class decorators
for View Engine library output, but libraries are shipped using partial
compilation output and are not using this transform anymore.

The transform is exclusively used for JIT processing, commonly for
test files to help ease temporal dead-zone/forward-ref issues. We can
remove the class decorator downlevel logic to remove technical debt.

PR Close #49351
2023-03-08 17:59:12 +00:00
Jessica Janiuk
a08a8ff108 fix(platform-server): bundle @angular/domino in via esbuild (#49229)
This removes one line that should effectively bundle the
angular fork of domino in via esbuild.

PR Close #49229
2023-02-28 13:34:50 -08:00
Kristiyan Kostadinov
99d874fe3b feat(core): add support for TypeScript 5.0 (#49126)
Updates the project to support TypeScript 5.0 and to resolve any errors that came up as a result of the update.

PR Close #49126
2023-02-28 08:24:47 -08:00
Angular Robot
31a2e21d09 build: update cross-repo angular dependencies (#48929)
See associated pull request for more information.

PR Close #48929
2023-02-14 14:46:07 +01: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
42619bd670 build: remove puppeteer, remaining usages of webdriver-manager and migrate AIO production test to Bazel (#49025)
This commit does three things that all related and required to get
rid of `webdriver-manager`:

* Our puppeteer protractor setup in AIO relies on webdriver-manager
because we install a corresponding chromedriver based on the puppeteer
chromium version. We would like to get rid of this brittle setup.

* We don't use `puppeteer` in many places because we manage chromium and
the driver through Bazel. This commit removes the remaining puppeteer
usage and replaces it with the Bazel-managed canonical browser

* We need to migrate the AIO production URL tests to Bazel. These
weren't part of Aspect's migration. This is needed so that we can drop
puppeteer and use the Bazel browser setup.

* Migrates some at-runtime TS `ts-node` test setup to proper idiomatic
Bazel code. Needed because it depends on code that also had to be
migrated to Bazel given the production e2e test Bazel migration (above
points).

Note: The xregexp dependency had to be added to the root project because
`ts_library` does not support compilation deps from `@aio_npm`. This is
something we will fix anyway when we have a more modern toolchain!

PR Close #49025
2023-02-10 19:22:18 +00:00
Paul Gschwendtner
1898190c28 build: update ng-dev and account for stamping changes (#48731)
* updates ng-dev and build-tooling since the previous SHAs are
no longer existent after the CircleCI incident snapshot build removal.
* accounts for the new stamping variables.

PR Close #48731
2023-01-13 14:10:39 +00:00
Paul Gschwendtner
74ba3021da build: do not rely on CommonJS module global for Bazel karma saucelabs (#48573)
The Karma Saucelabs script for Bazel & Saucelabs relies on some CommonJS
specific features. This commit replaces it with an ESM-compatible
alternative so that it can execute because `nodejs_binary` requires ESM
files now.

PR Close #48573
2022-12-23 14:16:33 +00:00
Paul Gschwendtner
f8b3744103 build: only generate bazel saucelabs targets for //packages/ (#48554)
With the recent ESM changes we also started generating Saucelabs
targets for `//devtools` (as part of an effort to avoid code
duplication). We should skip Saucelabs targets for this package
because we don't intend to run them on Saucelabs and this whole
setup needs some more work (and we shouldn't change unexpectedly).

PR Close #48554
2022-12-21 12:58:27 +00:00
Paul Gschwendtner
9add063c17 refactor: update packages/bazel npm artifact to not rely on defaults.bzl (#48521)
Fixes that we temporarily broke the Bazel npm package artifact as
part of the ESM work. This commit adjusts it and also makes the
artifact subsitutions more maintainable.

PR Close #48521
2022-12-19 19:50:45 +00: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
623ca1f787 build: remove remaining usages of deprecated ts_devserver (#48521)
* Switches all remaining targets (even if not tested and failing as per
  build) away from `ts_devserver` to the canonical `http_server` from
  dev-infra.

PR Close #48521
2022-12-19 19:50:44 +00:00
Paul Gschwendtner
5c10efe002 build: fix legacy saucelabs test bundle generation after ESM changes (#48521)
ZoneJS is no longer loaded as an UMD, but instead is included as part
of the browser init entry-point. This means that ZoneJS is bundled and
the ESBuild logic needs to be adjusted for that.

PR Close #48521
2022-12-19 19:50:44 +00:00
Paul Gschwendtner
84ef1b0719 build: update build-tooling and adjust benchmark macros for ESM (#48521)
* The benchmark macro should also use devmode ESM 2020. No CommonJS
* The benchmark macro should always add `benchpress` as runtime
  dependency because it is loaded asynchronously.
* The protractor `nodejs_binary` should use our ESM-interop binary
so that ESM resolution works (e.g. when `await import(benchpress)` from
the driver utilities is invoked).

PR Close #48521
2022-12-19 19:50:44 +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
c841da82c2 refactor: simplify devtools setup given recent ESM changes (#48521)
Since the `defaults.bzl` repo-wide macros are now supporting ESM,
the special spec-bundle logic from `devtools` can be removed.

Also the esbuild configurations need to be updated to account
for the recent dev-infra build-tooling changes. Also properly
now ensures that `aysnc/await` is downleveled for ZoneJS compatibility.

PR Close #48521
2022-12-19 19:50:44 +00:00
Paul Gschwendtner
abfef9992a build: update dev-infra build tooling and properly handle builtin node: imports (#48521)
* Updates build-tooling to benefit from the latest `spec_bundle`
  improvements.
* Updates the ESM extension loader to not attempt adding extensions to
  builtin `node:` specifiers. This seems to be disallowed and cannot be
  handled gracefully (the attempts are part of a try/catch).

```

Use --sandbox_debug to see verbose messages from the sandbox
Error [ERR_UNKNOWN_BUILTIN_MODULE]: No such built-in module: node:fs.mjs
    at new NodeError (node:internal/errors:371:5)
    at ESMLoader.builtinStrategy (node:internal/modules/esm/translators:276:11)
    at ESMLoader.moduleProvider (node:internal/modules/esm/loader:236:14)
```

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
a425a1ce65 build: always attempt next/builtin resolution first when resolving modules (#48521)
Even with patched resolution, we should always attempt the next/builtin
NodeJS resolution first. It may find a module if there `node_modules`
relative to the context file. This would be more correct than looking
for a module always at the Bazel `npm` repository `node_modules` folder.

PR Close #48521
2022-12-19 19:50:44 +00:00
Paul Gschwendtner
00bcd77588 build: ensure esbuild nodejs_binary correctly wires up ESM loader (#48521)
ESBuild relies on the linker and we currently set up the ESM loader,
along with accidentally enabling the patched resolution loader. This
didn't cause any problems in sandbox, but outside of sandbox incorrect
ESBuild versions may be discovered because the loader looks at the
top-level `npm/` node modules before looking relative to e.g.
`@bazel/esbuild`

PR Close #48521
2022-12-19 19:50:44 +00:00
Paul Gschwendtner
cc5d3b75e2 refactor: update zone.js and tests to work with ESM (#48521)
* Adjusts tests to no longer rely on CommonJS features. Switches them to
  ESM
* Updates test initialization files to not double-initialize Jasmine now
  that bootstrap files are loaded after Jasmine. The `jasmine.boot`
  setup was hacky from `rules_nodejs` and will break in the future
  regardless if we e.g. use `rules_js` with actual unmodified `jasmine`.

PR Close #48521
2022-12-19 19:50:44 +00:00
Paul Gschwendtner
13c2515fec build: bundle tests for protractor tests to support ESM output (#48521)
Protractor does not support ESM, so we need to take all the ESM
output and bundle it into a CommonJS file. This comes at the cost
of not using actual ESM for execution, but the ESBuild bundle follows
strict ESM semantics so we can be sure it's compatible when we have
an ESM-compatible e2e test runner in the future.

PR Close #48521
2022-12-19 19:50:43 +00:00