Commit graph

25476 commits

Author SHA1 Message Date
Andrew Kushnir
bdd4d14db9 refactor(common): drop deprecated selector from the NgOptimizedImage directive (#47798)
This commit updates the NgOptimizedImage directive to:
- drop a deprecated selector (the `rawSrc` one)
- drop corresponding input getter

The `rawSrc` was replaced by the `ngSrc` one during the developer preview phase.

PR Close #47798
2022-10-19 15:23:03 +02:00
Kara Erickson
ce5880f93f fix(common): warn if using supported CDN but not built-in loader (#47330)
This commit adds a missing warning if the image directive
detects that you're hosting your image on one of our
supported image CDNs but you're not using the built-in loader
for it. This excludes applications that are using a custom
loader.

PR Close #47330
2022-10-19 15:21:51 +02:00
Andrew Kushnir
0d65e1de2c docs: declare Standalone APIs as stable (#47754)
In v14, we've introduced core concepts to allow Components, Directives and Pipes to configure their dependencies
 without the need to use NgModules and without the need to be declared in an NgModule. The concepts and initial
set of APIs were marked as "developer preview" to allow developers to use these APIs and share the feedback.

Since v14, we've been reviewing the entire API surface of the framework and either updating existing APIs to support standalone or creating new APIs that allowed to use Router, HttpClient and other abstractions without NgMod
ules.

Based on the mentioned work to review and stabilize APIs and also based on the positive feedback from the commun
ity, we are happy to announce that the Standalone APIs are promoted to stable!

This commit updates vast majority of standalone-related APIs to drop the `@developerPreview` label, which effect
ively documents then as stable.

Two APIs that retained the `@developerPreview` annotations are:
- withRequestsMadeViaParent (from `@angular/common/http`)
- renderApplication (from `@angular/platform-server`)

We plan to collect some additional feedback for the mentioned APIs and drop the `@developerPreview` annotation b
efore the next major release.

Co-Authored-By: Alex Rickabaugh <alx@alxandria.net>
Co-Authored-By: Andrew Scott <atscott@google.com>
Co-Authored-By: Dylan Hunn <dylhunn@gmail.com>
Co-Authored-By: Jessica Janiuk <jessicajaniuk@google.com>
Co-Authored-By: JoostK <joost.koehoorn@gmail.com>
Co-Authored-By: Kristiyan Kostadinov <crisbeto@abv.bg>
Co-Authored-By: Pawel Kozlowski <pkozlowski.opensource@gmail.com>

PR Close #47754
2022-10-17 12:15:20 +02:00
WD Snoeijer
6140bae5ce docs: fix linter errors for zone.md (#47707)
PR Close #47707
2022-10-17 12:14:44 +02:00
WD Snoeijer
623e97584c docs: fix linter errors for web-worker.md (#47766)
PR Close #47766
2022-10-17 12:13:40 +02:00
Kristiyan Kostadinov
f97bebf17a fix(compiler-cli): implement more host directive validations as diagnostics (#47768)
Implements more of the runtime validations for host directives as compiler diagnostics so that they can be caught earlier. Also does some minor cleanup.

PR Close #47768
2022-10-17 12:12:22 +02:00
WD Snoeijer
cd25cb2f83 docs: fix linter errors for view-encapsulation.md (#47772)
PR Close #47772
2022-10-17 12:11:52 +02:00
Paul Gschwendtner
4bddd90363 test: update size golden for main bundle reduction (#47717)
The `main` bundle size has been reduced with the Angular CLI update.
This is not worth investigating as it's a positive side reduction likely
due to further optimizations in the Angular CLI devkit.

Also updates the other golden payload entries to capture all other CLI
related payload changes- making future payload update easier to
investigate.

PR Close #47717
2022-10-17 12:11:26 +02:00
Paul Gschwendtner
0fb124ad83 build: run ng update for Angular CLI next (#47717)
Runs the Angular CLI v15 migrations for AIO.

PR Close #47717
2022-10-17 12:11:26 +02:00
Paul Gschwendtner
cddae0741b build: update cross angular deps and lock dependencies (#47717)
Renovate no longer updated the dependencies because they were expanded
to a range. Ranges did not satisfy the `@next` tag anymore- so Renovate
did was not able to update.

This fixes the dependencies by locking them- and also updates the
versions according to our Renovate config.

PR Close #47717
2022-10-17 12:11:25 +02:00
Alan Agius
c9541f4c49 fix(localize): update ng add schematic to support Angular CLI version 15 (#47763)
Prior to this, the `@angular/localize/init` was added as a polyfill which caused the `@angular/localize` types not to be included in the TypeScript program which caused errors such as the below:

```
Error: src/app/app.component.ts:9:11 - error TS2304: Cannot find name '$localize'.
```

With the recent changes in the CLI (https://github.com/angular/angular-cli/pull/24032), adding `@angular/localize/init` as polyfil or in the `main.server.ts` is no longer necessary. Instead we add this as a TypeScript type. When users are running in JIT mode, we add `@angular/localize/init` as an additional entrypoint.

This change also exposes the `$localize` method as a global when importing `@angular/localize`.

Closes #47677

PR Close #47763
2022-10-17 09:58:21 +02:00
Charles Barnes
e0bda23ed1 docs(docs-infra): fix errors page hover styles (#47770)
fix hover styles for error messages to be consistent for dark theme

Fixes #47723

PR Close #47770
2022-10-17 09:57:46 +02:00
Paul Gschwendtner
aff9f4a314 build: update ng-dev to fix caretaker check and update label config (#47779)
* Updates ng-dev to support the new g3sync canonical JSON configs
* Updates the google-internal-tests option to support the g3 sync
  canonical JSON config
* Moves the YAML sync config to a dedicated JSON file, used by the
  action and by `yarn ng-dev`.
* Updates the ng-dev caretaker config to fix that the Merge assistance
  queue is always empty.

PR Close #47779
2022-10-17 09:57:17 +02:00
Charles Lyding
d684148f93 refactor(compiler-cli): use mkdirSync recursive option instead of custom implementation (#47678)
The supported Node.js versions for the `@angular/compiler-cli` package (^14.15.0 || >=16.10.0)
allow for the use of the `recursive` option of `mkdirSync`.  Using the `recursive` option
removes the need to manually create each subdirectory in a given path.

PR Close #47678
2022-10-13 13:51:03 -07:00
abergquist
59f3324d6f docs: Separated HTML elements with blank lines (#47331)
Separated HTML elements with judicious use of space. It not only makes it easier to read the HTML; it also makes it consistent with the formatting of https://github.com/angular/angular/edit/main/aio/content/examples/what-is-angular/src/app/hello-world-bindings/hello-world-ngif.component.html.

PR Close #47331
2022-10-13 19:10:27 +00:00
Andrew Kushnir
ddbc4931e6 refactor(common): make provideHttpClient return EnvironmentProviders (#47758)
This commit updates the `provideHttpClient` function to return the `EnvironmentProviders` instead of a regular `Provider[]`, to make sure that the `provideHttpClient` can only be used where an environment is being setup.

PR Close #47758
2022-10-13 16:44:59 +00:00
Bob Watson
6c98ca4572 docs: update of documentation contrib. guide (#47381)
This update describes the content authoring and revision process in sufficient detail for technical and non-technical contributors to the angular.io documentation.

PR Close #47381
2022-10-13 16:37:25 +00:00
Paul Gschwendtner
ec97331c8e build: wire up new github action for identifying g3-affecting PRs (#47735)
Wire up new github action for identifying g3-affecting PRs.

PR Close #47735
2022-10-13 09:43:43 +00:00
Joey Perrott
195a8d886e build: update commit message based labels action
Update to the latest version of the action
2022-10-12 13:44:16 -06:00
Jessica Janiuk
755fe0ee3f docs: release notes for the v15.0.0-next.6 release 2022-10-12 11:40:18 -07:00
Jessica Janiuk
93a405a041 release: bump the next branch to v15.1.0-next.0 2022-10-12 11:40:18 -07:00
Joey Perrott
7ab0a269ec build: update comp labels to be area instead (#47750)
Updates all of the comp: * labels to area: * instead

PR Close #47750
2022-10-12 18:10:35 +00:00
Jessica Janiuk
59dfb5469f docs: release notes for the v14.2.6 release 2022-10-12 10:53:59 -07:00
Joey Perrott
510a295ed1 build: update to the latest version of the feature triage action
Update to the latest version of the feature triage action
2022-10-12 11:34:28 -06:00
Joey Perrott
c36f5007a3 build: update labels to match standardized labels (#47747)
Update labels as part of standardization

PR Close #47747
2022-10-12 17:02:39 +00:00
Alan Agius
38078e7adb fix(compiler-cli): add missing period to error message (#47744)
With this change we add a missing period to the error message.

PR Close #47744
2022-10-12 15:57:25 +00:00
Alex Castle
9483343ebf feat(common): Add fill mode to NgOptimizedImage (#47738)
Add a new boolean attribute to NgOptimizedImage called `fill` which does the following:
* Removes the requirement for height and width
* Adds inline styling to cause the image to fill its containing element
* Adds a default `sizes` value of `100vw` which will cause the image to have a responsive srcset automatically generated

PR Close #47738
2022-10-12 15:56:56 +00:00
Joshua Morony
3a9c452bad docs: add Joshua Morony to GDE resources (#47704)
PR Close #47704
2022-10-11 23:42:46 +00:00
Angular Robot
4de35735d3 build: update io_bazel_rules_sass digest to f6ceac7 (#47376)
See associated pull request for more information.

PR Close #47376
2022-10-11 23:16:21 +00:00
Angular Robot
8921c12619 build: update all non-major dependencies (#47551)
See associated pull request for more information.

PR Close #47551
2022-10-11 23:14:51 +00:00
Angular Robot
e3fbeab3bd build: update dependency @rollup/plugin-commonjs to v23 (#47711)
See associated pull request for more information.

PR Close #47711
2022-10-11 23:09:06 +00:00
WD Snoeijer
547b45a9da docs: fix linter errors for what-is-angular.md (#47708)
PR Close #47708
2022-10-11 23:07:09 +00:00
AleksanderBodurri
a910c8328a build(devtools): migrate to manifest v3 (#47575)
Previously we built DevTools for all browsers with version 2 of the manifest file format.

This commit includes a number of refactors and API additions that will enable us to build DevTools with version 3 of the manifest file format.

The manifest v3 build of Angular DevTools has been tested on Chrome, Edge, and Safari.

Notably, the Firefox version of Angular DevTools remains as a manifest v2 build. Firefox does not yet support manifest v3 in it's latest stable release. When Firefox makes this transition, a follow up PR will update the Firefox manifest file to version 3.

Because Firefox still needs v2, we need to keep some old v2 APIs around in our background page (service worker in v3) that will execute conditionally based on if the extension was built for v2 or v3. This is determined with the chrome.runtime.getManifest().manifest_version API.

PR Close #47575
2022-10-11 22:47:22 +00:00
WD Snoeijer
bbbd4c3ac8 docs: fix linter errors for security.md (#47688)
PR Close #47688
2022-10-11 22:05:43 +00:00
WD Snoeijer
23c06ee83a docs: fix linter errors for workspace-config.md (#47709)
PR Close #47709
2022-10-11 21:59:00 +00:00
WD Snoeijer
5fbe40c2f4 docs: fix linter errors for property-binding-best-practices.md (#47686)
PR Close #47686
2022-10-11 21:19:18 +00:00
WD Snoeijer
83f3d04f24 docs: fix linter errors for property-binding.md (#47687)
PR Close #47687
2022-10-11 21:18:45 +00:00
Kristiyan Kostadinov
39b72e208b fix(compiler): update element schema (#47552)
Updates the DOM element schema to add the `hgroup` element and to include some properties that weren't supported the last time the schema was updated.

Fixes #47545.

PR Close #47552
2022-10-11 17:21:47 +00:00
Alan Agius
1b9fd46d14 feat(core): add support for Node.js version 18 (#47730)
This change aligns with the supported Node.js versions of the Angular CLI.
See: https://github.com/angular/angular-cli/pull/24026

BREAKING CHANGE: Angular no longer supports Node.js versions `14.[15-19].x` and `16.[10-12].x`. Current supported versions of Node.js are `14.20.x`, `16.13.x` and `18.10.x`.

PR Close #47730
2022-10-11 17:21:19 +00:00
arturovt
b618b5aa86 fix(zone.js): cancel tasks only when they are scheduled or running (#46435)
Currently, there's no check if the task (that is being canceled) has the right state.
Only `scheduled` and `running` tasks can be canceled. If the task has a non-appropriate
state, then an error will be thrown. Cancelation should not throw an error on an already
canceled task, e.g. `clearTimeout` does not throw errors when it's called multiple times
on the same timer.

PR Close #45711

PR Close #46435
2022-10-11 17:20:54 +00:00
Dylan Hunn
96b7fe93af fix(forms): call setDisabledState on ControlValueAcessor when control is enabled (#47576)
Previously, `setDisabledState` was never called when attached if the control is enabled. This PR fixes the bug, and creates a configuration option to opt-out of the fix.

Fixes #35309.

BREAKING CHANGE: setDisabledState will always be called when a `ControlValueAccessor` is attached. You can opt-out with `FormsModule.withConfig` or `ReactiveFormsModule.withConfig`.

PR Close #47576
2022-10-11 16:03:01 +00:00
WD Snoeijer
1818c54b62 docs: fix linter errors in prerendering.md (#47724)
PR Close #47724
2022-10-11 15:59:24 +00:00
Sri Ram
a41ff9413d docs(core): Improved README.md (#47700)
PR Close #47700
2022-10-11 15:58:38 +00:00
Jessica Janiuk
1b602faee9 Revert "fix(compiler): update element schema" (#47726)
This reverts commit 3c45f6f33e7a20c460d95203a562e0c056d3dbf7.

PR Close #47726
2022-10-11 00:56:04 +00:00
Aristeidis Bampakos
ca2fa7ae85 docs: add 0 to filename of runtime error guides (#47722)
PR Close #47722
2022-10-10 22:30:43 +00:00
Joey Perrott
40aad8339c ci: adjust workflow permissions for OpenSSF Scorecard results publishing (#47721)
Version 2 of the `openssf/scorecard-action` GitHub action requires the
`id-token: write` permission to publish results.

PR Close #47721
2022-10-10 22:29:01 +00:00
JoostK
bc54687c7b fix(compiler-cli): exclude abstract classes from strictInjectionParameters requirement (#44615)
In AOT compilations, the `strictInjectionParameters` compiler option can
be enabled to report errors when an `@Injectable` annotated class has a
constructor with parameters that do not provide an injection token, e.g.
only a primitive type or interface.

Since Ivy it's become required that any class with Angular behavior
(e.g. the `ngOnDestroy` lifecycle hook) is decorated using an Angular
decorator, which meant that `@Injectable()` may need to have been added
to abstract base classes. Doing so would then report an error if
`strictInjectionParameters` is enabled, if the abstract class has an
incompatible constructor for DI purposes. This may be fine though, as
a subclass may call the constructor explicitly without relying on
Angular's DI mechanism.

Therefore, this commit excludes abstract classes from the
`strictInjectionParameters` check. This avoids an error from being
reported at compile time. If the constructor ends up being used by
Angular's DI system at runtime, then the factory function of the
abstract class will throw an error by means of the `ɵɵinvalidFactory`
instruction.

In addition to the runtime error, this commit also analyzes the inheritance
chain of an injectable without a constructor to verify that their inherited
constructor is valid.

BREAKING CHANGE: Invalid constructors for DI may now report compilation errors

When a class inherits its constructor from a base class, the compiler may now
report an error when that constructor cannot be used for DI purposes. This may
either be because the base class is missing an Angular decorator such as
`@Injectable()` or `@Directive()`, or because the constructor contains parameters
which do not have an associated token (such as primitive types like `string`).
These situations used to behave unexpectedly at runtime, where the class may be
constructed without any of its constructor parameters, so this is now reported
as an error during compilation.

Any new errors that may be reported because of this change can be resolved either
by decorating the base class from which the constructor is inherited, or by adding
an explicit constructor to the class for which the error is reported.

Closes #37914

PR Close #44615
2022-10-10 21:46:25 +00:00
Kristiyan Kostadinov
48b354a83e fix(compiler): update element schema (#47552)
Updates the DOM element schema to add the `hgroup` element and to include some properties that weren't supported the last time the schema was updated.

Fixes #47545.

PR Close #47552
2022-10-10 21:33:45 +00:00
Dylan Hunn
bebef5fb43 feat(language-service): Quick fix to import a component when its selector is used (#47088)
The language service can now generate an import corresponding to a selector. This includes both the TypeScript module import and the decorator import. This applies to both standalone components and components declared in NgModules.

PR Close #47088
2022-10-10 21:32:43 +00:00
jaybell
75e6297f09 feat(common): add <link> preload tag on server for priority img (#47343)
This commit adds a logic that generates preload tags for priority images, when rendering happens on the server (e.g. Angular Universal).

PR Close #47343
2022-10-10 20:48:10 +00:00