Commit Graph

30088 Commits

Author SHA1 Message Date
Alan Agius 0c80349cf6 refactor(http): replace zone.js macrotask creation with InitialRenderPendingTasks (#50425)
This commits refactors the HTTP client to use `InitialRenderPendingTasks` instead of Zone.js macrotask. This is another approach to https://github.com/angular/angular/pull/50406 which was revert due to a failure in G3.

PR Close #50425
2023-05-30 12:58:22 -07:00
Alan Agius 28c68f709c fix(core): update ApplicationRef.isStable to account for rendering pending tasks (#50425)
This commit updates the `ApplicationRef.isStable` API to account for
pending rendering task. This is needed as once a pending rendering task
is done, new macrotask and microtask could be created which previously caused these not
to be intercepted and thus ignored when doing SSR.

PR Close #50425
2023-05-30 12:58:22 -07:00
Alan Agius 381cb98226 fix(zone.js): enable monkey patching of the queueMicrotask() API in node.js (#50467)
Similar to the browser, now we also monkey patch `queueMicrotask` in Node.js. This API was added in Node.js 11.

PR Close #50467
2023-05-30 12:57:45 -07:00
alkavats1 5576b9a5ea docs: removed the unused import and update the obsolete tag of width in table tag (#50474)
PR Close #50474
2023-05-30 09:23:06 -07:00
Asheer Rizvi 019eaf6831 docs: corrected method name for "Tap into the Observable" section (#50479)
At this point in the tutorial we are still talking about the `getHeroes()` method. Corrected the method name to reflect that since the final piece of code within this section is for `getHeroes()`
PR Close #50479
2023-05-30 09:22:36 -07:00
alkavats1 9acc0e32c4 docs: refactored the markup tags (#50481)
PR Close #50481
2023-05-30 09:21:58 -07:00
alkavats1 7d8ebfc949 docs: updated the deprecated tag of width in table tag (#50487)
PR Close #50487
2023-05-30 09:21:27 -07:00
Alan Agius 62e76d4d20 docs: update CLI command to include --preserve-symlinks-main (#50512)
This is needed to instructs the module loader to preserve symbolic links when resolving and caching the main module.

More information about this flag can be found: https://nodejs.org/api/cli.html#--preserve-symlinks-main

Closes: #50515

PR Close #50512
2023-05-30 09:20:53 -07:00
Alan Agius f414e26521 docs: remove outdated command to run Angular CLI when using ng-dev misc build-and-link (#50512)
Setting `BAZEL_TARGET="1"` is no longer needed as NGCC has been removed.

PR Close #50512
2023-05-30 09:20:53 -07:00
Dylan Hunn 6f5dabe0d2 Revert "fix(http): create macrotask during request handling instead of load start (#50406)" (#50475)
This reverts commit 2cdb4c5911.

PR Close #50475
2023-05-25 16:24:39 -04:00
Matthieu Riegler bada9199f5 fix(animations): Trigger leave animation when ViewContainerRef is injected (#48705)
Injecting `ViewContainerRef` into a component makes it effectively a container. The leave animation wasn't triggered on containers before this fix.

fixes angular#48667

PR Close #48705
2023-05-25 14:40:34 -04:00
Andrew Kushnir 3a05e4cca1 refactor(platform-server): exclude provideHttpClient() call from provideServerRendering() (#50459)
Previously, we've used to have server-specific logic for HttpClient, so there was a need to re-provide it with the right config. Since v16, that logic was refactored and there is no need to re-provide HttpClient anymore. The code in the `provideServerRendering()` was retained for historical reasons and it makes application configuration more difficult, because it forces developers to copy HttpClient config into server config as well (otherwise it would not be take into account).

This commit removes the `provideHttpClient()` call from the `provideServerRendering()` function. This is **not** a breaking change, since we've also merge browser application config in the `app.config.server.ts`, so if an application is configured to use HttpClient, it will continue to work on both client and server sides.

Resolves #50454.

PR Close #50459
2023-05-25 14:41:34 +00:00
Angular Robot 04553b9016 build: update dependency https-proxy-agent to v7 (#50456)
See associated pull request for more information.

PR Close #50456
2023-05-25 14:40:05 +00:00
Kristiyan Kostadinov 721bc72649 fix(compiler): resolve deprecation warning with TypeScript 5.1 (#50460)
We have a code path that accesses the `originalKeywordKind` property which logs a deprecation warning in version 5.1, but isn't available in some of the earlier versions that we support. These changes add a compatibility layer that goes through the non-deprecated function, if it exists.

PR Close #50460
2023-05-25 14:39:27 +00:00
alkavats1 258c773188 docs: remove unused imports and improved the code (#50424)
PR Close #50424
2023-05-25 14:37:54 +00:00
Chellappan 4f5f4969c5 refactor(core): Remove unused import from the graph.ts (#50372)
This commit updates the code to remove unused import of the `throwInvalidWriteToSignalError` symbol.

PR Close #50372
2023-05-25 14:37:05 +00:00
Jessica Janiuk 06b498f67f release: cut the v16.1.0-next.2 release 16.1.0-next.2 2023-05-24 11:03:56 -07:00
Jessica Janiuk cbe27990c2 docs: release notes for the v16.0.3 release 2023-05-24 10:45:41 -07:00
Alan Agius 2cdb4c5911 fix(http): create macrotask during request handling instead of load start (#50406)
This commit schedules the macrotask creation to happen before the XHR `loadStart` event. This is needed as in some cases, Zone.js becomes stable too early.

With this commit, we also update the internal `createBackgroundMacroTask` method to use Zone.js `scheduleMacroTask` as otherwise the `setTimeout` would cause `fakeAsync` tests to fail due to pending timers.

Closes #50405

PR Close #50406
2023-05-24 15:33:43 +00:00
gdarnell 75fdbcb8f2 fix(core): fix Self flag inside embedded views with custom injectors (#50270)
When an embedded view injector is present anywhere above a node in the tree, the `Self` flag was effectively ignored. With this change, embedded view injectors are not checked at all when the `Self` flag is present, because resolution should stop at the current node before reaching any embedded view injector(s).

Fixes #49959

PR Close #50270
2023-05-24 13:59:20 +00:00
Matthieu Riegler 5fd4bf6651 refactor(http): tree-shakable error on JSONP request (#50376)
This commit provides a tree shakable error message (+doc) when JSONP request is made without loading the `HttpClientJsonpModule`.

PR Close #50376
2023-05-24 13:58:49 +00:00
BrianDGLS 24f7c1dc61 refactor(devtools): run spellcheck on devtools dir (#50445)
Correct typos in devtools dir.

PR Close #50445
2023-05-24 13:56:56 +00:00
BrianDGLS 1e10df1c20 refactor(devtools): run spell check on tools dir (#50445)
Fix typo found in tools dir.

PR Close #50445
2023-05-24 13:56:56 +00:00
BrianDGLS 2d411430e3 refactor(router): run spell check on router package (#50445)
Fix typos in router package.

PR Close #50445
2023-05-24 13:56:56 +00:00
BrianDGLS 933e812d14 refactor(localize): run spell check on localize package (#50445)
Fix typo found in BUILD.bazel

PR Close #50445
2023-05-24 13:56:55 +00:00
BrianDGLS 19993a490c refactor(zone.js): run spell check on zone.js package (#50445)
Fix typos found in zone.js CHANGELOG.md

PR Close #50445
2023-05-24 13:56:55 +00:00
Luís Martins 4c01107c0d docs: fix first-app-lesson-06.md (#50419)
fix two grammatical/typographical errors present in the document.
Co-authored-by: Usama Nadeem <usamanadeem1991@gmail.com>

PR Close #50419
2023-05-23 19:45:14 +00:00
Jessica Janiuk 6ced5c8779 Revert "build: update babel dependencies to v7.21.9 (#50416)" (#50433)
This reverts commit 3c093d767e.

PR Close #50433
2023-05-23 18:28:32 +00:00
Paul Gschwendtner 4dc528d402 build: remove unused bash utilities from legacy build (#50427)
Removes an unused bash utility file that existed back when we
built using a Bash script.

PR Close #50427
2023-05-23 17:19:34 +00:00
Paul Gschwendtner f7b8fb3c97 build: remove unused gulp helper script (#50428)
We still seem to be having Gulp installed for the ZoneJS changelog
generation. Arguably this can be replaced with a simpler JS script,
but in either case, this commit removes an unused file from the old
Gulp task setup.

PR Close #50428
2023-05-23 17:18:56 +00:00
Paul Gschwendtner 6ea8e0df2a build: remove unused script from removed components CI job (#50429)
Removes a script that is no longer needed now that we have removed
the components repo CI job from the framework repository.

PR Close #50429
2023-05-23 17:18:27 +00:00
Greg Magolan 0604285866 build: address last bit of review feedback for saucelabs daemon (#50430)
Follow-up to https://github.com/angular/angular/pull/50393.

PR Close #50430
2023-05-23 17:17:58 +00:00
Ivan Bakhtin f4393f7df4 docs: fix console command parameters in first-app-lesson-10.md (#50390)
Lesson 11 proposes to add styles to the `details.component.css` file, which isn't created with the current command. The change brings the component creation to consistency with the other components in the first app tutorial.
PR Close #50390
2023-05-23 17:17:08 +00:00
Matthieu Riegler 9054f95c6a refactor(core): Improve NG100 (#50391)
Improve the NG100 error message by formating the value using `JSON.stringify`

See #34454

PR Close #50391
2023-05-23 15:31:17 +00:00
iklimisdev c464b01acd docs: fix typo in NG0505 error guide (#50321)
PR Close #50321
2023-05-23 14:23:40 +00:00
Saba Shavidze f79a5bc71c docs: fix code-example header path in dependency-injection-in-action-md (#50397)
docs: fix typo in dependency-injection-in-action doc

docs: fixed code-example header paths in dependency-injection-in-action doc

PR Close #50397
2023-05-23 14:15:00 +00:00
Saba Shavidze e516556a8f docs: fix code-example header path in hierarchical-dependency-injection-md file (#50404)
PR Close #50404
2023-05-23 14:14:26 +00:00
Matthieu Riegler fdf6cb8ca7 docs(docs-infra): remove polyfills.ts (#50409)
We can use the angular.json directly.

PR Close #50409
2023-05-23 14:13:40 +00:00
Mladen Jakovljević 3152c4de92 fix(docs-infra): remove extra slash from JSON-LD data (#50140)
Remove double slash from the "@id" field.

PR Close #50140
2023-05-23 14:13:10 +00:00
Greg Magolan 34d73019f3 build: start only the minimum number of Saucelabs browsers required (#50393)
This should save on Saucelabs resources so that if only one saucelabs test is run then only one set of browsers will be started.

PR Close #50393
2023-05-23 14:12:28 +00:00
Angular Robot 3c093d767e build: update babel dependencies to v7.21.9 (#50416)
See associated pull request for more information.

PR Close #50416
2023-05-23 14:11:38 +00:00
Brian Douglas ea560a7098 test(core): correct typo in signal_spec.ts (#50392)
Corrects a typo in the signal_spec.ts file.

PR Close #50392
2023-05-23 14:11:03 +00:00
Matthieu Riegler e8c51a1840 refactor(core): Add a animation standalone example in the bundling test (#50413)
As a preliminary work for #50399, I'd like to add this test to see the effect of treeshaking that will be brought by the incomming refactoring of the AnimationModule.

This is animations test ported to standalone.

PR Close #50413
2023-05-23 14:10:30 +00:00
Jan Kuehle 8933ca3275 refactor(compiler): remove convertIndexImportShorthand (#50343)
Remove convertIndexImportShorthand tsickle option. It's going to be
removed from tsickle in https://github.com/angular/tsickle/pull/1442.
`false` is the default value, so setting it here has no effect
currently.

PR Close #50343
2023-05-23 14:09:59 +00:00
alkavats1 203b55a8cd docs: replaced the html tags with the updated ones (#50403)
PR Close #50403
2023-05-22 17:36:33 +00:00
Matthieu Riegler 6b022428ad docs: improve AOT docs. (#50398)
Since v15, `protected` class member can be used in templates, Inputs & Outputs.

Other Decorated class members, like @HostBindings or Children queries can be private.

Fixes #27467

PR Close #50398
2023-05-22 17:34:46 +00:00
Kristiyan Kostadinov f6da091228 refactor(compiler): introduce compiler infrastructure for input transforms (#50225)
Adds the necessary compiler changes to support input transform functions. The compiler output has changed in the following ways:

### Directive handler
The directive handler now extracts a reference to the input transform function and it resolves the type of its first parameter. It also asserts that the type can be referenced in the compiled output and that it doesn't clash with any pre-existing `ngAcceptInputType_` members.

### .d.ts
In the generated declaration files the compiler now inserts an `ngAcceptInputType_` member for each input with a `transform` function. The member's type corresponds to the type of the first parameter of the function, e.g.

```typescript
// foo.directive.ts
@Directive()
export class Foo {
  @Input({transform: (incomingValue: string) => parseInt(incomingValue)}) value: number;
}

// foo.directive.d.ts
export class Foo {
  value: number;
  static ngAcceptInputType_value: string;
}
```

### Type check block
If an input has `transform` function, the TCB will use the type of its first parameter for the setter type. This uses the same infrastructure as the `ngAcceptInputType_` members.

### Directive declaration
The generated runtime directive declaration call now includes the `transform` function in the `inputs` map, if the input is being transformed. The function will be picked up by the runtime in the next commit to do the actual transformation.

```typescript
// foo.directive.ts
@Directive()
export class Foo {
  @Input({transform: (incomingValue: string) => parseInt(incomingValue)}) value: number;
}

// foo.directive.js
export class Foo {
  ɵdir = ɵɵdefineDirective({
    inputs: {
      value: ['value', 'value', incomingValue => parseInt(incomingValue)]
    }
  });
}
```

PR Close #50225
2023-05-22 14:48:02 +00:00
gdarnell d0a5530f77 refactor: remove unnecessary array copying (#50370)
Removes `Array.from` and spread operators that have no functional effect.

PR Close #50370
2023-05-22 14:47:29 +00:00
gdarnell 5f3e8a9312 docs: clarify example instructions (#50371)
PR Close #50371
2023-05-22 14:45:28 +00:00
Matthieu Riegler 6a51704b4e docs: improve toh6 (#50375)
Create the file, then import it in the AppModule.

fixes #44073

PR Close #50375
2023-05-22 14:44:53 +00:00