Commit graph

5293 commits

Author SHA1 Message Date
RafaelJCamara
5c9e84acd6 docs: update license URL from angular.io to angular.dev and year of license to 2025 (#59407)
PR Close #59407
2025-01-09 10:27:54 -05: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
Alan Agius
7fd034e13f build: remove unused patch (#58821)
This commit removes an unused patch

PR Close #58821
2024-11-22 14:56:23 +00:00
Alan Agius
1e11d0ced5 build: fix path of @angular/ssr package (#58821)
The path was incorrect

PR Close #58821
2024-11-22 14:56:23 +00:00
Matthieu Riegler
2e3e9b137a refactor(platform-server): replace patch by CLI option. (#58256)
The CLI introduced a new option `experimentalPlatform` to disable loading a polyfill from node. We don't need to patch it anymore.

PR Close #58256
2024-10-21 09:09:07 -07:00
Matthieu Riegler
afcc3ee209 refactor(core): Migrate modules directory with the schematic. (#58160)
All components, directives and pipes will now use standalone as default. Non-standalone decorators have now .

PR Close #58160
2024-10-14 14:58:58 +00:00
Matthieu Riegler
84b6896956 refactor(platform-server): Add an ssr benchmark setup. (#57647)
In order to investigate the performances of SSR, this commit introduces a benchmark suite which will measure several step of the rendering.

PR Close #57647
2024-10-04 10:45:22 -07: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
ef2ad1b2ef refactor: add select scenario to the js-web-frameworks benchmark (#56362)
Add the row selection scenario to the existing benchmark so we can
automate perf measurements during experiments.

PR Close #56362
2024-06-13 08:59:18 -07:00
Pawel Kozlowski
485c3d929d refactor: run js-web-frameworks with noop zone (#56362)
Align setup of this benchmark with
https://github.com/krausest/js-framework-benchmark/tree/master/frameworks/keyed/angular-cf-nozone
by running without zone.js using noop zone.

PR Close #56362
2024-06-13 08:59:17 -07:00
Pawel Kozlowski
b94adb9fc7 refactor: use built-in control flow in js-web-frameworks benchmark (#55988)
Migrate the js-web-frameworks benchmark to use the built-in control flow
instead of the ngFor loop.

PR Close #55988
2024-05-23 14:09:38 +02:00
Mateusz Daniluk
de777afbc5 refactor: standardize doctype declaration to <!DOCTYPE html> (#51052)
This commit standardizes the doctype declaration across all HTML files in the project to use `<!DOCTYPE html>`

PR Close #51052
2024-02-01 19:29:46 +00:00
Joey Perrott
f9781f9804 refactor: migrate modules to prettier formatting (#53954)
Migrate formatting to prettier for modules directory from clang-format

PR Close #53954
2024-01-17 09:41:59 -08:00
Andrew Scott
c2dd703d2f refactor(core): Remove internal-only testability features (#53767)
This commit removes the testability features that are internal only.
This simplifies the implementation of testability which will need
updates to support zoneless. Those updates will be easier to manage if
the Testability implementation is simpler.
While protractor is indeed officially EOL, we will still need to do some
updates to support teams migrating to zoneless that have protractor
tests.

As far as protractor's own use of `whenStable`, it does not read the
internal only methods either:
https://github.com/angular/protractor/blob/master/lib/clientsidescripts.js
Anything else depending on these values are not following the defined public API
contract.

PR Close #53767
2024-01-09 14:46:46 -08:00
Charles Lyding
e149ebf228 build: update rxjs build version to v7 (#53500)
The version of rxjs used to build the repository has been updated to v7.
This required only minimal changes to the code. Most of which were type
related only due to more strict types in v7. The behavior in those cases
was left intact. The most common type related change was to handle the
possibility of `undefined` with `toPromise` which was always possible with
v6 but the types did not reflect the runtime behavior. The one change that
was not type related was to provide a parameter value to the `defaultIfEmpty`
operator. It no longer defaults to a value of `null` if no default is provided.
To provide the same behavior the value of `null` is now passed to the operator.

PR Close #53500
2023-12-18 16:25:37 +00:00
Etienne FRANK
9e2c3bbccb docs(forms): replace fb with formBuilder (#52795)
Shorten variable names isn't a good practice. To avoid spreading it, we removed it from Angular's documentation.

PR Close #52795
2023-11-13 18:59:03 +00:00
Andrew Kushnir
7981aad30e test(core): add benchmark for hydration runtime logic (#52206)
This commit adds a benchmark for hydration runtime logic, which contains 2 parts: a baseline (create DOM nodes from scratch) and a main scenario (DOM matching instead of re-creating nodes).

PR Close #52206
2023-10-18 12:07:12 -07:00
Andrew Kushnir
c76cac25eb test(core): add benchmark for defer runtime logic (#52222)
This commit adds a benchmark for `@defer` runtime logic and uses `@if` as a baseline.

PR Close #52222
2023-10-18 12:06:44 -07:00
Paul Gschwendtner
7be3620a13 build: fix IDE completion for benchmarks code (#51887)
We are including a file, for some reason, that is outside of the root
dir. This breaks TypeScript/ or more specifically VSCode from picking
up this tsconfig- breaking path mappings and hence auto completion.

PR Close #51887
2023-10-04 08:14:35 -07:00
Paul Gschwendtner
ffd3fca0a8 test: add benchmark for ng template outlet context modifications (#51887)
Adds a benchmark for potential upcoming `NgTemplateOutlet` context
logic updates.

PR Close #51887
2023-10-04 08:14:35 -07:00
aanchal
119eaa5651 docs: add lang attribute in html files (#51269)
PR Close #51269
2023-08-21 16:33:43 -07:00
Pawel Kozlowski
a88ae41504 build: remove AngularJS benchmarks (#50730)
This change removes benchmark scenarios written in AngularJS
as the framework reached EOL and those numbers are no longer
relevant.

PR Close #50730
2023-06-20 14:57:06 +02:00
Pawel Kozlowski
143b85184d refactor: remove benchpres tests for other frameworks (#50108)
Some of the benchpress tests were written against other UI
frameworks (ex.: incremental DOM, initial version of ivy)
and those frameworks are no longer a valuable comparision target.

PR Close #50108
2023-05-10 14:29:10 -07:00
Pawel Kozlowski
a22dd000c0 refactor: remove unused benchmarks (#50108)
The benchmarks in the 'old' directory are not used / maintained.

PR Close #50108
2023-05-10 14:29:10 -07:00
Matthieu Riegler
3b863ddc1e refactor(core): Remove ReflectiveInjector symbol (#48103)
The `ReflectiveInjector` symbol has been deprecated in v5 (11 major versions ago). This commit removes ReflectiveInjector and related symbols.

BREAKING CHANGE: The `ReflectiveInjector` and related symbols were removed. Please update the code to avoid references to the `ReflectiveInjector` symbol. Use `Injector.create` as a replacement to create an injector instead.

PR Close #48103
2023-04-04 16:43:53 -07:00
Andrew Kushnir
83a6e203e3 refactor(compiler): drop obsolete NgFactory and NgSummary config options (#48268)
The options to generate NgFactory and NgSummary files were added to Ivy for backwards compatibility with ViewEngine. Since ViewEngine was deprecated and removed, the NgFactory and NgSummary files are no longer used as well.

This commit drops obsolete options to generate NgFactory and NgSummary files. Also, the logic that generates those files is also removed.

PR Close #48268
2023-02-21 13:03:59 -08:00
Paul Gschwendtner
6f429ae8e0 refactor: make benchmarking syncing easier and add comments for future insight (#48521)
The way the benchmarking code is used and wired up in g3 is rather
magical. This change makes it easier to sync into g3 by using
conditional blocks, and also consistnetly using a single bundle name
(like it was before— we regressed here as part of the ESM initial
changes- but now with clear comments, it's more future-proof..)

PR Close #48521
2022-12-19 19:50:45 +00:00
Paul Gschwendtner
2e99dfdeb2 build: remove unused systemjs bootstrap benchmark scripts (#48521)
These files are not used and also should not be synced into g3.

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
3c9b4b51e2 refactor: update modules/ benchmarks and playgrounds to work with ESM (#48521)
* Switches away from the ESM-incompatible & unmaintained `ts_devserver`
  to `http_server`. This is the canonical server maintained by dev-infra
* Switches tests away from CommonJS specific logic. e.g. require.resolve
* Adjusts tests to work with Protractor spec bundling (Protractor does
  not support ESM execution, but we want to take ESM-written specs)
* Reworks playground and benchmarks to use `app_bundle` and `esbuild`
  instead of loading hundreds of files individually. This also makes
  tests more stable and more aligned with real applications.

PR Close #48521
2022-12-19 19:50:44 +00:00
Paul Gschwendtner
b757b1387c build: update dev-infra packages and account for build-tooling split from ng-dev (#46976)
The dev-infra build tooling is now decoupled from `ng-dev`. This will
make it easier to update `ng-dev` without necessarily needing to upgrade
the whole build system, Bazel etc. This is useful when e.g. new release
tool features have been added and should also be ported to active LTS
branches.

PR Close #46976
2022-08-02 09:37:37 -07:00
Paul Gschwendtner
4b1204cca7 build: disable jasminewd2 types for sourcemap playground test (#46888)
The sourcemap test in the e2e playground is now using async/await code.
This results in errors now with the Bazel TS compilation because it
detects that `expect` is returning a promise and should be awaited.

This happens due to the jasminewd2 types. We should just use the actual
jasmine types and not rely on the deprecated selenium control flow,
using explicit async/await in the whole test. This also solves the issue
with the source-map types being async/await now.

PR Close #46888
2022-07-19 09:40:54 -07:00
Paul Gschwendtner
d42ed733d8 test: update source-map tests to account for source-map breaking change (#46888)
The source-map package now requires the
`SourceMapConsumer`/`SourceMapGenerator` classes to be instantiated
asynchronously. This commit updates our tests to account for that.

PR Close #46888
2022-07-19 09:40:54 -07:00
Alex Rickabaugh
aac5344a53 test(core): remove renderComponent-based benchmarks (#46568)
This commit removes 2 benchmarks which are using the `renderComponent` and
`Renderer3` abstractions, both of which are experimental and unsupported.
Equivalent benchmarks exist for the real rendering code path.

PR Close #46568
2022-06-28 21:42:45 -07:00
Dylan Hunn
89d299105a feat(forms): Implement strict types for the Angular Forms package. (#43834)
This PR strongly types the forms package by adding generics to AbstractControl classes as well as FormBuilder. This makes forms type-safe and null-safe, for both controls and values.

The design uses a "control-types" approach. In other words, the type parameter on FormGroup is an object containing controls, and the type parameter on FormArray is an array of controls.

Special thanks to Alex Rickabaugh and Andrew Kushnir for co-design & implementation, to Sonu Kapoor and Netanel Basal for illustrative prior art, and to Cédric Exbrayat for extensive testing and validation.

BREAKING CHANGE: Forms classes accept a generic.

Forms model classes now accept a generic type parameter. Untyped versions of these classes are available to opt-out of the new, stricter behavior.

PR Close #43834
2022-04-12 17:37:04 +00:00
JoostK
71ee417fae refactor(core): remove unused logic from reflection capabilities (#45335)
This commit removes a bunch of methodss from `ReflectionCapabilities` as they
have gone unused. This also removes `Reflector` as it doesn't serve any purpose
and it is not exposed as public API, so can be safely removed.

PR Close #45335
2022-03-24 11:02:39 -07:00
Alan Agius
6eaaefd22e feat(core): drop support for Node.js 12 (#45286)
Node.js v12 will become EOL on 2022-04-30. As a result, Angular CLI v14 will no longer support Node.js v12.

BREAKING CHANGE:

Support for Node.js v12 has been removed as it will become EOL on 2022-04-30. Please use Node.js v14.15 or later.

PR Close #45286
2022-03-08 12:05:03 -08:00
Andrew Scott
7fd416d060 fix(router): Fix type of Route.pathMatch to be more accurate (#45176)
Route.pathMatch only allows `'full'|'prefix'` in reality. This commit
adjusts the type to be more strict and also adds a migration to adjust
existing code.

resolves #37469

BREAKING CHANGE:
The type of `Route.pathMatch` is now more strict. Places that use
`pathMatch` will likely need to be updated to have an explicit
`Route`/`Routes` type so that TypeScript does not infer the type as
`string`.

PR Close #45176
2022-02-24 18:44:07 +00:00
Andrew Kushnir
64acbc4242 refactor(core): drop all .ngfactory and .ngsummary imports (#44957)
This commit updates various places in the repo (mostly tests/examples) to drop all `.ngfactory` and `.ngsummary` imports as they are no longer needed in Ivy.

PR Close #44957
2022-02-07 15:31:49 -08:00
Andrew Kushnir
9eff8908af refactor(core): strict templates type-checking compatibility for perf tests (#44905)
This commit updates a type used in the transplanted views perf tests, to make the test compatible with strict template type-checking.

Currently, compiling the perf test results in the following TS error:
```
error TS2322: Type 'TemplateRef<{}>' is not assignable to type 'TemplateRef<NgForOfContext<any, any[]>>'.

17     <ng-container *ngFor="let n of views; template: template; trackBy: trackByIndex"></ng-container>
                                             ~~~~~~~~
```

PR Close #44905
2022-01-31 21:39:04 +00:00
Paul Gschwendtner
c8cd5d5f2c build: switch all instances from ng_rollup_bundle to app_bundle (#44490)
The `ng_rollup_bundle` rule has been replaced with a new rule called
`app_bundle`. This rule replicates the Angular v13 optimization
pipeline in the CLI, so that we can get better benchmarking results.
Also the rule is much simpler to maintain as it relies on ESbuild.

The old `ng_rollup_bundle` rule did rely on e.g. build-optimizer that no
longer has an effect on v13 Angular packages, so technically size
tests/symbol tests were no longer as correct as they were before. This
commit fixes that.

A couple of different changes and their explanation:

* Language-service will no longer use the benchmark rule for creating
  its NPM bundles! It will use plain `rollup_bundle`. ESBuild would have
  been nice but the language-service relies on AMD that ESBuild cannot
  generate (yet?)

* Service-worker ngsw-worker.js file was generated using the benchmark
  bundle rule. This is wrong. We will use a simple ESbuild rule in the
  future. The output is more predictable that way, and we can have a
  clear use of the benchmark bundle rule..

* A couple of benchmarks in `modules/` had to be updated to use e.g.
  `initTableUtils` calls. This is done because with the new rule, all
  files except for the entry-point are considered side-effect free. The
  utilities for benchmarks relied on side-effects in some
  transitively-loaded file (bad practice anyway IMO). We are now
  initializing the utilities using a proper init function that is
  exported...

PR Close #44490
2022-01-04 12:14:14 -08:00
Paul Gschwendtner
b23ce150d0 build: bundle spec files for saucelabs legacy job (#44281)
Bundle spec files similar to how it is done within the Angular
Components repo. This should simplify the setup and also speed
up the Saucelab job as only a single spec bundle would need to be
downloaded, compared to having to load hundreds of files through the
Saucelabs tunnel.

Also makes a couple of tests more robust with the emulators/and accounts
for ES2015 test runner changes. The tests should be less reluctant to
such build process changes.

Note for reviewers: Some imports have been simplified here. This work
came from Joey's original WIP for this. It's unclear to me whether this
is still needed, but it sounded like this was necessary for the ESBuild
bundling to work. I have robusted the module resolution plugin though,
so I doubt it's still needed. At the same time though: Not worth
reverting/trying as these changes are nice to have anyway!

Co-Authored-By: Joey Perrott <josephperrott@gmail.com>
Co-Authored-By: Paul Gschwendtner <paulgschwendtner@gmail.com>

PR Close #44281
2021-11-30 11:56:04 -05:00
Alex Rickabaugh
bb9ff6003c test: remove view-engine-only tests (#43884)
This commit removes most tests that were designated as only covering View
Engine code. It also removes tag filters from CI and local commands to run
tests.

In a few cases (such as with the packages/compiler tests), this tag was
improperly applied, and certain test cases have been added back running in
Ivy mode.

This commit also empties `@angular/compiler/testing` as it is no longer
necessary (this is safe since compiler packages are not public API). It can
be deleted in the future.

PR Close #43884
2021-11-23 21:10:06 +00:00
Joey Perrott
aef63e7ae5 build: remove "ivy-only" bazel tag (#43862)
Because all actions are assumed to be running on Ivy, things which only work on Ivy should not be marked as
Ivy only.

PR Close #43862
2021-10-19 10:06:55 -07:00
JoostK
05c08cac9a docs: refactor example apps to use dynamic imports for loadChildren (#43591)
The string syntax for `loadChildren` has been deprecated and is being
removed, so this commit refactors the examples to the new syntax.

PR Close #43591
2021-09-29 14:45:17 -07:00
Joey Perrott
81e4257761 build: remove dev-infra directory and migrate to relying on @angular/dev-infra-private-builds (#43061)
Remove the dev-infra directory and complete the migration to using the code generated by the
angular/dev-infra repository.

PR Close #43061
2021-08-16 10:44:27 -07:00
Paul Gschwendtner
12443ea739 build: remove skydoc and rules_sass from repository (#42760)
Skydoc is no longer used as `@angular/bazel` is no longer a
public API. The Sass rules were only used in a single place
in the repo where Sass is not really needed and has just been
added by accident most likely. We want to remove the Sass dependency
in preparation for Rules NodeJS v4.x where the Sass rules currently
still use an older version of `@bazel/worker` that is incompatible.

PR Close #42760
2021-07-09 14:50:15 -07:00
Paul Gschwendtner
b1fa1bf0d5 fix(dev-infra): ng_rollup_bundle rule should error if import cannot be resolved (#42760)
Rollup just prints a warning if an import cannot be resolved and ends up
being treated as an external dependency. This in combination with the
`silent = True` attribute for `rollup_bundle` means that bundles might
end up being extremely small without people noticing that it misses
actual imports.

To improve this situation, the warning is replaced by an error if
an import cannot be resolved.

This unveiles an issue with the `ng_rollup_bundle` macro from
dev-infra where imports in View Engine were not resolved but ended
up being treated as external. This did not prevent benchmarks using
this macro from working because the ConcatJS devserver had builtin
resolution for workspace manifest paths. Though given the new check
for no unresolved imports, this will now cause errors within Rollup, and
we need to fix the resolution. We can fix the issue by temporarily
enabling workspace linking. This does not have any performance
downsides.

To enable workspace linking (which we might need more often in the
future given the linker taking over patched module resolution), we
had to rename the `angular` dependency to a more specific one so
that the Angular linker could link into `node_modules/angular`.

PR Close #42760
2021-07-09 14:50:14 -07:00
Joey Perrott
aec2a2cbc2 fix(dev-infra): update build tooling for latest changes in rules_nodejs (#40710)
Update the build tooling to handle the changes in the latest version of rules_nodejs.

PR Close #40710
2021-02-09 10:48:43 -08:00