Commit graph

6118 commits

Author SHA1 Message Date
Matthieu Riegler
82c8b7ae9e build(docs-infra): replace base64 images for stackblitz by svgs (#48774)
PNG converted to base64 don't work on stackblitz.
As stackblitz does't support binary files for dynamicaly created projects, we now use only svgs.

Fixes: #48773

PR Close #48774
2023-01-24 16:39:28 +00:00
Angular Robot
0ad013670e build: update eslint dependencies to v5.49.0 (#48818)
See associated pull request for more information.

PR Close #48818
2023-01-24 16:37:36 +00:00
Alan Agius
840530ffd8 docs: update supported Chrome version description (#48782)
- Update Chrome supported version description to match other browsers.
- Updates browserslist configuration in build section to match supported browsers

PR Close #48782
2023-01-20 17:07:53 +00:00
Virginia Dooley
2d0ca73d73 docs: Document extracted from the original Introduction document, which is to be retired. Linting suggested corrections made. Restructuring or rewording sentences to be shorter and clearer. (#47907)
PR Close #47907
2023-01-20 01:21:07 +00:00
Virginia Dooley
bca76ed43a docs: Document extracted from the original Introduction document, which is to be retired. Linting suggested corrections made. Restructuring or rewording sentences to be shorter and clearer. (#47906)
docs: Document extracted from the original Introduction document, which is to be retired. Linting suggested corrections made.  Restructuring or rewording sentences to be shorter and clearer.

docs: revised understanding doc and pullapprove.yml

PR Close #47906
2023-01-19 21:32:34 +00:00
Alan Agius
42ca9c0b02 docs: update documentation to use ng generate config and ng generate environments (#48757)
In Angular CLI 15.1  new sub commands to generate configuration and environments files were added. This commit updates several docs to mention these commands.

Closes #48364

PR Close #48757
2023-01-18 10:44:14 -08:00
Angular Robot
fe6a2bd9e2 build: update dependency rimraf to v4 (#48726)
See associated pull request for more information.

PR Close #48726
2023-01-18 10:43:21 -08:00
Angular Robot
1849ae2675 build: update cross-repo angular dependencies (#48747)
See associated pull request for more information.

PR Close #48747
2023-01-17 10:46:44 -08:00
Andrew Scott
fb7b8a95f2 docs: Fix example in breaking changes to apply to correct sentence (#48758)
The "for example..." was supposed to apply to the production code, not the test code sentence.

fixes #48744

PR Close #48758
2023-01-17 09:21:50 -08:00
Angular Robot
b99bd9ebf6 build: update eslint dependencies to v5.48.2 (#48756)
See associated pull request for more information.

PR Close #48756
2023-01-17 09:17:03 -08:00
Angular Robot
7840352dee build: update all non-major dependencies (#48755)
See associated pull request for more information.

PR Close #48755
2023-01-17 09:16:19 -08:00
Angular Robot
5b1c7c10a0 build: update dependency @rollup/plugin-commonjs to v24 (#48530)
See associated pull request for more information.

PR Close #48530
2023-01-13 10:35:19 -08:00
Paul Gschwendtner
1898190c28 build: update ng-dev and account for stamping changes (#48731)
* updates ng-dev and build-tooling since the previous SHAs are
no longer existent after the CircleCI incident snapshot build removal.
* accounts for the new stamping variables.

PR Close #48731
2023-01-13 14:10:39 +00: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
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
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
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
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
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
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
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
43ced455d6 docs: remove empty constructors & ngOnInit() (#48576)
PR Close #48576
2023-01-05 14:49:38 -08:00
Matthieu Riegler
51ff78143d docs: remove onInit from Tour Of Heroes. (#48576)
Following #24008, the schematics don't produce ngOnInit and the constructor. Let's reflect that in the Tour of Heroes tutorial.

Fixes #48575

PR Close #48576
2023-01-05 14:49:37 -08:00
Andrew Scott
15eccef4eb docs(router): Clean up error handler deprecations (#48551)
`errorHandler` and `malformedUriErrorHandler` were already deprecated in
the Router class public API. This change updates the deprecation to
extend to `RouterModule.forRoot` configuration options.

PR Close #48551
2023-01-05 14:49:00 -08:00