Commit graph

854 commits

Author SHA1 Message Date
Alan Agius
8f65223bd8 fix(core): update min Node.js support to 20.19, 22.12, and 24.0 (#61499)
This is to match the versions of the Angular CLI.

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

PR Close #61499
2025-05-20 14:15:13 +00:00
Joey Perrott
447b2a3690 build: migrate animations to use rules_js based toolchain (#61479)
Migrate animations to use `ts_project` and `ng_project`

PR Close #61479
2025-05-20 08:46:33 +00:00
Angular Robot
24ae05f3f8 build: update all non-major dependencies (#61458)
See associated pull request for more information.

PR Close #61458
2025-05-19 09:53:46 +00:00
Alan Agius
cf8c853523 build: remove @types/diff (#61447)
The latest diff package includes the TS types.

PR Close #61447
2025-05-19 09:17:47 +00:00
Angular Robot
d59ed604b5 build: update all non-major dependencies (#61168)
See associated pull request for more information.

PR Close #61168
2025-05-16 09:33:25 +00:00
Paul Gschwendtner
b71c35a6b5 refactor: update packages/core:{core,src} to ts_project (#61275)
Updates `packages/core:core` and `packages/core/src/...` to `ts_project`
of `rules_js`.

PR Close #61275
2025-05-14 12:01:51 +00:00
Alan Agius
a7b58e3c5a build: update dependency @rollup/plugin-node-resolve to v16 (#61326)
See associated pull request for more information.

Closes #61323 as a pr takeover

PR Close #61326
2025-05-14 11:18:15 +00:00
Kristiyan Kostadinov
f6bb6cc09a build: set up runtime tests for selectorless (#61307)
Sets up the tests for the selectorless runtime so that we can easily start writing them when we get to it. The tests need to be AoT compiled so they're defined as a separate target from the other `acceptance` tests.

PR Close #61307
2025-05-14 11:06:22 +02:00
Paul Gschwendtner
54e785683a 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:46 +00:00
Alan Agius
d5c6f2c4de refactor: add Node.js 24 as supported version (#61142)
Node.js 24 has been released https://nodejs.org/en/about/previous-releases

Closes: #61140

PR Close #61142
2025-05-06 13:38:25 -07:00
Paul Gschwendtner
7fc14d7f26 build: fix adev first party linking and re-enable tests (#60825)
This commit attempts to finally fix the long-standing first-party
package linking issue with the rather tricky `rules_nodejs` toolchain.

I've verified that no version of e.g. `@angular/core` ends up in the
Bazel sandbox. This is achieved by also filtering transitive Angular
deps for first-party linked packages. e.g. `@angular/docs`.

In addition, `@angular/docs` accidentally ended up bundling parts of
Angular core because it relied on an entry-point that was not part of
the "well known externals". As part of the ongoing `ng_package`
update/rewrite, we should look into disabling bundling of ANY external
dependency/module. This is possible because we use relative imports
inside APF packages as of recently!

This commit should allow us to develop and continue new compiler
features, without having to temporarily (or longer) disable all
`angular.dev` unit tests!

Fixes #54858.

PR Close #60825
2025-04-10 14:19:52 +00:00
Alan Agius
62859d941a build: avoid export internal renames (#60739)
There is no need to minify internal names as these are minified by the consuming app

PR Close #60739
2025-04-04 09:49:14 -07:00
Andrew Kushnir
eb97303769 test(bazel): update common package contents test to skip chunks (#60623)
This commit updates the `common` package contents test to skip JS chunks, while still making sure that the main entrypoint files are present.

PR Close #60623
2025-04-01 15:58:51 +00:00
Alan Agius
fe9b79b615 feat(core): update Node.js version support (#60545)
Node.js v18 will reach End-of-Life on April 30, 2025, and will no longer be supported in Angular v20.
Node.js Release Schedule: https://github.com/nodejs/release#release-schedule

BREAKING CHANGE:
- Angular no longer supports Node.js v18.
- Node.js versions 22.0 to 22.10 are also no longer supported.

Before upgrading to Angular v20, ensure the Node.js version is at least 20.11.1.
For the full list of supported versions, visit: https://angular.dev/reference/versions

PR Close #60545
2025-03-26 20:42:16 -07:00
Kristiyan Kostadinov
2637a0cdad build: enable strict templates and type checking of host bindings (#60481)
Enables strict templates and type checking of host bindings against our own code.

PR Close #60481
2025-03-20 11:55:52 -07:00
Kristiyan Kostadinov
84b3721351 refactor(compiler-cli): produce host binding type checking information for components (#60267)
Sets up the logic that produces the information necessary to type check host bindings of a component. Also introduces a compiler flag for toggling checking of host bindings.

PR Close #60267
2025-03-17 14:28:40 +01:00
Paul Gschwendtner
4fa5d18e5a feat(bazel): support bundling .d.ts with code splitting (#60321)
Instead of relying on Microsoft's API extractor for `d.ts` bundling,
we are switching to Rollup-based `.d.ts` bundling.

This allows us to support code spliting, even for `.d.ts` files,
allowing for relative imports to be used between entry-points, without
ending up duplicating `.d.ts` definitions in two files. This would otherwise cause
problems with assignability of types.

It also nicely integrates into our existing rollup configuration, and
overall simplifies the `ng_package` rule even further!

Notably `tsup` also uses this rollup plugin, and it seems to work well.
Keep in mind that Microsoft's API extractor is pretty hard to integrate,
caused many problems in the past, and isn't capable of code splitting.
This aligns our d.ts bundling with the .mjs bundling (great alignment).

PR Close #60321
2025-03-11 13:03:08 -07:00
Joey Perrott
07dc8063bf refactor(bazel): remove primary_bundle_name as attr for ng_package (#60306)
Remove primary_bundle_name as an attr for ng_package as it is unused.

PR Close #60306
2025-03-10 09:31:20 -07:00
Joey Perrott
c0ce5ec6db refactor(bazel): hardcode esm as the ouput for rollup (#60306)
Remove the option as an arg for creating a rollup config since it is static.

PR Close #60306
2025-03-10 09:31:20 -07: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
Alan Agius
45f899a272 refactor: replace fast-glob usage with tinyglobby (#60264)
Usage of the `fast-glob` package has been replaced with the `tinyglobby` package. The change reduces the number of transitive dependencies related to these packages from 17 to 2 while also maintaining equivalent functionality. This was also changed in the Angular CLI packages.

PR Close #60264
2025-03-07 10:57:23 -08:00
Paul Gschwendtner
978a0b8493 refactor: add fast-glob to bazel dependencies (#60253)
This will be necessary for downstream (private) consumers
of the `@angular/bazel` package.

PR Close #60253
2025-03-06 12:50:29 -08:00
Paul Gschwendtner
1f1039475c feat(bazel): support shared chunks in ng_package (#60241)
Historically we've had to be VERY cautious about the way we import
things between entry-points. That is because the `ng_package` rule
bundling is subject to silently introducing code duplication, breaking
singletons etc. We've had this surface a couple of times already, and
dev-infra tried to help detect such cases by adding safety analysis into
`ng_package`.

Long-term we want to get to an approach where it's easy to simply share
code between chunks. Precisely, with the upcoming `rules_js` migration,
this will be necessary as we will have different import "guidelines"
that would currently, before this commit, result in code duplication, or
trigger our "safety check/lint".

This commit prepares `ng_package` to support relative imports between
entry-points, so that we only need the safety check for cross-package
imports/exports. The result is that `ng_package`/APF is now smartly able
to generate shared chunks for things that are needed between multiple
entry-points. Yay!

Note that those shared chunks still remain private, and are guarded by
our `package.json` "exports"; so no new public API surface is
exposed.

PR Close #60241
2025-03-06 10:29:05 -08:00
naaajii
b4feeb5a7d docs: update license year (#59883)
updates the year in footer and placeholder for generated files

PR Close #59883
2025-03-04 19:36:47 +00:00
Kristiyan Kostadinov
326d48afb4 feat(core): drop support for TypeScript older than 5.8 (#60197)
Narrows down the versions of TypeScript we need to support.

BREAKING CHANGE:
* TypeScript versions less than 5.8 are no longer supported.

PR Close #60197
2025-03-04 17:39:06 +00:00
iteriani
78b27a83fb refactor(core): Move getCurrentInjector/setCurrentInjector to primitives package. (#60090)
This change casts the injector back and forth since all instances of
injector currently don't implement the `retrieve` method. Note that
the retrieve method is seen as optional, so that Angular can revert back to
inject if necessary.

PR Close #60090
2025-02-28 18:47:08 +00:00
Kristiyan Kostadinov
146ab9a76e feat(core): support TypeScript 5.8 (#59830)
Updates the repo to support TypeScript 5.8 which is currently in beta.

PR Close #59830
2025-02-03 14:00:41 -08:00
Paul Gschwendtner
a25396d562 fix(bazel): support setting type: module in source package.json (#59406)
This is helpful as it allows us to set `type: module` in the checked-in
package files, useful for the hybrid mode of `rules_js` and
`rules_nodejs`, where the package.json files can control the execution
format.

PR Close #59406
2025-01-08 15:24:05 +00:00
Max Katz
6aeda99a3e docs: update copyright year (#59359)
PR Close #59359
2025-01-06 19:58:30 +00:00
Paul Gschwendtner
cc7634f498 fix(bazel): handle module names and ES output in hybrid ts_project mode (#59325)
`ts_project` interop does not emit `.mjs` files. We could achieve this
in the interop rule, but it's better to just fallback look for `.js`.

In addition, `ng_package` currently fails because there is no
`module_name` retrievable from the interop rule; hence causing in
incorrect packaging and safety errors being thrown.

PR Close #59325
2025-01-06 17:29:19 +00:00
Paul Gschwendtner
f8d22a9ba4 fix(bazel): allow ng_package to work with rules_js dependencies (#59316)
Currently the module mapping aspect fails when it transitively discovers
a node module target managed by `rules_js`. That is because the targets
don't have a `deps` attribute as part of their rule definition.

PR Close #59316
2024-12-27 14:56:31 +00:00
Kristiyan Kostadinov
bd1f1294ae feat(core): support TypeScript 5.7 (#58609)
Updates the repo to allow for TypeScript 5.7 to be used.

PR Close #58609
2024-11-25 17:12:10 +00:00
Kristiyan Kostadinov
ff71af7f02 fix(bazel): allow strictStandalone to be passed through tsconfig (#58683)
Allows users to pass the `strictStandalone` compiler option through the tsconfig.

PR Close #58683
2024-11-15 12:53:10 +01:00
Alan Agius
7de7c52769 build: remove usages of useDefineForClassFields: false (#58297)
When setting `"useDefineForClassFields": false`, static fields are compiled within a block that relies on the `this` context. This output makes it more difficult for bundlers to treeshake and eliminate unused code.

PR Close #58297
2024-10-28 12:26:05 -07:00
Matthieu Riegler
09df589e31 refactor(core): Migrate all packages with the explicit-standalone-flag schematic. (#58160)
All components, directives and pipes will now use standalone as default.
Non-standalone decorators have now `standalone: false`.

PR Close #58160
2024-10-14 14:58:57 +00:00
Kristiyan Kostadinov
852c042520 refactor(compiler-cli): output HMR initializer code (#58150)
Adds the logic to the compiler that will output the HMR initializer code for each component, if enabled.

PR Close #58150
2024-10-11 07:03:15 +00:00
Matthieu Riegler
fb321966aa build: Add LICENSE file to the generated packages (#58033)
This commit adds a parameter to `ng_package` to specify a license file that will be bundled with the generated packages.

fixes #58029

PR Close #58033
2024-10-01 16:34:27 +00: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
Angular Robot
9f5798e511 build: update dependency @rollup/plugin-commonjs to v28 (#57929)
See associated pull request for more information.

PR Close #57929
2024-09-24 11:48:50 +02:00
Kristiyan Kostadinov
8bcc663a53 feat(core): drop support for TypeScript 5.4 (#57577)
TypeScript 5.4 is no longer supported.

BREAKING CHANGE:
* TypeScript versions less than 5.5 are no longer supported.

PR Close #57577
2024-08-29 10:19:20 -07:00
Alan Agius
d5cc9d5d71 feat(bazel): remove unused ESM2022 from APF (#57559)
We have removed the `esm2022` directory from the generated package, as it was unused and contributed 7.7 MB to `@angular/core`. The `ng_package` rule still passes `esm2022` to the packager to perform `analyzeFileAndEnsureNoCrossImports`.

A moment of reflection:
You've always been there, full of potential, yet never called upon. Now, we bid you farewell.

PR Close #57559
2024-08-28 08:45:38 -07:00
Kristiyan Kostadinov
b063468027 feat(core): support TypeScript 5.6 (#57424)
Updates the repo to add support for the upcoming TypeScript 5.6.

PR Close #57424
2024-08-19 22:45:45 -07:00
Michael Derfler
a2990757cc docs: fix links to docs (#57391)
PR Close #57391
2024-08-19 09:20:15 -07:00
Joey Perrott
0bd55a684f refactor(docs-infra): complete removal of aio directory (#56496)
Finish removal of aio directory as it is no longer used or relied upon.

PR Close #56496
2024-06-18 12:26:00 -07:00
Angular Robot
1653b40d14 build: update dependency @rollup/plugin-commonjs to v26 (#56281)
See associated pull request for more information.

PR Close #56281
2024-06-05 18:36:50 +00:00
Kristiyan Kostadinov
6cef0ed3ed refactor(compiler-cli): add compiler flag for testing let declarations (#56199)
Adds a private `_enableLetSyntax` flag that allows for let declarations to be enabled in tests.

PR Close #56199
2024-06-04 17:28:02 +00:00
Alan Agius
01172b84d9 build: update Node.js to match Angular CLI engines (#56187)
The current supported Node.js engines by the Angular CLI are `^18.19.1 || ^20.11.1 || >=22.0.0`

PR Close #56187
2024-06-03 18:00:46 +00:00
Kristiyan Kostadinov
e5a6f91722 feat(core): support TypeScript 5.5 (#56096)
Updates the repo to add support for TypeScript 5.5. Includes resolving some compilation errors and broken tests.

PR Close #56096
2024-05-29 15:33:33 +02:00
iteriani
811fe001c9 refactor(core): Replay events from the event contract using the dispatcher. (#55467)
This should accomplish event replay during full page hydration.

PR Close #55467
2024-04-23 16:08:36 -07:00
Alan Agius
9f5e90e03d build: make JSA contract binary accessible (#55361)
This commit integrates the JSA contract binary into the NPM package and ensures its accessibility by including it in the package exports. This adjustment is essential for enabling Angular CLI to effectively access and inject the script. Additionally, sourcemaps are removed from the minified bundle to prevent their inclusion in the HTML page.

PR Close #55361
2024-04-17 10:37:31 +02:00