22818 Commits

Author SHA1 Message Date
Andrew Scott 7ec482d9c2 fix(core): Add back support for namespace URIs in createElement of dom renderer (#44914)
Support for namespace URIs rather than short namespace names was added in
https://github.com/angular/angular/commit/2b9cc8503d48173492c29f5a271b61126104fbdb to
support how Ivy passed around the namespace URI rather than short name at the time.
As a side-effect, this meant that namespace URIs were supported by the
default dom renderer as part of the public API (likely unintentionally).

It did not, however extend the support to other parts of the system (setAttribute, setAttribute,
and the ServerRenderer). In the future we should decide what exactly the
semantics for dealing with namespaces should be and make it consistent.

fixes #44028

PR Close #44914
2022-01-31 21:39:29 +00:00
Andrew Kushnir 98ba48eedf refactor(core): strict templates type-checking compatibility for perf tests (#44905)
This commit updates a type used in the transplanted views perf tests, to make the test compatible with strict template type-checking.

Currently, compiling the perf test results in the following TS error:
```
error TS2322: Type 'TemplateRef<{}>' is not assignable to type 'TemplateRef<NgForOfContext<any, any[]>>'.

17     <ng-container *ngFor="let n of views; template: template; trackBy: trackByIndex"></ng-container>
                                             ~~~~~~~~
```

PR Close #44905
2022-01-31 21:39:04 +00:00
arturovt 1aebbf8714 fix(forms): ensure OnPush ancestors are marked dirty when the promise resolves (#44886)
Currently, `ngModel` calls` setValue` after the `resolvedPromise` is resolved.
The promise is resolved _after_ the child template executes. The change detection
is run but `OnPush` views are not updated because they are not marked as dirty.

PR Close #44886
2022-01-31 21:38:39 +00:00
Andrew Kushnir 250dc40a46 fix(core): flush delayed scoping queue while setting up TestBed (#44814)
Previously, some NgModules that were added to the delayed scoping queue, never got removed from the queue before unit test execution. That resulted in some components (declared in those NgModules) missing their scope (which components/directives/pipes were matched).

This commit adds the logic to invoke delayed scoping queue flushing before starting a test to avoid missing/incomplete scopes for Components used in a test.

PR Close #44814
2022-01-31 21:37:53 +00:00
Lee Robinson 8fb2e3b71f docs: Update deployment docs for Vercel (#44904)
PR Close #44904
2022-01-31 21:32:42 +00:00
Doug Parker 626980f3eb build: fix update_all_goldens.js to use ESM. (#44916)
Attempting to run as is fails because we have `"type": "module"`. `shelljs` is a CommonJS module however, so we need to do a default import and destructure.

```
$ node packages/compiler-cli/test/compliance/update_all_goldens.js
const {exec} = require('shelljs');
               ^

ReferenceError: require is not defined in ES module scope, you can use import instead
This file is being treated as an ES module because it has a '.js' file extension and '/home/douglasparker/Source/ng/packages/compiler-cli/package.json' contains "type": "module". To treat it as a CommonJS script, rename it to use the '.cjs' file extension.
    at file:///home/douglasparker/Source/ng/packages/compiler-cli/test/compliance/update_all_goldens.js:11:16
    at ModuleJob.run (node:internal/modules/esm/module_job:183:25)
    at async Loader.import (node:internal/modules/esm/loader:178:24)
    at async Object.loadESM (node:internal/process/esm_loader:68:5)
    at async handleMainPromise (node:internal/modules/run_main:63:12)
```

PR Close #44916
2022-01-31 21:31:11 +00:00
Paul Gschwendtner 5400a3d88a build: fix formatting in zone.js BUILD file (#44911)
Fixes formatting in one of the Zone BUILD files.
The lint check on the renovate branch did not check
formatting as it seems. Needs more investigation as
the PR was green.

PR Close #44911
2022-01-31 21:28:25 +00:00
Paul Gschwendtner e07014f3d9 build: update legacy saucelabs bundle generation to account for esbuild update (#44911)
Previously with ESBuild 0.14.11, when a file had dynamic requires to
builtin NodeJS modules like `url`, the resolution completed successfully
regardless of `--platform browser`. This seems to be fixed in ESBuild now.

This unveiled some resolution errors with our Saucelabs bundle generation
because the framework code sometimes switches dynamically to `require('url')`
if `window.URL` is not defined. Previously this just didn't matter, but now
the `require('url')` is checked and a module resolution error is reported given
`url` not being available in the browser as a builtin module.

We fix this by marking the module as external. We will not hit this code path
anyway in the browser saucelabs code. Similarly we exclude all platform-server
files from the bundle. This is not strictly needed after the `url` module being
marked as external, but the issue showed that lots of unnecessary code for the
server platform is included. This can be omitted (unfortunately not from the TS
compilation without over-complicating things significantly more; experimented with
that).

PR Close #44911
2022-01-31 21:28:25 +00:00
Paul Gschwendtner 85b889e6fb build: update postinstall patch to account for benchmark macro changes (#44911)
Updates the postinstall patch for the benchmark macro rule from dev-infra.
We moved the ZoneJS setup to the bundler. This was necessary in order to
switch away from the Go-based (windows-incompatible, m1-incompatible)
concatjs devserver to a rather basic HTTP server (also provided by dev-infra now).

PR Close #44911
2022-01-31 21:28:25 +00:00
Renovate Bot 881d4696a2 build: update angular (#44911)
Updates to the latest version of Angular.

PR Close #44911
2022-01-31 21:28:25 +00:00
JoostK 07185f4ed1 fix(compiler-cli): enable nullish coalescing check only with strictNullChecks (#44862)
TypeScript configures `strictNullChecks` to be disabled by default, so the nullish
coalescing check should follow the same default. The rule actively depends on
`strictNullChecks`, as TypeScript doesn't include `null`/`undefined` in its types
otherwise so the check wouldn't have a way to differentiate between them.

This commit also takes the `strict` flag into account when `strictNullChecks` itself
is not configured.

PR Close #44862
2022-01-31 20:31:58 +00:00
JoostK 0778e6f7d7 fix(compiler-cli): accept nullish coalescing operator for any and unknown types (#44862)
We should not make assumptions about the any and unknown types; using a nullish
coalescing operator is acceptable for those.

PR Close #44862
2022-01-31 20:31:58 +00:00
Esteban Gehring 25f8305195 docs(core): showcase host listener support for specific keys in events (#44833)
PR Close #44833
2022-01-31 20:30:45 +00:00
Juri Strumpflohner b51d111d72 docs: update Nx headline (#44910)
PR Close #44910
2022-01-31 19:46:36 +00:00
Aristeidis Bampakos 72cdd1403b docs: add code format in content projection guide (#44907)
PR Close #44907
2022-01-31 19:45:47 +00:00
George Kalpakas c1fc425cd1 fix(docs-infra): make it possible to see whole notification text on smaller screens (#44900)
Previously, when the notification text did not fit on the viewport
width, it got truncated and it was not possible to see the whole text.

This commit fixes this by making the notification scrollable when the
text overflows.

PR Close #44900
2022-01-31 19:44:52 +00:00
George Kalpakas e62c98f2aa fix(docs-infra): make it easier to interact with notification on smaller screens (#44900)
On smaller screens, the action button in `NotificationComponent` is
hidden (due to limited horizontal screen "real estate"). Thus, the only
way to perform the action is to click on the notification message, which
is typically a link.

Previously, the link inside the notification did not take up the whole
height of the notification bar. As a result, clicking outside the link
would dismiss the notification without following the link.

This commit makes it easier to interact with the notification (esp. on
smaller screens) by ensuring the link covers the whole notification bar
(width and height).

PR Close #44900
2022-01-31 19:44:52 +00:00
Andrew Scott 47c02caa29 refactor(compiler-cli): Update where and how the indexed errors are exposed (#44884)
The initial commit e9124b42d5 stored the errors rather than
throwing but did not store them in a place that was accessible to consumers. Instead,
the errors should be added to the IndexedComponent so they can be surfaced where the
index results are consumed

PR Close #44884
2022-01-31 18:36:55 +00:00
George Kalpakas 94c9e47dbe Revert "fix(docs-infra): content overflow in mobile (#44851)" (#44899)
This reverts commit c2e09e0911, because it
messes up the table layouts on some resolutions/pages. See #44891 for
details.

Fixes #44891

PR Close #44899
2022-01-31 17:10:50 +00:00
Dylan Hunn 6b7fffcbeb fix(forms): Update the typed forms migration schematic to find all files. (#44881)
We were breaking out of the loop that walks the source tree due to an incorrect return.

PR Close #44881
2022-01-28 21:59:35 +00:00
fru2 641f27a9c9 fix(docs-infra): content overflow in mobile (#44851)
When reading the docs page on mobile, some page tend to scroll in horizontal direction quite a lot which is unpleasant

Fixes #44850

PR Close #44851
2022-01-28 18:01:47 +00:00
Paul Gschwendtner ab63ed3448 test(docs-infra): fix type checking errors with new jasmine types (#44876)
The jasmine types for `spyObj.calls().all()` seem to be more specific,
relying on `ThisType<Fn>` to determine the context/receiver for an invoked
spy. This type does not work as expected with class members as it seems.

This commit fixes three of these type checking failures by explicitly casting
the spy context to the actual class owning the method member.

PR Close #44876
2022-01-28 17:50:15 +00:00
Renovate Bot b89ee0819b build: update angular (#44876)
Updates to the latest versions of Angular organization NPM packages.

PR Close #44876
2022-01-28 17:50:15 +00:00
Renovate Bot 553c8d1366 build: lock file maintenance (#44876)
Cleans up the lock file by maximizing the versions as allowed per our
version ranges.

PR Close #44876
2022-01-28 17:50:15 +00:00
Maarten Tibau f398717502 docs: fix typo in update guide (#44853)
PR Close #44853
2022-01-28 17:37:25 +00:00
Aristeidis Bampakos c9abf34d88 docs: fix GitHub broken link in update guide (#44875)
PR Close #44875
2022-01-28 16:08:28 +00:00
George Kalpakas 96d2c58647 fix(docs-infra): fix links to CLI commands source code (#44835)
Recently, the [CLI repository][1] switched to not prefixing tag names
with a `v`. Update the `versionInfo` generated for CLI commands docs, so
that the links to the source code (which include the tag name) are
correct.

Fixes #44822

[1]: https://github.com/angular/angular-cli

PR Close #44835
2022-01-28 16:07:47 +00:00
Theodore Brown 49ca5bb1d8 refactor(forms): remove dead code (#37614)
This functionally dead code was originally introduced via pull request
were added to verify the fix, and the many comments on that issue after
it was closed indicate that it wasn't actually resolved.

In fact, setting `selectedIndex` does absolutely nothing here, since
the selected index is immediately overridden by setting the `value`
property. A working fix (with tests) for the IE/Safari bug is in pull
request #23784. Originally this dead code was removed as part of that PR,
but @AndrewKushnir recommended creating a separate PR for the cleanup.

PR Close #37614
2022-01-28 16:07:11 +00:00
dario-piotrowicz f6c2934f5b docs(core): edit and add docs for ng-container (#44762)
PR Close #44762
2022-01-28 15:55:33 +00:00
Andrew Kushnir 1169fae366 docs: update survey id (#44865)
The survey id is used as a key in the local storage to keep the state (don't show the message again). Reusing this survey id will make the message invisible to some users who already have that key in local storage.

PR Close #44865
2022-01-27 21:52:35 +00:00
mgechev 522b845bec docs: enable the survey banner (#44861)
PR Close #44861
2022-01-27 11:43:54 -08:00
Paul Gschwendtner 2fa2f7d34a ci: only build test targets for components repo unit test job (#44832)
To speed up the components CI job (avoiding it being a bottleneck in FW),
we will stop building everything in `src/...`, but rather only build targets
which are needed to run all tests within `src/...`.

This notably should avoid unnecessary NPM package building. Arguably that
part would also be valuable to have, but we already test the `ng_package`
rule in FW itself, plus we run snapshot tests in the components repo as well.

PR Close #44832
2022-01-27 09:22:24 -08:00
Paul Gschwendtner af19c440e2 ci: re-enable components repo unit tests job (#44832)
Re-enables the components-repo unit tests job that we previously
disabled due to the devmode target change that caused conflicts
with `angular/components` patching `ng_module.bzl` of `@angular/bazel`.

PR Close #44832
2022-01-27 09:22:24 -08:00
Andrew Scott 9f7157e560 refactor(compiler-cli): Tolerate source span errors in indexer (#44825)
When the indexer encounters a location where the source span doesn't
match up with the expected identifier, the current visitor code throws
an error. Instead, this change creates an error and moves on to the next
template item. This allows the indexer to continue analysis even when
there are errors in the source mapping. In addition, it still allows callers
to surface those errors in their own way while still providing as much indexed
information as possible about a node.

PR Close #44825
2022-01-27 09:20:09 -08:00
Renovate Bot 30ddeabca6 build: update dependency globby to v13 (#44801)
PR Close #44801
2022-01-27 09:18:58 -08:00
Renovate Bot 4a91d9b0a0 build: update dependency rules_pkg to v0.6.0 (#44818)
PR Close #44818
2022-01-26 17:37:42 -08:00
Jessica Janiuk fcc6528159 test(animations): Add bundling size regression test for animations package (#44826)
This adds a size regression test for the animations package to the test suite.

PR Close #44826
2022-01-26 12:54:36 -08:00
Andrew Kushnir dc0cac235f docs: cleanup CHANGELOG.md file (#44842)
PR Close #44842
2022-01-26 12:37:05 -08:00
Andrew Kushnir de1e35b944 release: cut the v13.2.0 release (#44838) 13.2.0 2022-01-26 11:44:41 -08:00
Dylan Hunn a38ae0aefa refactor(forms): Temporarily disable the typed forms migration. (#44828)
It's best to disable this optional migration in the minor release, although it shouldn't run anyway -- we don't want people accidentally running it.

This PR will be rolled back after the minor is out.

PR Close #44828
2022-01-25 17:03:48 -08:00
Andrew Scott fe3e4d6865 fix(compiler-cli): Handle ng-template with structural directive in indexer (#44788)
An `ng-template` with an inline template (i.e. has a structural
directive) would previously not get an `undefined` `tagName` because the
logic assumed the element would be `t.Element` or `t.Content` and read
the tag name from the `name` property. For a `t.Template`, this exists
instead on the `t.tagName`. The final result would be an `tagName` of `undefined`
for the parent `t.Template`, causing failures in the indexer downstream.

This `undefined` value is actually expected in the renderer code, even
though the type does not specify this possibility. This change updates
the type of `tagName` to be `string|null` and explicitly handles the
case where there is a structural directive on an `ng-template`. You can
see how the two are differentiated in the compliance code that was
modified in this commit.

PR Close #44788
2022-01-25 14:15:45 -08:00
George Kalpakas 6cb7c3ebe3 build(docs-infra): update dgeni-packages to v0.29.3 (#44810)
This version includes angular/dgeni-packages#318 and thus fixes the
rendering of overridden methods in API docs.

Fixes #44468

PR Close #44810
2022-01-25 09:24:41 -08:00
Renovate Bot 966343bb92 build: update angular (#44771)
PR Close #44771
2022-01-25 09:24:00 -08:00
Tim Bowersox 7e93513425 docs: add link to AbstractControlOptions reference (#44764)
PR Close #44764
2022-01-24 14:53:17 -08:00
Tim Bowersox 7c7a1a1724 docs: exclude setValue from async-validator-usage docregion (#44764)
Co-authored-by: Andrew Kushnir <43554145+AndrewKushnir@users.noreply.github.com>
PR Close #44764
2022-01-24 14:53:17 -08:00
Tim Bowersox 62217efb7e docs: add missing return statement to validate() (#44764)
PR Close #44764
2022-01-24 14:53:17 -08:00
Tim Bowersox 1fa14e0c84 docs: remove trailing space in code example (#44764)
PR Close #44764
2022-01-24 14:53:17 -08:00
Tim Bowersox a71eb4c18e docs: fix UniqueAlterEgoValidatorDirective (#44764)
PR Close #44764
2022-01-24 14:53:17 -08:00
Tim Bowersox ffd62b9f11 docs: expand async validators in reactive forms (#44764)
* Hone docregions for code examples
* Add more detailed description

PR Close #44764
2022-01-24 14:53:17 -08:00
Tim Bowersox e545dd8130 docs: revise text for adding async validators to template-driven forms (#44764)
Co-authored-by: Andrew Kushnir <43554145+AndrewKushnir@users.noreply.github.com>
PR Close #44764
2022-01-24 14:53:17 -08:00