Commit graph

29561 commits

Author SHA1 Message Date
Paul Gschwendtner
9fc950daaf fix(language-service): ship /api entry-point (#48670)
The `/api` entry-point was accidentally dropped when we switched the
compilation in the repo to full ESM- thinking the entry-point is not
needed externally.

We re-add it because the VSCode repo extension relies on it for checking
whether `ts.LanguageService` is an Angular one.

PR Close #48670
2023-01-09 10:13:34 -08:00
Greg Magolan
db8b3b7ffa fix(language-service): update packages/language-service/build.sh script to work with vscode-ng-language-service's new Bazel build (#48663)
2nd half of https://github.com/angular/vscode-ng-language-service/pull/1846. `npm_traslate_lock` in vscode-ng-language-service now has a data attribute so sed should only add another item to the list instead of adding a duplicate data attribute.

PR Close #48663
2023-01-09 10:13:06 -08:00
angular-robot[bot]
b6cc5f7eac
build: update SECURITY.md to match the content of angular/.github 2023-01-06 08:51:29 +00:00
Matthieu Riegler
bdf288dcbf fix(forms): Form provider FormsModule.withConfig return a FormsModule (#48526)
Because of a transitive dependency, FormsModule.withConfig wasn't providing FormModule.

fixes: #48519

PR Close #48526
2023-01-05 16:26:21 -08:00
Matthieu Riegler
b9577adeb2 refactor(forms): cleanup type any in forms tests (#48624)
Removing every type any in forms with a reference to #9100

PR Close #48624
2023-01-05 14:52:03 -08:00
Andrew Scott
cb6d73a84e fix(router): page refresh should not destroy history state (#48540)
The router's `initialNavigation` causes an imperative navigation using
the `navigateByUrl` method. This, however, results in the history state
being removed on a page refresh. This change calls `scheduleNavigation`
directly from `initialNavigation` to ensure the history state is correctly
retained.

PR Close #48540
2023-01-05 14:50:53 -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
Andrew Scott
31b94c762f feat(router): Add a withNavigationErrorHandler feature to provideRouter (#48551)
`withNavigationErrorHandler` is a close replacement for the
`RouterModule.forRoot.errorHandler` / `Router.errorHandler`.
It provides a quick, short way for users to define a function to handle
`NavigationError` events.

PR Close #48551
2023-01-05 14:49:00 -08:00
Matthieu Riegler
d887d69f24 refactor(common): remove non-null assertions (#48476)
As part of angular#24571, removing all non-null assertions from common/test/directives

PR Close #48476
2023-01-05 14:46:20 -08:00
Matthieu Riegler
ef57874294 refactor(common): code cleaning (#48476)
* removing guard as console.warn is now widely supported
* Couldn't remove non-null assertion, waiting for TS support of getters with different types (microsoft/typescript#43662)

PR Close #48476
2023-01-05 14:46:20 -08:00
Matthieu Riegler
c29e462704 refactor(common): remove non-null assertions (#48476)
As part of angular#24571, removing all non-null assertions from common/directives

PR Close #48476
2023-01-05 14:46:20 -08:00
Matthieu Riegler
559f518de2 refactor(common): remove non-null assertions (#48476)
As part of angular#24571, removing all non-null assertions from common/directives

PR Close #48476
2023-01-05 14:46:19 -08:00
Andrew Scott
0c5db1a26e refactor(router): Remove files no longer in use (#48500)
These files exist to support internal patches that are no longer needed

PR Close #48500
2023-01-05 14:42:27 -08:00
Alex Rickabaugh
009b0d0b3e docs: release notes for the v15.1.0-rc.0 release 2023-01-05 13:33:19 -08:00
Alex Rickabaugh
9408c18c54 release: bump the next branch to v15.2.0-next.0 2023-01-05 13:33:19 -08:00
Paul Gschwendtner
5d1fbbbf83 ci: fix snapshot publish github credential preparation (#48648)
It looks like the wrapping in `&> /dev/null` breaks for some reason.
We don't need it as CircleCI will remove secrets from logs if they
would leak for some reason.

A simple echo is very unlikely ever printing its content to
stdout/stderr though.

PR Close #48648
2023-01-05 16:44:01 +00:00
Paul Gschwendtner
90ac8e3a15 ci: use snapshot deploy secret directly (#48644)
Instead of encoding the GitHub snapshot robot access token
in a file that needs to be decoded by an ambiguously named
secret called `KEY`, the token can be directly stored in the
secrets of CircleCI given easier maintenance and the same risk.

The leakage of the secret still means the GitHub token file could
be decoded.

We are switching to a similar model as in the components repo, which
also simplifies key rotations etc.

PR Close #48644
2023-01-05 15:15:59 +00:00
Kristiyan Kostadinov
33f35b04ef fix(compiler): type-only symbols incorrectly retained when downlevelling custom decorators (#48638)
In #47167 an `updateClassDeclaration` call was swapped out with a `createClassDeclaration` which caused a regression where interface references were being retained when using a custom decorator in a project that has `emitDecoratorMetadata` enabled.

These changes switch back to use `updateClassDeclaration`.

Fixes #48448.

PR Close #48638
2023-01-04 12:29:16 -08:00
ced
2d3c98ddf3 docs: missing closing parenthesis in withHashLocation() example (#48507)
PR Close #48507
2023-01-04 12:26:21 -08:00
Matthieu Riegler
fc1c03e16e refactor(compiler): Remove unnecessary assignment (#48478)
This is well known problem and has a opened issue at microsoft/typescript.  @ts-expect-error will highlight an error when this is fixed.

PR Close #48478
2023-01-04 12:23:50 -08:00
Renan Ferro
29efedf0e4 docs(docs-infra): update precedence of binding dynamic example and commentary (#48636)
PR Close #48636
2023-01-04 12:16:40 -08:00
Matthieu Riegler
c8310a842d refactor(core): cleanup type any (#48623)
Removing every type any in core with a reference to #9100

PR Close #48623
2023-01-04 12:15:16 -08:00
Pawel Kozlowski
dacfe4372e refactor(core): move attachDebugGetter to i18n specifc code (#48549)
The attachDebugGetter function is only used in the i18n specific code
so could be moved closer to the sole usage site instead of being
exported to the entire framework code. It also lets us remove the
entire packages/core/src/render3/util/debug_utils.ts file.

PR Close #48549
2023-01-04 12:14:30 -08:00
Pawel Kozlowski
1085e5c2ce refactor(core): remove unused attachDebugObject function (#48549)
This commit removes the unused attachDebugObject function.

PR Close #48549
2023-01-04 12:14:30 -08:00
piyush132000
2fb6df281b docs: updated docs removed unnecessary imports and empty methods (#48546)
Removed empty methods and unnecessary imports in files

PR Close #48546
2023-01-04 12:13:24 -08:00
Angular Robot
c51e3e33ce build: update eslint dependencies to v5.47.0 (#48548)
See associated pull request for more information.

PR Close #48548
2023-01-04 12:09:15 -08:00
Kristiyan Kostadinov
a532d71975 feat(compiler): allow self-closing tags on custom elements (#48535)
Allows for self-closing tags to be used for non-native tag names, e.g. `<foo [input]="bar"></foo>` can now be written as `<foo [input]="bar"/>`. Native tag names still have to have closing tags.

Fixes #39525.

PR Close #48535
2023-01-04 12:07:37 -08:00
Matthieu Riegler
b3fca32a79 refactor(common): remove unnecessary parseFloat from ng_optimized_image directive. (#48527)
There is no need to parse clientWidth/clientHeight/naturalWidth/naturalHeight on HTMLImageElement as there is no sign of other types being returned on everygreen browers.

PR Close #48527
2023-01-04 12:07:03 -08:00
Matthieu Riegler
687ab0447b docs: fix typo on SkipSelf (#48511)
fixes #48506

PR Close #48511
2023-01-04 11:53:31 -08:00
Alan Agius
a1a8e91eca fix(localize): add triple slash type reference on @angular/localize on `ng add (#48502)
This commits add a triple slash type reference to the `main.ts` of the project when running `ng add @angular/localize`. This is purely needed for IDE purposes so that `$localize` is available globally. For the compilations `@angular/localize` types are adding the the respective TS configs files.

This commits also add better support for using `@angular/localize` in `/// <reference types="@angular/localize" />`. To support this we need to move the global definition outside of a barrel file and into the index.ts file. Without this change the `$localize` method will not available globally when using triple slash type references.

Closes #48434

PR Close #48502
2023-01-04 11:50:45 -08:00
Alex Castle
2f4f0638c7 fix(common): Add data attribtue to NgOptimizedImage (#48497)
Add a tracking attribute in oder to be able to distinguish usages of NgOptimizedImage from standard images

PR Close #48497
2023-01-04 11:46:27 -08:00
Angular Robot
aa51e9b217 build: update all non-major dependencies (#48462)
See associated pull request for more information.

PR Close #48462
2023-01-04 11:38:40 -08:00
robertIsaac
c5a84851ea docs: add NG0403.md for Bootstrapped NgModule doesn't specify which component to initialize error (#48483)
- update `errors.ts` to annotate the error NG0403, so that the runtime can add a link to that guide when an error is thrown
- update `application_ref_spec.ts` to include the new link of the error
- update `errors.md` as a result of running `yarn bazel test packages/core/test`

Fixes #47985

PR Close #48483
2023-01-04 09:59:24 -08:00
Paul Gschwendtner
3944aa75e9 build: remove unused dependencies (#48641)
Removes unused dependencies introduced back when the devtools
were moved into the framework repo.

Most of these deps were added when the Bazel http-server from
the components repo was copied here

PR Close #48641
2023-01-04 09:55:52 -08:00
Paul Gschwendtner
caedef0f5b fix(compiler-cli): update @babel/core dependency and lock version (#48634)
Similar to how the `@babel/core` dependency is managed for the localize
NPM package, the version should be locked. Also the version should
correspond to the version we install for building & testing.

Currently the Babel version allowed by the compiler-cli may not
work given the ESM -> CJS interop. causing errors like:

```
import { types as t } from "@babel/core";
         ^^^^^
SyntaxError: Named export 'types' not found. The requested module '@babel/core' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:

import pkg from '@babel/core';
const { types: t } = pkg;
```

We can only be confident about the interop if we know the version
installed- is the one we test.

PR Close #48634
2023-01-03 16:36:50 +00:00
Paul Gschwendtner
e38bc6b806 build: switch from ng-comp-dev to canonical dev-infra preview Firebase project (#48630)
We are going with a single canonical dev-infra Firebase/GCP project
for previews. This commit switches to it.

PR Close #48630
2023-01-03 13:22:38 +00:00
Kristiyan Kostadinov
50f95f831e refactor(compiler): remove TypeScript 4.7 compatibility code (#48470)
We dropped support for TypeScript 4.7 in version 15, but we had to keep around the runtime code, because of g3. Now that g3 is on 4.8, we can remove the additional code.

PR Close #48470
2023-01-02 13:47:22 +00:00
mgechev
2d539e14eb docs: hide state of js survey (#48578)
PR Close #48578
2023-01-02 12:19:50 +00:00
Vadim
285b04ec24 docs: fix typo in preconnect_link_checker.ts (#48595)
PR Close #48595
2023-01-02 12:17:52 +00:00
Alan Agius
297d865e9e build: remove duplicate license banners from FESM bundles (#48560)
Prior to this change the FESM bundles have the license banner duplicated multiple of times in each published file.

With this change we remove all the banners from the individual input files. A new banner will be appended at the top of the FESM using rollup's banner option.

While there is a rollup plugin on NPM to strip these banners (https://github.com/mjeanroy/rollup-plugin-strip-banner) we could not use this as it does not support `.mjs`.

PR Close #48560
2023-01-02 12:16:55 +00:00
Alan Agius
82d0998968 fix(bazel): remove duplicate license banners from FESM bundles (#48560)
Prior to this change the FESM bundles for the FW packages have the license banner duplicated hundreds of times in each published file.

With this change we remove all the banners from the individual input files. A new banner will be appended at the top of the FESM using rollup's banner option.

While there is a rollup plugin on NPM to strip these banners (https://github.com/mjeanroy/rollup-plugin-strip-banner) we could not use this as it does not support `.mjs`.

PR Close #48560
2023-01-02 12:16:55 +00:00
Derek Cormier
0ae80a78a3 build(bazel): improve remote caching for AIO local deps build (#48579)
Fix non-hermetic zipping of example zips by fixing the zip entry timestamps.

I also hardcoded stamp values in stable-status.txt and volatile-status.txt using the workspace status command for the aio_local_deps config to improve cache performance. The Bazel remote cache appears to not ignore volatile-status.txt when there are no other changes, unlike the local Bazel cache:

https://github.com/bazelbuild/bazel/issues/10075#issuecomment-546872111

PR Close #48579
2023-01-02 12:16:12 +00:00
Kristiyan Kostadinov
cc284afbbc fix(migrations): combine newly-added imports in import manager (#48620)
Fixes that imports weren't being combined in the `ImportManager` when multiple new imports are added for the same file. This wasn't a problem for previous schematics that used the manager, but it'll come up in some of the new ones.

Also moves the logic for writing new imports into `recordChanges`, instead of `addImportToSourceFile`.

PR Close #48620
2023-01-02 12:15:15 +00:00
Alan Agius
27da7338ea ci: remove redundant aio dependencies installation step (#48574)
Remove redundant aio dependencies installation step from update-events action as this action only uses built-in node.js APIs

PR Close #48574
2022-12-24 11:26:34 +00:00
Derek Cormier
8c9f067125 build(bazel): prevent remote cache misses on dgeni build (#48585)
Using 'always' as the stamp attribute caused stable-status.txt
to always be included as an input, which has different values on
different ci executors causing a cache miss.

We run the regular aio build without stamping on ci so only include
status files when stamping is explicitly enabled.

PR Close #48585
2022-12-24 11:25:40 +00:00
Paul Gschwendtner
74ba3021da build: do not rely on CommonJS module global for Bazel karma saucelabs (#48573)
The Karma Saucelabs script for Bazel & Saucelabs relies on some CommonJS
specific features. This commit replaces it with an ESM-compatible
alternative so that it can execute because `nodejs_binary` requires ESM
files now.

PR Close #48573
2022-12-23 14:16:33 +00:00
piyush132000
8561868d4f docs: updated docs removed unnecessary imports and empty methods (#48513)
Removed empty methods and unnecessary imports in files

PR Close #48513
2022-12-21 13:08:18 +00:00
Paul Gschwendtner
f8b3744103 build: only generate bazel saucelabs targets for //packages/ (#48554)
With the recent ESM changes we also started generating Saucelabs
targets for `//devtools` (as part of an effort to avoid code
duplication). We should skip Saucelabs targets for this package
because we don't intend to run them on Saucelabs and this whole
setup needs some more work (and we shouldn't change unexpectedly).

PR Close #48554
2022-12-21 12:58:27 +00:00