Commit graph

23851 commits

Author SHA1 Message Date
Dario Piotrowicz
5498a35789 refactor(docs-infra): fix template eslint issues in aio examples (#44557)
the aio examples have various eslint issues regarding template rules, those
are currently turned off and TODO comments have been added to them in the
examples eslintrc, fix such issues and remove the respective TODO comments

this also includes examples refactoring to use buttons for better accessibility,
this change tries to make the smallest amound of changes to the examples' behaviors
and designs/UI

PR Close #44557
2022-02-03 12:44:46 -08:00
TANMAY SRIVASTAVA
226fac67bd docs: describe your change... (#42899)
in the last Lines ViewEncapsulationComponent should be EmulatedEncapsulationComponent as there is no such  ViewEncapsulationComponent  exists in this example where as 
ShadowDomEncapsulationComponent  contains NoEncapsulationComponent and EmulatedEncapsulationComponent
PR Close #42899
2022-02-03 12:41:36 -08:00
dario-piotrowicz
f7ea275dc4 docs: improve punctuation in animation sequence summary (#44567)
slightly improve the punctuation in the animation sequence summary present
in the complex animation sequences guide

PR Close #44567
2022-02-03 12:40:52 -08:00
Dario Piotrowicz
7dcf056710 docs(animations): add section about animating reordering list items (#44567)
add a section regarding reordering list items in the complex animation
sequences guide to help developers rememeber to use a `TrackByFunction`
whenever they are animating `*ngFor` list items which change their
ordering

as suggested here: https://github.com/angular/angular/issues/42750#issuecomment-979127165

relates to issue #28040 and #42750

PR Close #44567
2022-02-03 12:40:52 -08:00
markostanimirovic
791bd31424 feat(router): set stricter type for Route.title (#44939)
This commit changes the type of `Route.title` property from
`string | unknown` to `string | Type<Resolve<string>>`.

Fixes #44936

PR Close #44939
2022-02-03 12:40:28 -08:00
markostanimirovic
4dbd2028fe refactor(router): move types from config and interfaces to models (#44939)
This commit moves all types from `config.ts` and `interfaces.ts`
to `models.ts` to fix circular dependency.

PR Close #44939
2022-02-03 12:40:28 -08:00
Andrew Scott
48d430d7c2 docs: remove item from changelog that does not work (#44961)
After trying this feature, it turns out the approach does not work and we
will be reverting the commits. Note that the feature _never_ worked so it's
not a breaking change.

PR Close #44961
2022-02-03 12:40:00 -08:00
Joey Perrott
db27677218 build: update pullapprove (#44962)
Enable reviews for aleksanderbodurri again now that membership and review
assignments have been sorted.

PR Close #44962
2022-02-03 12:39:38 -08:00
Alex Rickabaugh
0072eb48ba feat(compiler-cli): initial implementation of standalone components (#44812)
This commit implements the first phase of standalone components in the Angular
compiler. This mainly includes the scoping rules for standalone components
(`@Component({imports})`).

Significant functionality from the design is _not_ implemented by this PR,
including:

* imports of standalone components into NgModules.
* the provider aspect of standalone components

Future commits will address these issues, as we proceed with the design of
this feature.

PR Close #44812
2022-02-03 08:55:25 -08:00
Alex Rickabaugh
3dcfc76bf2 refactor(compiler-cli): extract template scoping logic into a function (#44812)
In preparation for standalone components, this commit moves the logic which
determines the potential set of components/directives/pipes in a template into
a separate function. This is a simple but crucial refactoring that breaks the
assumption that all template scopes come from NgModules.

PR Close #44812
2022-02-03 08:55:25 -08:00
Alex Rickabaugh
cc0d73d195 refactor(compiler-cli): split the 'annotations' package into sub-packages (#44812)
Previously each `DecoratorHandler` in the compiler was stored in a single file
in the 'annotations' package. The `ComponentDecoratorHandler` in particular was
several thousand lines long.

Prior to implementing the new standalone functionality for components, this
commit refactors 'annotations' to split these large files into their own build
targets with multiple separate files. This should make the implementation of
standalone significantly cleaner.

PR Close #44812
2022-02-03 08:55:25 -08:00
Daniel Díaz
1aae414b36 docs: remove duplicate closing tags in View Encapsulation file (#44958)
PR Close #44958
2022-02-03 08:53:59 -08:00
Andrew Kushnir
077593f3bc docs: remove old commits from CHANGELOG.md (#44956)
This commit removes old DevTools-related commits that ended up in the CHANGELOG.md since the DevTools repo was merged into angular/angular one.

Closes #44953.

PR Close #44956
2022-02-02 17:34:27 -08:00
Doug Parker
85ba38aecb refactor(compiler): add @suppress {msgDescriptions} if no description is present on an i18n message (#44787)
Refs http://b/214103351.

This happens if a user writes `<span i18n>Message</span>`. This is accepted as an internationalized message, but without a description. JSCompiler will throw an error in this situation because descriptions are generally required. Now, the Angular compiler will generate a suppression annotation so JSCompiler allows the syntax. This will ease an internal migration to JSCompiler-based i18n.

PR Close #44787
2022-02-02 15:33:44 -08:00
mgechev
bf428775a4 fix(devtools): change links to the angular repo (#44885)
Use proper reporting and source code links in the DevTools UI.

PR Close #44885
2022-02-02 15:33:17 -08:00
Joey Perrott
eb3f06ae5f build: update pullapprove (#44954)
Update pullapprove to temporarily remove aleksanderbodurri from pullapprove configuration
while we correct the membership and review assignment's for the account.

PR Close #44954
2022-02-02 15:03:25 -08:00
Andrew Scott
202a1a5631 fix(upgrade): Do not trigger duplicate navigation events from Angular Router (#43441)
This code mimics behavior that Google Analytics has been using to
prevent duplicate navigations. They set up their own `HybridRoutingService`
location sync to avoid duplicate navigations that came from the Angular
router. This would happen because the Angular router would trigger a
navigation, which would then get picked up by the `$locationShim`, which
would trigger a `$locationChangeStart`, which would then be picked up by
the `setUpLocationSync` watcher here, which would again trigger a
navigation in the Angular Router.

All of this can be prevented by checking if the `navigationId` exists on
the history state object. This property is added by the Angular router
during navigations.

fixes #21610

PR Close #43441
2022-02-02 19:51:20 +00:00
Andrew Scott
45d37fc168 test(upgrade): update router upgrade tests to use fewer mocks (#43441)
This updates the router upgrade tests to use less mocked behavior. The
test upgrade location module is copied from the one that's used in the
common package. This update to the tests verifies more real behavior of
the upgrade module.

PR Close #43441
2022-02-02 19:51:20 +00:00
arturovt
a01bcb8e7e fix(platform-browser): do not run change detection when loading Hammer (#44921)
The Hammer.JS might be loaded asynchronously if the `HAMMER_LOADER` token is provided.
Its loading causes additional change detection cycles when the script `load` event is fired
and the `import()` promise resolves. Its loading doesn't have to require Angular running `tick()`
since the Hammer instance is created outside of the Angular zone anyway.

BREAKING CHANGE:

This change may cause a breaking change in unit tests that are implicitly depending on a specific
number and sequence of change detections in order for their assertions to pass.

PR Close #44921
2022-02-02 19:50:46 +00:00
mgechev
39b90b46b6 docs: remove banner after survey expiration (#44949)
The survey is now over. We can remove the banner.

PR Close #44949
2022-02-02 19:50:20 +00:00
Jessica Janiuk
0c36f82134
release: cut the v14.0.0-next.1 release (#44951) 2022-02-02 11:39:30 -08:00
Jessica Janiuk
38bb2bea9b
docs: release notes for the v13.2.1 release (#44950) 2022-02-02 10:51:13 -08:00
George Kalpakas
c08db209e3 build(docs-infra): upgrade cli command docs sources to be7c79b5a (#44942)
Updating [angular#master](https://github.com/angular/angular/tree/master) from
[cli-builds#master](https://github.com/angular/cli-builds/tree/master).

##
Relevant changes in
[commit range](db5e7c82e...be7c79b5a):

**Modified**
- help/build.json
- help/test.json

PR Close #44942
2022-02-02 17:03:32 +00:00
Dylan Hunn
cae1e44608 fix(forms): Update the typed forms migration to use FormArray<T> instead of FormArray<T[]>. (#44933)
Previously, `FormArray` accepted an array generic. Now it accepts the element type, so the migration must be update accordingly.

PR Close #44933
2022-02-02 01:58:18 +00:00
mgechev
1b56437376 docs: update the survey expiration date (#44938)
Extend with a few more days since the survey is still open.

PR Close #44938
2022-02-02 01:56:40 +00:00
JoostK
d82c957a26 fix(compiler-cli): ensure casing of logical paths is preserved (#44798)
The logical filesystem would store a cached result based on the canonical path,
where the cached value contains the physical path that was originally provided.
This meant that other physical paths with an identical canonical path would use
a cached result derived from another physical path.

This inconsistency is not known to result in actual issues but is primarily
being made as a performance improvement, as using the provided physical paths
as cache key avoids the need to canonicalize the path if its result is already
cached.

PR Close #44798
2022-02-02 00:04:37 +00:00
JoostK
b745b8c42a refactor(compiler-cli): use relative imports into dts files as fallback in type-check files (#44798)
The generated imports should normally use module specifiers that are valid for
use in production code, where arbitrary relative imports into e.g. node_modules
are not allowed. For template type-checking code it is however acceptable to
use relative imports, as such files are never emitted to JS code. It is
desirable to allow a filesystem relative import as fallback if an import would
otherwise fail to be generated, as doing so allows fewer situations from
needing an inline type constructor.

PR Close #44798
2022-02-02 00:04:37 +00:00
JoostK
6763967151 refactor(compiler): remove ViewEngine identifiers (#44676)
This commit removes the leftover `Identifiers` class that was used in the
ViewEngine compiler. The remaining usages of the `inlineInterpolate` and
`interpolate` instructions were refactored to make use of an
`InterpolationExpression` output expression to capture the argument list of an
interpolation expression. An attempt was made to refactor this further by
converting to the desired interpolation instruction immediately, but some
downstream consumers are designed in a way where the argument list itself is
needed, e.g. as other arguments need to be prepended/appended.

PR Close #44676
2022-02-02 00:04:13 +00:00
markostanimirovic
fc1c143594 docs(router): use Resolve interface for custom title resolver (#44934)
PR Close #44934
2022-02-02 00:03:31 +00:00
Andrew Scott
03ab7053ce build: fix test for useUnknownInCatch (#44935)
CI ran before the change to the tsconfig file

PR Close #44935
2022-02-01 23:40:17 +00:00
markostanimirovic
4b4bf05ad4 docs(router): provide better typing for resolver example (#44932)
PR Close #44932
2022-02-01 22:06:29 +00:00
JoostK
a2cbffc06f fix(common): include query parameters for open HTTP requests in verify (#44917)
When `HttpTestingController.verify` is used to verify that there are not open,
unexpected requests it would throw an error with the method and URL of all pending
requests, excluding the query parameters. This is confusing, as e.g. `expectOne`
matches a URL including its query parameters and `expectOne` does include the
query parameters when it reports when no request could be matched.

This commit changes the error that is reported by `verify` to include the query
parameters.

Closes #19974

PR Close #44917
2022-02-01 21:41:43 +00:00
JimMorrison723
d41dedb85b fix(devtools): highlighter should only show the hovered component's name (#44863)
The used children property on a HTMLCollection does not contain text elements. Because of this, the highlighter overlay text never got fully cleared.

PR Close #44863
2022-02-01 21:28:09 +00:00
JimMorrison723
2006f53b48 docs: update devtools docs, and add to the list of available commit scope list (#44863)
PR Close #44863
2022-02-01 21:28:09 +00:00
Andrew Kushnir
c89cf63059 feat(common): support NgModule as an input to the NgComponentOutlet (#44815)
This commit updates the logic of the `NgComponentOutlet` class to allow passing an `NgModule` as an input instead of passing an `NgModule` factory.

DEPRECATED:

The `ngModuleFactory` input of the `NgComponentOutlet` directive is deprecated in favor of a newly added `ngModule` input. The `ngModule` input accepts references to the NgModule class directly, without the need to resolve module factory first.

PR Close #44815
2022-02-01 20:19:41 +00:00
David Shevitz
ab003a4094 docs: fix incorrect title and tooltip in navigation (#44710)
Fixes #44589

In the navigation pane, the title and tooltip for the page,
Preparing component for translation, are incorrect. This PR
fixes this issue.

PR Close #44710
2022-02-01 19:17:40 +00:00
Alan
5d7ffd5c0c docs: correct the demo code of NgZone.run (#44733)
`NgZone.run` needs to be within the async closure, not around its registration, refer to: https://github.com/angular/angular/issues/44714
PR Close #44733
2022-02-01 19:16:16 +00:00
Arjen
9f5edce0e9 docs: explain how ngsw.json is generated (#44823)
Update aio/content/guide/service-worker-devops.md

ngsw.json is the manifest file which is generated at build time ( based on ngsw-config.json ). This explains this a bit clearer.
At first, I thought that it was a wrongly named filename. Not is it explicitly described.

Co-Authored-By: George Kalpakas <kalpakas.g@gmail.com>

PR Close #44823
2022-02-01 18:26:42 +00:00
Doug Parker
e0a340ea5b refactor(compiler-cli): remove leftover _extendedTemplateDiagnostics flag (#44920)
This flag is currently a no-op because extended diagnostics are enabled in production.

PR Close #44920
2022-02-01 18:24:10 +00:00
Daniel Díaz
6829fc4a4c docs: add colon before introducing the list of items (#44751)
PR Close #44751
2022-02-01 18:20:47 +00:00
Andrew Scott
fdfcef5a0a build: enable useUnknownInCatchVariables (#44679)
This unblocks the internal migration to turn the option on in g3.

PR Close #44679
2022-02-01 18:17:29 +00:00
Alan Agius
bc61cc2449 refactor(migrations): remove old migrations (#44857)
When using `ng update` users cannot update multiple major versions at the same time. Therefore migrations that are not targeting version 14 cannot be run and therefore we are removing them.

PR Close #44857
2022-02-01 03:52:26 +00:00
Andrew Kushnir
ed1732c268 refactor(core): the RuntimeError class should support more compact syntax (#44783)
This commit refactors the `RuntimeError` class to support a short version of providing error messages:
```
throw new RuntimeError(
  RuntimeErrorCode.INJECTOR_ALREADY_DESTROYED,
  ngDevMode && 'Injector has already been destroyed.');
```
In prod mode, the second argument becomes `false` andn this commit extends the typings to support that.

This commit also contains a couple places were the `RuntimeError` class is used to demostrate the compact form.

PR Close #44783
2022-02-01 00:15:56 +00:00
JoostK
db05ae13a6 refactor(compiler): remove parsing support for quote expressions (#44915)
So-called "Quote expressions" were added in b6ec2387b3
to support foreign syntax to be used in Angular templates, requiring a custom
template transform to convert them somehow during compilation. Support for template
transforms was originally implemented in a43ed79ee7 but
has since been dropped. Since the compiler is not public API the quote expressions
should not have any usages anymore. Removing support for them can improve error
reporting for expressions that contain a `:`, e.g. binding to a URL without quotes:

```html
<a [href]="http://google.com">Click me</a>
```

Here, `http` would be parsed as foreign "http" quote expression with `//google.com` as
value, later reporting the error "Quotes are not supported for evaluation!" because
there was no template transform to convert that code.

Closes #40398

PR Close #44915
2022-01-31 23:31:11 +00:00
Dylan Hunn
f0cfa00a34 refactor(forms): Move FormControl to an overridden exported constructor. (#44316) (#44806)
This implementation change was originally proposed as part of Typed Forms, and will have major consequences for that project as described in the design doc. Submitting it separately will greatly simplify the risk of landing Typed Forms. This change should have no visible impact on normal users of FormControl.

See the Typed Forms design doc here: https://docs.google.com/document/d/1cWuBE-oo5WLtwkLFxbNTiaVQGNk8ipgbekZcKBeyxxo.

PR Close #44316

PR Close #44806
2022-01-31 22:48:23 +00:00
JoostK
cec158b23a refactor(compiler-cli): remove unused canonical-path dependency (#44918)
This package is no longer used within `compiler-cli` so is being removed as a dependency.

PR Close #44918
2022-01-31 21:39:53 +00:00
Andrew Scott
5686f68fde 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
2b9cc8503d 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
9eff8908af 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
889de8276d 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
39c614c438 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