Commit graph

27870 commits

Author SHA1 Message Date
Jessica Janiuk
06bbc2fc4e refactor(core): Add defer block testing fixture (#51698)
This adds a fixture for being able to access and test defer blocks.

PR Close #51698
2023-09-13 10:47:04 -07:00
Andrew Kushnir
5a0d6aac74 release: cut the v17.0.0-next.4 release 2023-09-13 10:44:14 -07:00
Andrew Kushnir
a8ccc6f3b4 docs: release notes for the v16.2.5 release 2023-09-13 10:35:57 -07:00
Kristiyan Kostadinov
59387ee476 feat(core): support styles and styleUrl as strings (#51715)
Adds support for passing in `@Component.styles` as a string. Also introduces a new `styleUrl` property on `@Component` for providing a single stylesheet. This is more convenient for the most common case where a component only has one stylesheet associated with it.

PR Close #51715
2023-09-12 13:57:07 -07:00
Kristiyan Kostadinov
f9939757d3 build: skip simulated file system tests on Windows (#51738)
The code for detecting a Windows CI run from #51701 didn't work, because Bazel isolates the environment variables. These changes work around the issue by passing in a custom variable with the `--test_env` flag.

PR Close #51738
2023-09-12 12:56:27 -07:00
Jeremy Mowery
635318fd61 refactor: add readonly to public InjectionToken types (#51407)
This fixes warnings caused by an internal lint rule

refactor: add readonly to public InjectionToken types

PR Close #51407
2023-09-12 12:55:14 -07:00
Chinmay Chandak
92113d73dd docs: Fix misspelling in note of git commit --all (#51735)
In note of `git commit --all` command optional `-a` changed to `--all`
PR Close #51735
2023-09-12 12:25:42 -07:00
Shuaib hasan akib
3a09ee79b5 docs(docs-infra): replace twitter logo by new one (#51716)
PR Close #51716
2023-09-12 12:24:44 -07:00
Ben Hong
cbeef95c29 docs: migrate form-validation to standalone (#51709)
PR Close #51709
2023-09-12 12:24:03 -07:00
Ben Hong
65f7686769 docs: migrate reactive-forms to standalone (#51707)
PR Close #51707
2023-09-12 12:23:19 -07:00
Ben Hong
4e0a575262 docs: migrate forms-overview to standalone (#51699)
PR Close #51699
2023-09-12 12:22:46 -07:00
Ben Hong
7b0bfc1dd8 docs: migrate testing to standalone (#51684)
PR Close #51684
2023-09-12 12:22:14 -07:00
Ward Bell
b08323747e docs: Migrate 2nd set of template guide pages and code to Standalone (#51632)
Supplements PR 51364 Template Migration with overlooked pages and examples

Code migrated: `inputs-outputs`, `interpolation`, `property-binding`
Guide pages affected:
* `binding-overview.md`
* `event-binding.md` (already migrated; updated with link to explain passive events)
* `inputs-outputs.md`
* `interpolation.md`
* `property-binding-best-practices.md`
* `property-binding.md`
* `understanding-template-expr-overview.md` (archived)

E2E tests passed locally.

PR Close #51632
2023-09-12 12:21:32 -07:00
Ward Bell
f6ccb163aa docs: Migrate i18n guide pages and code to Standalone (#51589)
E2E tests passed locally

**Added `readme.md` to the example code**

This explains how to build and run the example for both English and French.

**Archived `i18n-optional-manual-runtime-locale.md`**

I was asked to cut out a substantial swath of this page by reviewer "zip-fa". All that remained was a brief paragraph.  I removed the page from the navigation after copying the remaining text to `i18n-optional-import-global-variants.md`. The page is still reachable by 3rd party links.

PR Close #51589
2023-09-12 12:20:45 -07:00
Ward Bell
44c7469495 docs: Migrate Universal guide and code to Standalone (#51564)
Heavily reworked with advice from Alan Agius.

FWIW
* `ng test` fails because there are no unit tests
* `yarn e2e` builds but fails - `Unable to start a WebDriver session.`

**Added `readme.md` to sample code**

Makes it easier for the casual downloader to try the example.

**Added `universal-ngmodule`**

The existing ngModule-based doc has a lot of guidance for developers who are still building with NgModule. Given that we are preserving the existing NgModule guidance (with modifications), it seems prudent to preserve the NgModule form of the Universal guidance. So I copied the existing guide and code to `universal-ngmodule` and added it to the left-side navigation under the "NgModules" sub-tree.

Warning: it retains all of the faults of the original guide ... faults that were addressed in the current revision.

PR Close #51564
2023-09-12 12:20:10 -07: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
caaabd8efe release: cut the zone.js-0.13.3 release (#51742)
PR Close #51742
2023-09-12 11:16:20 -07:00
Alex Rickabaugh
38c9f08c8d refactor(core): decouple effects from change detection (#51049)
Previously effects were queued as they became dirty, and this queue was
flushed at various checkpoints during the change detection cycle. The result
was that change detection _was_ the effect runner, and without executing CD,
effects would not execute. This leads a particular tradeoff:

* effects are subject to unidirectional data flow (bad for dx)
* effects don't cause a new round of CD (good/bad depending on use case)
* effects can be used to implement control flow efficiently (desirable)

This commit changes the scheduling mechanism. Effects are now scheduled via
the microtask queue. This changes the tradeoffs:

* effects are no longer limited by unidirectional data flow (easy dx)
* effects registered in the Angular zone will trigger CD after they run
  (same as `Promise.resolve` really)
* the public `effect()` type of effect probably isn't a good building block
  for our built-in control flow, and we'll need a new internal abstraction.

As `effect()` is in developer preview, changing the execution timing is not
considered breaking even though it may impact current users.

PR Close #51049
2023-09-12 08:12:56 -07:00
Alan Agius
e86d6dba27 fix(zone.js): temporary allow deep imports (#51737)
`jest-preset-angular` imports `zone.js` using deep imports. This commit temporary allow this until the correct entry-points are used upstream.

See: https://github.com/thymikee/jest-preset-angular/issues/2162

PR Close #51737
2023-09-12 08:07:58 -07:00
Alan Agius
74755c4b5e fix(zone.js): rename typings conditional export to types (#51737)
`typings` is not valid for TypeScript. See: https://www.typescriptlang.org/docs/handbook/esm-node.html for more information.

PR Close #51737
2023-09-12 08:07:57 -07:00
Andrew Scott
73e4bf2ed2 feat(router): Add feature to support the View Transitions API (#51314)
The View Transitions API enables easy animations when transitioning between different DOM states. This commit adds an opt-in feature to the Router which runs the component activation and deactivation logic in the document.startViewTransition callback. If the browser does not support this API, route activation and deactivation will happen synchronously.

resolves #49401

PR Close #51314
2023-09-11 10:36:10 -07:00
JiaLiPassion
ac56efa410 release: cut the zone.js-0.13.2 release (#51689)
PR Close #51689
2023-09-11 09:22:12 -07:00
Andrew Scott
2d5b6fad4e fix(docs-infra): Ensure experimental tag shows up on docs (#51712)
The experimental tag is part of the stability tags along with "deprecated". This commit updates some code to pick up experimental as well.

PR Close #51712
2023-09-11 09:20:52 -07:00
Paul Gschwendtner
05762b9fff refactor(localize): ignore code duplication error with compiler package (#51500) (#51558)
The localize package intentionally duplicates some logic from the
compiler to avoid adding a dependency. This is now an error in the
packaging rule to prevent common pitfalls/code duplication. Here it's
an explicit decision though so we mark it as such and ask for the check
to be ignored for the particular import.

PR Close #51500

PR Close #51558
2023-09-08 14:49:07 -07:00
Mark Thompson
0d9fd6ddd5 docs: update dependency injection example to standalone (#51587)
PR Close #51587
2023-09-08 10:34:10 -07:00
Gerald Monaco
5277cb408b refactor(core): delegate afterRender errors to an ErrorHandler (#51662)
Improves the error handling story for after*Render by delegating errors to an ErrorHandler, so that one failure does not break every callback.

PR Close #51662
2023-09-08 10:29:33 -07:00
Alan Agius
e866d85e95 docs: typo in what is angular (#51703)
Fix typo in word

PR Close #51703
2023-09-08 09:30:42 -07:00
Angular Robot
00bf05251b docs: update Angular CLI help [main] (#51704)
Updated Angular CLI help contents.

PR Close #51704
2023-09-08 09:28:41 -07:00
Kristiyan Kostadinov
b3edcda9e6 build: attempt to deflake windows tests (#51701)
Adds some logic to try and deflake the tests on Windows.

PR Close #51701
2023-09-08 09:28:02 -07:00
JoostK
eb0137de8a build: migrate project_id option to use bes_instance_name (#51696)
This commit update the RBE configuration to use `bes_instance_name` instead
of `project_id`, which got renamed [in Bazel 5.1][1]. Doing so avoids several warnings
in the CI output.

[1]: 2b48c6b9a4

PR Close #51696
2023-09-07 13:49:07 -07:00
Lars Gyrup Brink Nielsen
26af16c593 docs: merge versions with identical version ranges in pre-v9 compatibility version table (#51645)
PR Close #51645
2023-09-07 12:56:16 -07:00
Lars Gyrup Brink Nielsen
314be83a30 docs: correct pre-v9 TypeScript version ranges in version compatibiliy table (#51645)
For versions 5.x through 8.x, this is based on the `package.json` file of `@angular/compiler-cli`.

For versions 2.x through 4.x, this is based on Angular's changelog.

PR Close #51645
2023-09-07 12:56:16 -07:00
Lars Gyrup Brink Nielsen
1dda2a244e docs: normalize Angular version ranges in pre-v9 version compatibility table (#51645)
PR Close #51645
2023-09-07 12:56:16 -07:00
Lars Gyrup Brink Nielsen
6d86ac8663 docs: format version compatibility tables (#51645)
PR Close #51645
2023-09-07 12:56:16 -07:00
Mark Thompson
429b76eacf docs: convert dependency-injection-in-action (#51602)
* removes unused modules
* converts all components to standalone

PR Close #51602
2023-09-07 12:55:08 -07:00
Charles Lyding
0f10d75228 refactor(compiler): use native BigInt when calculating i18n digests (#48321)
To further modernize and improve the performance of the i18n digest generation,
The 64-bit aspects of the process now use the native `BigInt` instead of a
custom JavaScript implementation. This removes the need for the big_integer
helper code and associated tests as the code was not used anywhere else in the
framework. Only the `BigInt` constructor, `BigInt.asUintN` function, and
`.toString` function are currently used. `BigInt` literals can unfortunately
not yet be used due to the bazel test devmode setup which compiles the TypeScript
code at an EcmaScript level that does not yet support the literals.

Browser support information:
- BigInt constructor: https://caniuse.com/mdn-javascript_builtins_bigint_bigint
- BigInt asUintN: https://caniuse.com/mdn-javascript_builtins_bigint_asuintn
- BigInt toString: https://caniuse.com/mdn-javascript_builtins_bigint_tostring

PR Close #48321
2023-09-07 10:07:47 -07:00
Ben Hong
d14560fa06 docs: migrate dynamic-form guide and code to standalone (#51540)
PR Close #51540
2023-09-07 10:07:03 -07:00
Ben Hong
763314f300 docs: migrate errors code example and guide to standalone (#51536)
PR Close #51536
2023-09-07 10:04:39 -07:00
Matthieu Riegler
3e0e6ed60f docs: update Dynamic Component loader docs to rely on ngComponentOutlet (#49915)
With #51148, the `ngComponentOutlet` directive now supports inputs.
This allows a less verbose and simpler API to instantiate components dynamicaly.

Fixes #49875

PR Close #49915
2023-09-07 10:03:22 -07:00
Ben Hong
3f2d783f65 docs: migrate toh-pt3 to standalone (#51581)
PR Close #51581
2023-09-07 10:02:40 -07:00
Jessica Janiuk
8cd9663a92 release: cut the v17.0.0-next.3 release 2023-09-06 11:25:44 -07:00
Jessica Janiuk
53b082dbda docs: release notes for the v16.2.4 release 2023-09-06 11:00:43 -07:00
Ben Hong
52ff8a56d9 docs: migrate toh-pt2 to standalone (#51580)
PR Close #51580
2023-09-06 17:10:16 +00:00
Alan Agius
cfe2f1d600 ci: force new yarn-lock file to invalidate cache (#51652)
This commit update the lock file to force a new `node_modules` cache as this causes the patch to fail due to GitHub caching and at present, there is also no way to provide a key to invalidate the cache.

PR Close #51652
2023-09-06 16:37:26 +00: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
Andrew Scott
fe0b793fdc refactor(router): Share more code in the route matching utilities (#51543)
For redirects, most of the logic between wildcard and regular redirects
is identical. Combine what can be combined there. Once that was done,
the first part of the matching for redirects looks almost identical to the regular
matching. Create helpers and combine simplify code where possible there
as well.

PR Close #51543
2023-09-06 15:33:06 +00:00
Andrew Scott
c73a3d6711 refactor(router): Accurately update return types in matching functions (#51543)
This commit updates the return types of the matching functions to only
return an array when more than one return value is actually possible.

PR Close #51543
2023-09-06 15:33:06 +00:00
Andrew Scott
89c6a77c17 refactor(router): Remove unused imports/variables (#51543)
This commit removes some unused imports and variables.

PR Close #51543
2023-09-06 15:33:06 +00:00
Kristiyan Kostadinov
88a0af64fd perf(core): generate arrow functions for pure function calls (#51668)
Reworks the pure functions to use arrow functions with an implicit return instead of function expressions. This allows us to shave off some bytes for each pure function, because we can avoid some of the syntax.

PR Close #51668
2023-09-06 15:32:02 +00:00
Matthieu Riegler
8ad21ccfb8 docs: Add info about hydration caching. (#51648)
The docs was missing an important information about caching. Only GET/HEAD requests are cached until `isStable`

PR Close #51648
2023-09-06 15:31:36 +00:00