Commit graph

29561 commits

Author SHA1 Message Date
Paul Gschwendtner
64967da78a ci: include branch name in update CLI help PRs (#48716)
This should make it easier to distinguish between PRs
as currently they same equivalent but actually target
different branches.

PR Close #48716
2023-01-12 11:44:51 -08:00
Bob Watson
0b57e24eb6 docs: add first-app-lesson-13 example (#48512)
PR Close #48512
2023-01-12 11:44:07 -08:00
Bob Watson
1edf5874d7 docs: add first-app-lesson-12 example (#48512)
PR Close #48512
2023-01-12 11:44:07 -08:00
Bob Watson
d2333b4d35 docs: add first-app-lesson-11 example (#48512)
PR Close #48512
2023-01-12 11:44:07 -08:00
Bob Watson
25ec456b9f docs: add first-app-lesson-10 example (#48512)
PR Close #48512
2023-01-12 11:44:07 -08:00
Bob Watson
d894e40dd5 docs: add first-app-lesson-09 example (#48512)
PR Close #48512
2023-01-12 11:44:07 -08:00
Bob Watson
b3283bd271 docs: add first-app-lesson-08 example (#48512)
PR Close #48512
2023-01-12 11:44:06 -08:00
Bob Watson
76daeb6ff7 docs: add first-app-lesson-07 example (#48512)
PR Close #48512
2023-01-12 11:44:06 -08:00
Bob Watson
3344d839bf docs: add first-app-lesson-06 example (#48512)
PR Close #48512
2023-01-12 11:44:06 -08:00
Bob Watson
a19888cf06 docs: add first-app-lesson-05 example (#48512)
PR Close #48512
2023-01-12 11:44:06 -08:00
Bob Watson
af3947d2b1 docs: add first-app-lesson-04 example (#48512)
PR Close #48512
2023-01-12 11:44:06 -08:00
Bob Watson
3519651f72 docs: add first-app-lesson-03 example (#48512)
PR Close #48512
2023-01-12 11:44:06 -08:00
Bob Watson
f7eef20a52 docs: add first-app-lesson-02 example (#48512)
PR Close #48512
2023-01-12 11:44:06 -08:00
Bob Watson
dd8a5d56e3 docs: add first-app-lesson-01 example (#48512)
PR Close #48512
2023-01-12 11:44:05 -08:00
Matthieu Riegler
4dcbb6aef9 refactor(forms): replace type any for the providers (#48647)
The providers for the directives in forms can be typed as Provider. Also the export is not required.

PR Close #48647
2023-01-11 15:01:57 -08:00
Andrew Scott
926c35f4ac docs: Deprecate class and InjectionToken and resolvers (#47924)
Class and `InjectionToken`-based guards and resolvers are not as configurable,
are less re-usable, require more boilerplate, cannot be defined inline with the route,
and require more in-depth knowledge of Angular features (`Injectable`/providers).
In short, they're less powerful and more cumbersome.

In addition, continued support increases the API surface which in turn increases
bundle size, code complexity, the learning curve and API surface to teach,
maintenance cost, and cognitive load (needing to grok several different types
of information in a single place).

Lastly, supporting only the `CanXFn` types for guards and `ResolveFn` type
for resolvers in the `Route` interface will enable better code
completion and integration with TypeScript. For example, when writing an
inline functional resolver today, the function is typed as `any` and
does not provide completions for the `ResolveFn` parameters. By
restricting the type to only `ResolveFn`, in the example below
TypeScript would be able to correctly identify the `route` parameter as
`ActivatedRouteSnapshot` and when authoring the inline route, the
language service would be able to autocomplete the function parameters.

```
const userRoute: Route = {
  path: 'user/:id',
  resolve: {
    "user": (route) => inject(UserService).getUser(route.params['id']);
  }
};
```

Importantly, this deprecation only affects the support for class and
`InjectionToken` guards at the `Route` definition. `Injectable` classes
and `InjectionToken` providers are _not_ being deprecated in the general
sense. Functional guards are robust enough to even support the existing
class-based guards through a transform:

```
function mapToCanMatch(providers: Array<Type<{canMatch: CanMatchFn}>>): CanMatchFn[] {
  return providers.map(provider => (...params) => inject(provider).canMatch(...params));
}
const route = {
  path: 'admin',
  canMatch: mapToCanMatch([AdminGuard]),
};
```

With regards to tests, because of the ability to map `Injectable`
classes to guard functions as outlined above, nothing _needs_ to change
if projects prefer testing guards the way they do today. Functional
guards can also be written in a way that's either testable with
`runInContext` or by passing mock implementations of dependencies.
For example:

```
export function myGuardWithMockableDeps(
  dep1 = inject(MyService),
  dep2 = inject(MyService2),
  dep3 = inject(MyService3),
) { }

const route = {
  path: 'admin',
  canActivate: [() => myGuardWithMockableDeps()]
}

// test file
const guardResultWithMockDeps = myGuardWithMockableDeps(mockService1, mockService2, mockService3);
const guardResultWithRealDeps = TestBed.inject(EnvironmentInjector).runInContext(myGuardWithMockableDeps);
```

DEPRECATED: Class and `InjectionToken` guards and resolvers are
deprecated. Instead, write guards as plain JavaScript functions and
inject dependencies with `inject` from `@angular/core`.

PR Close #47924
2023-01-11 15:01:08 -08:00
Angular Robot
7f68a709a7 docs: update Angular CLI help (#48704)
Updated Angular CLI help contents.

Closes #48701

PR Close #48704
2023-01-11 15:00:21 -08:00
Andrew Scott
8375a8c9a8 docs: Add heading to the router writable properties deprecation (#48684)
The deprecation note is missing a header. This commit adds one.

PR Close #48684
2023-01-11 14:59:04 -08:00
mgechev
f09b6e4507 docs: add angular devsat q1 2023 (#48683)
PR Close #48683
2023-01-11 14:58:35 -08:00
Jens
01be0e2874 docs: Add support for previous Chrome release (#48669)
Previous Chrome stable version should also be supported
PR Close #48669
2023-01-11 14:57:44 -08:00
Matthieu Riegler
518cc63022 docs: remove unused style guides. (#48587)
PR Close #48587
2023-01-11 14:57:09 -08:00
Bob Watson
7281dbc913 docs: minor copy edit to suggestion (#48484)
PR Close #48484
2023-01-11 14:56:31 -08:00
Bob Watson
874f197720 docs: minor copy edit to suggestion (#48484)
PR Close #48484
2023-01-11 14:56:31 -08:00
Bob Watson
84285c1ef8 docs: minor copy edit to suggestion (#48484)
PR Close #48484
2023-01-11 14:56:31 -08:00
Bob Watson
1c4eb67354 docs: minor copy edit to suggestion (#48484)
PR Close #48484
2023-01-11 14:56:30 -08:00
Aristeidis Bampakos
deb27df160 docs: review router guards section in router guide (#48484)
PR Close #48484
2023-01-11 14:56:30 -08:00
dario-piotrowicz
61023b563d refactor(compiler): refactor the shadow css specs (#48443)
apply different quality of life improvements to the shadow
css unit tests:

- refactor the tests so that they are nicely divided in multiple files
   in a logical manner instead of having most of them all in a single big file

- remove the css normalization logic inconsistently used throughout  the tests, which
  causes tests to be inconsistent and it also introduced unintuitive checks

- provide a shared shim utility function (instead of re-defining it
  multiple times)

- add a `toEqualCss` matcher that can be used in the tests in order to
  match css strings without caring about spacing and indentation

PR Close #48443
2023-01-11 14:55:52 -08:00
Angular Robot
fda96a6fc9 build: update dependency puppeteer-core to v19 (#48183)
See associated pull request for more information.

PR Close #48183
2023-01-11 14:55:17 -08:00
ノウラ
1cb93ce4e1 docs: highlight scripts in markdown (#47778)
This PR highlights all lines of code/cmds/error messages by specifying the use language

PR Close #47778
2023-01-11 14:54:45 -08:00
Vladyslav Slipchenko
b0318f8b39 docs(docs-infra): fix wording inconsistency of the i18n common prepare section references (#47582)
PR Close #47582
2023-01-11 14:54:08 -08:00
Alex Rickabaugh
fbcddb092f release: cut the v15.2.0-next.0 release 2023-01-11 08:05:22 -08:00
Alan Agius
7cfe97ca31 ci: set fetch-depth: 0 in update-events and update-cli-help actions (#48698)
This commits changes the fetch depth from 1 to 0 in the update-events` and `update-cli-help` actions. This is required as otherwise the PR creation would fail when the forked (https://github.com/angular-robot/angular) is not in sync with (https://github.com/angular/angular) ie the later has commits which are not in the former.

PR Close #48698
2023-01-11 07:44:00 -08:00
Alan Agius
2b83986a1a ci: correctly interpolate ANGULAR_CLI_BUILDS_READONLY_GITHUB_TOKEN (#48690)
Previously, a single curly bracket was used to interpolate the `ANGULAR_CLI_BUILDS_READONLY_GITHUB_TOKEN` value which caused the value not to be provided correctly.

PR Close #48690
2023-01-11 06:56:18 -08:00
Alan Agius
4bd926edd9 ci: expose ANGULAR_CLI_BUILDS_READONLY_GITHUB_TOKEN secret as env (#48687)
Encrypted secrets need to be provided explicitly in workflow steps to be used.

See: https://docs.github.com/en/actions/security-guides/encrypted-secrets for more info.

PR Close #48687
2023-01-10 14:30:30 -08:00
Paul Gschwendtner
d4a56721a4 ci: use readonly github token for querying CLI snapshot repo (#48681)
Currently the Github action-triggered code uses the `GITHUB_TOKEN`
for querying the CLI snapshot builds repository. This does not work
because the Github actions token is scoped to the orginating
repository, even for queries to a read public repository.

We fix this by using a personal access token. The token is
readonly and only exists to avoid potential rate limiting.

PR Close #48681
2023-01-10 11:13:34 -08:00
Alex Rickabaugh
45029f111a docs: release notes for the v15.1.0 release 2023-01-10 10:53:04 -08:00
Paul Gschwendtner
489243bbb8 fix(language-service): expose package.json for vscode extension resolution (#48678)
The VSCode extension looks for `@angular/language-service/package.json`
using `require`. This currently breaks as of the ESM changes because
we introduced the `exports` field but did not expose the `package.json`.

This commit fixes it.

Co-authored-By: Andrew Scott <atscott@google.com>
Co-authored-By: Dylan Hunn <dylhunn@gmail.com>

PR Close #48678
2023-01-10 09:13:54 -08:00
Kristiyan Kostadinov
7243ae64a6 fix(compiler): resolve deprecation warning (#48652)
Fixes a deprecation warning that was being logged by compiler when generating aliases, because we weren't going through `ts.factory` to create an AST node.

PR Close #48652
2023-01-10 08:13:25 -08:00
Paul Gschwendtner
111e2c7876 test(docs-infra): increase jasmine default timeout for e2e specs (#48671)
Similar to the Saucelabs job, the jasmine default timeout can be
increased to avoid the common jasmine timeouts. We cannot control
how fast Selenium e.g. loads a page or not.

PR Close #48671
2023-01-10 08:10:23 -08:00
Alan Agius
d4eaaefe30 fix(docs-infra): correctly read example type (#48665)
Prior to this change the universal example was broken as the example type was not retrieved correctly in bazel which caused the `_renameFile` method to be called with incorrect context.

Closes #48664

PR Close #48665
2023-01-10 08:09:54 -08:00
Alan Agius
a29203ff1f docs: update universal example (#48665)
This change updates the universal example to align with latest CLI changes.

PR Close #48665
2023-01-10 08:09:54 -08:00
Angular Robot
3714909c98 build: update dependency jsdom to v21 (#48660)
See associated pull request for more information.

PR Close #48660
2023-01-10 08:09:04 -08:00
Virginia Dooley
6a009a3e66 docs: Custom data Pipes doc, fixed live-example link. (#48656)
PR Close #48656
2023-01-10 08:08:07 -08:00
Andrew Kushnir
579cbb20d9 refactor(platform-browser): prepare the code to use MockPlatformLocation by default (#48651)
This commit prepares the code of the `BrowserTestingModule` to include the `MockPlatformLocation` by deafult in the future. With this change, the set of providers to add the `MockPlatformLocation` would be disabled by a flag, which will be switched in v16.

PR Close #48651
2023-01-10 08:06:36 -08:00
piyush132000
0510f4ef32 docs: updated docs removed unnecessary imports and empty methods (#48628)
Removed empty methods and unnecessary imports in files

PR Close #48628
2023-01-10 08:06:04 -08:00
Tim Gates
0920409fbc docs: fix simple typo, esnure -> ensure (#48588)
There is a small typo in integration/check-dependencies.js.

Should read `ensure` rather than `esnure`.

Signed-off-by: Tim Gates <tim.gates@iress.com>

PR Close #48588
2023-01-10 08:05:33 -08:00
Alan Agius
2dc31576ab ci: add Angular CLI help pages action (#48577)
This commits adds an action to update the Angular CLI help contents that are used by AIO to generate CLI guides.

This also changes the setup to include the files are source files instead of having to clone the repository each time. This also simplifies the PR review process of the PR opened by the action.

PR Close #48577
2023-01-10 08:01:38 -08:00
Matthieu Riegler
123c95209f docs(compiler-cli): fix commands to run compliance unit test (#48559)
PR Close #48559
2023-01-10 07:59:52 -08:00
Andrew Scott
a3a4ca0b00 refactor(router): move internal router properties to transition handler where appropriate (#48475)
Working towards removing the backwards dependency on router from the
navigation transition handler, this change moves `rootComponentType` and
`afterPreactivation` to the transition handler since that is the only
location those properties are used.

PR Close #48475
2023-01-10 07:59:16 -08:00
Doug Parker
edd7982d51 refactor(bazel): disables the Tsickle decorator transform (#47934)
This is no longer needed in google3 and actively impedes prodmode tests. See http://b/254054103#comment7 for deeper analysis.

This just turns off the transform for now, if it lands successfully I'll follow up with deleting the flag and dead code altogether.

PR Close #47934
2023-01-10 07:58:39 -08:00