Commit graph

27 commits

Author SHA1 Message Date
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
49813c5d85 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
Joey Perrott
557ac51c32 build: migrate to using new jasmine_test (#62131)
Migrate additional targets to jasmine_test

PR Close #62131
2025-06-19 10:06:27 +02:00
Paul Gschwendtner
579618d6d6 build: remove packages/bazel (#61843)
Removes the `@angular/bazel` package as we no longer need it. Yay!

It's replaced by `rules_angular`.

PR Close #61843
2025-06-04 09:13:41 +00:00
Paul Gschwendtner
b7c5645f05 build: migrate packages/compiler-cli to ts_project (#61826)
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 #61826
2025-06-03 11:41:52 +02:00
Paul Gschwendtner
a02e270fcb build: properly compile tests in core with Angular compiler (#60268)
Previously we never could use relative imports to import e.g. `Component`
in e.g. the `core/tests/bundling` folder. This was necessary because otherwise the
Angular compiler wouldn't process those files as it wouldn't recognize
the Angular decorator as the one from `@angular/core`.

Notably this still isn't a large issue because relative imports still
work for most core tests, that are JIT compiled!

For bundling tests though, or some smaller targets, our new upcoming
guidelines for using relative imports inside the full package; fall
apart. This commit unblocks this effort and allows us to use relative
imports in all tests of `packages/core`. This is achieved by leveraging
the existing `isCore` functionality of the compiler, and fixing a few
instances that were missing before.

PR Close #60268
2025-03-07 11:00:47 -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
Pawel Kozlowski
71f5ef2aa5 fix(migrations): change imports to be G3 compatible (#57654)
A set of fixes to the import paths - the goal is to make the
output migration compatible with the G3 infrastructure.

PR Close #57654
2024-09-04 17:05:56 +00:00
Kristiyan Kostadinov
bb977e0ba9 refactor(migrations): use common import manager for schematics (#57096)
Updates the schematics to reuse the common `ImportManager`, instead of having to maintain a separate one.

PR Close #57096
2024-07-23 12:17:41 -07:00
Paul Gschwendtner
7f550ea0c8 refactor(compiler-cli): move JIT transforms into ngtsc (#56892)
This commit moves the JIT transforms into the ngtsc folder. They existed
outside of ngtsc mostly as an historic artifact— and now with compiler
relying on them even more deeply, it makes sense to move them into
`ngtsc/transform`.

PR Close #56892
2024-07-10 17:29:20 +02:00
Joey Perrott
0d78a92431 refactor: migrate compiler-cli to prettier formatting (#55485)
Migrate formatting to prettier for compiler-cli from clang-format

PR Close #55485
2024-04-29 10:25:43 -07:00
Paul Gschwendtner
d74ee6e343 refactor(compiler-cli): group initializer-API based transforms into single transform (#54200)
Instead of maintaining individual transforms for `input`, `output`,
`model` etc. we are grouping them directly and the first one matching,
will execute.

This reduces needed traversal through AST and also makes it a little
more clean to write new initializer API metadata transforms.

Note: The Angular JIT transform is now also moving from `tooling.ts`
directly into `/transformers` for more local placement of transformer
logic.

PR Close #54200
2024-02-01 15:58:50 +00:00
Paul Gschwendtner
b2066d4922 refactor(compiler-cli): detect input functions without partial evaluation (#53872)
This allows us to ensure signal inputs and a potential JIT transform
remain single file compilation compatible. The consequences are that
options need to be statically analyzable more strictly, compared to
loosened restrictions with static interpretation where e.g. `alias`
can be defined through a shared variable.

PR Close #53872
2024-01-10 12:33:31 -08:00
Paul Gschwendtner
74099a3d4a test: add infrastructure to run signal acceptance tests with JIT and AOT (#53808)
Adds infrastructure to run signal input tests with JIT (using the
transform) and AOT. Acceptance tests for signal inputs will run with
both variants. In the future we can consider expanding this
infrastructure for all of our acceptance tests, but that's a different
story.

PR Close #53808
2024-01-10 12:21:06 +00:00
Paul Gschwendtner
eba017f8c7 refactor(compiler-cli): add transform to support signal input in JIT (#53808)
This commit adds a transform for supporting input signals in JIT
environments. The transform will be wired up for Angular CLI
applications automatically. An integration test verifies that this fixes
unit testing with signal inputs.

The transform basically will take the signal input metadata and
transform it into `@Input` decorators that can provide static
information to the Angular JIT runtime when the directive/component
definition is compiled.

PR Close #53808
2024-01-10 12:21:05 +00:00
Charles Lyding
119a94ef4b build: remove unneeded babel types postinstall patching (#53441)
These patches are no longer necessary with the current state of the
type packages and the code within the repository. The types are now
included in the already required babel.d.ts file for the relevant
babel packages (currently: `@babel/core` and `@babel/generator`).

PR Close #53441
2023-12-08 14:33:59 -08:00
Charles Lyding
ad52eeb164 refactor: reduce direct babel dependencies (#53441)
The `@babel/core` package provides the functionality of multiple other babel packages
without the need to directly depend or import the other babel packages. Since the
`@babel/core` package is already used and imported in the locations that previously
used the other babel packages, an overall reduction in both imports and dependencies
is possible. Six babel related packages were able to be removed from the root `package.json`
and one (also present in the aforementioned six) was removed as a dependency from the
`@angular/localize` package. Unfortunately, the functionality used from the `@babel/generator`
package is not provided by `@babel/core` and is still present. Further refactoring may
allow its removal as well in the future.

The following packages were removed:
* @babel/parser
* @babel/template
* @babel/traverse
* @babel/types
* @types/babel__template
* @types/babel__traverse

PR Close #53441
2023-12-08 14:33:59 -08:00
Alex Rickabaugh
299eae44a9 Revert "refactor: reduce direct babel dependencies (#53374)" (#53432)
This reverts commit 3b12c59696.

PR Close #53432
2023-12-07 13:21:15 -08:00
Alex Rickabaugh
fcc15ce24c Revert "build: remove unneeded babel types postinstall patching (#53374)" (#53432)
This reverts commit 4cdd5158ce.

PR Close #53432
2023-12-07 13:21:14 -08:00
Charles Lyding
4cdd5158ce build: remove unneeded babel types postinstall patching (#53374)
These patches are no longer necessary with the current state of the
type packages and the code within the repository. The types are now
included in the already required babel.d.ts file for the relevant
babel packages (currently: `@babel/core` and `@babel/generator`).

PR Close #53374
2023-12-07 09:34:22 -08:00
Charles Lyding
3b12c59696 refactor: reduce direct babel dependencies (#53374)
The `@babel/core` package provides the functionality of multiple other babel packages
without the need to directly depend or import the other babel packages. Since the
`@babel/core` package is already used and imported in the locations that previously
used the other babel packages, an overall reduction in both imports and dependencies
is possible. Six babel related packages were able to be removed from the root `package.json`
and one (also present in the aforementioned six) was removed as a dependency from the
`@angular/localize` package. Unfortunately, the functionality used from the `@babel/generator`
package is not provided by `@babel/core` and is still present. Further refactoring may
allow its removal as well in the future.

The following packages were removed:
* @babel/parser
* @babel/template
* @babel/traverse
* @babel/types
* @types/babel__template
* @types/babel__traverse

PR Close #53374
2023-12-07 09:34:22 -08: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
Kristiyan Kostadinov
6beff5e8d7 refactor(compiler): rework and expose APIs to be used in schematics (#48730)
Reworks some of the existing compiler APIs to make them easier to use in a schematic and exposes a few new ones to surface information we already had. High-level list of changes:
* `getPotentialImportsFor` now requires a class reference, instead of a `PotentialDirective | PotentialPipe`.
* New `getNgModuleMetadata` method has been added to the type checker.
* New `getPipeMetadata` method has been added to the type checker.
* New `getUsedDirectives` method has been added to the type checker.
* New `getUsedPipes` method has been added to the type checker.
* The `decorator` property was exposed on the `TypeCheckableDirectiveMeta`. The property was already present at runtime, but it wasn't specified on the interface.

PR Close #48730
2023-01-13 12:24:32 -08:00
JoostK
7bbddb5873 refactor(localize): update version of Babel (#44931)
The `@angular/localize` package depends on a version of Babel that is two years
old, so this commit updates to the latest version.

Some changes were made to the linker and compliance tests to account for slight
changes in source maps, along with a few code updates because of changes to
the typings of Babel.

PR Close #44931
2022-02-24 21:42:54 +00:00
Paul Gschwendtner
fe2a8de1b5 refactor(compiler-cli): expose tooling code through private entry-point (#43431)
Similar to the other private entry-points we have added for localize,
bazel or the migrations, we should expose the tooling code through
a dedicated private export. This will make the compiler-cli exports
more consistent and it will become easier for the CLI to export
necessary code.

PR Close #43431
2021-10-01 18:28:46 +00:00
Paul Gschwendtner
0fbd554948 refactor: switch packages away from deep cross-package imports (#43431)
The Angular Core and localize package currently use deep imports for
code that is shipped. This is problematic as we want to ship the
compiler-cli as full-ESM. To achieve this we need to use a bundler and
this breaks deep imports.

We use a bundler for the compiler CLI because for full ESM
compatibility, we would need to explicitly add the `.js` extension
to all relative imports. This is very cumbersome and prone to mistakes
so to mitigate this problem in a safe way, we bundle the compiler-cli.

Note: Deep imports continue to exist for the language service as it
bundles the compiler-cli.

PR Close #43431
2021-10-01 18:28:43 +00:00