8765 Commits

Author SHA1 Message Date
dario-piotrowicz 862dd03764 refactor(animations): refactor non-animatable check to be timeline based (#46666)
move the check for non-animatable properties from the animation building
phase to the application of the animation's transition instead, in such
a way we can check it against the keyframes of the transition's timeline
in order to only provide warnings for properties which are being
animated, thus not providing any warning for non-animatable properties
being applied to elements via the style function

this change has the benfit just mentioned above but it comes with two
drawbacks:
 - the warning handling is not done in the building time so it is a bit
inconsistent with other type of validations (such as the unsupported css
properties one for example)
 - before the warning was being applied only when the animation's data
was being parsed, so it happed only once but now since it is applied
when the animation is actually being prepared to be played, it happens
each time the animation runs

resolves #46602

PR Close #46666
2022-07-12 22:36:22 +00:00
JoostK 99697dae66 fix(compiler-cli): only consider used pipes for inline type-check requirement (#46807)
After a bugfix in #46096, the compiler is now better capable of detecting pipes
which require an inline type constructor. However, there is an issue in how all
pipes are considered when verifying the inline type-ctor requirement: it should
only check actually used pipes.

Fixes #46747

PR Close #46807
2022-07-12 21:09:18 +00:00
Paul Gschwendtner 349043db7b build: replace size-tracking test with rule from shared dev-infra (#46802)
The JS size-tracking logic has been moved into the dev-infra repository
and the rule has been updated to work better with Bazel labels. The
Starlark target is updated accordingly in this commit.

PR Close #46802
2022-07-12 19:06:30 +00:00
Uday Sony 4f469cbef3 fix(forms): expose ControlConfig in public API (#46594)
This commit exposes the ControlConfig as a public API, so that the symbol can be used in applications.

PR Close #46594
2022-07-12 17:45:38 +00:00
Paul Gschwendtner faba0234a8 build: move jasmine seed generation logic to karma config (#46798)
The jasmine seed generator is only used in a single karma configuration
file. Used by the legacy build and the Saucelabs/ZoneJS Karma jobs.

We should move the separate script code directly into the config to make
it clear that the seed generation is not used elsewhere, and to simplify
the Starlark code.

PR Close #46798
2022-07-12 15:54:52 +00:00
Jessica Janiuk 61c7e26500 Revert "refactor(router): Remove use of OutletInjector" (#46775)
This reverts commit e288d87742.

PR Close #46775
2022-07-11 19:13:21 +00:00
Angular Robot 22872e9114 build: update dependency mocha to v10 (#46619)
| datasource | package | from  | to     |
| ---------- | ------- | ----- | ------ |
| npm        | mocha   | 9.2.2 | 10.0.0 |

PR Close #46619
2022-07-11 18:13:37 +00:00
Jessica Janiuk ec267b4127 Revert "build: update router symbol golden file" (#46760)
This reverts commit bb9ec76c7d.

PR Close #46760
2022-07-08 23:12:34 +00:00
Jessica Janiuk 0549e4ddbc Revert "refactor(router): Simplify the prioritizeGuardValue logic" (#46759)
This reverts commit f32fface4763d789a8b7cc4f4489f98be4e1073a.

PR Close #46759
2022-07-08 22:27:01 +00:00
Andrew Scott 770f05421e refactor(router): Remove use of OutletInjector (#46755)
OutletInjector doesn't do anything special. Injector.create can be used instead

PR Close #46755
2022-07-08 21:56:01 +00:00
Andrew Scott 50126af513 build: update router symbol golden file (#46757)
File got out of date when merging a patch & main branch change

PR Close #46757
2022-07-08 21:14:57 +00:00
Andrew Scott b1b4891192 refactor(router): Simplify the prioritizeGuardValue logic (#46745)
The existing logic does something similar but in a more roundabout way.
It reads _the whole array_. If it encounters a pending value, it ignores
the remaining ones. If it hasn't encountered a pending value by the time
it hits false/UrlTree, it returns that result.

The new logic is the same, but reverses what we're looking for. Instead
of processing the whole array, we stop when we encounter an initial
value. When we encounter one that isn't `true`, that gets returned. If
we get to the end and everything was `true`, return `true`.

PR Close #46745
2022-07-08 20:03:47 +00:00
Angular Robot 8683e16d8d build: update babel dependencies (#46708)
See associated pull request for more information.

PR Close #46708
2022-07-08 19:58:37 +00:00
zhysky dfb6246b30 docs: fix packages\docs\di\di.md (#46704)
‘Provider11’ is unreasonable, according to the context, it should be ‘Provider1’

PR Close #46704
2022-07-08 17:53:39 +00:00
dario-piotrowicz 68b46e0d8d Revert "fix(animations): enable shadowElements to leave when their parent does (#46459)" (#46739)
This reverts commit b417370383.

The change applied is no longer appropriate since the use of animations
and shadow dom components is discouraged (as of #46738)

PR Close #46739
2022-07-07 13:51:30 -07:00
Alan Agius 686a5b4147 docs: typo fix in destroy description (#46737)
Typo in environment.

PR Close #46737
2022-07-07 13:33:10 -07:00
Alan Agius 14863acb1a fix(localize): add --project option to ng-add schematic (#46664)
`--project` is unwritten standard to provide the project name. With this change we allow the project name to be provided using the `--project` command line argument and remove the ambiguity with other schematics.

PR Close #46664
2022-07-06 15:49:05 -07:00
Dylan Hunn e8c8b695f2 fix(forms): Move all remaining errors in Forms to use RuntimeErrorCode. (#46654)
RuntimeErrorCode allows for better tree-shaking, and unique codes for each error.

PR Close #46654
2022-07-06 09:49:39 -07:00
Alan Agius ecd01f9f04 refactor(core): remove unused tick method (#46722)
This method is unused and is not part of the public API.

PR Close #46722
2022-07-06 09:48:55 -07:00
Andrew Scott aee02b7e82 docs: Add BootstrapOptions to publicApi (#46679)
`BootstrapOptions` is exposed through `PlatformRef#bootstrapModule` but
is not included in the public API so you cannot find it on angular.io.
This commit simply marks the interface as public API (as it should be).

PR Close #46679
2022-07-06 08:55:38 -07:00
Andrew Scott 5001a7fb02 refactor(router): Remove custom error message for invalid guards (#46680)
This custom error message for invalid guards requires a fair bit of
extra logic in several places. This change reduces special logic for an error
case that would fail anyways. Additionally, there were already a couple
places that _did not_ have this special error and we have not seen any
indication that there is more confusion for those (resolvers and canMatch).

PR Close #46680
2022-07-06 07:40:58 -07:00
Alan Agius 4c7fbbe357 docs: fix typo in $localize description (#46659)
`18n` should be `i18n`

PR Close #46659
2022-07-06 07:30:14 -07:00
Paul Gschwendtner cde0a40a4b test: refactor bundle tests to not directly access CommonJS module.exports (#46642)
The test apps are bundled using their production ESM JS output using
`esbuild`. ESBuild warns about any CJS usages, like `module.exports.`

```
INFO: From Bundling Javascript packages/core/test/bundling/todo_i18n/index.ts [esbuild]:
▲ [WARNING] The CommonJS "module" variable is treated as a global variable in an ECMAScript module and may not work as expected

    bazel-out/k8-fastbuild/bin/packages/core/test/bundling/todo_i18n/index.mjs:494:0:
      494 │ module.exports = {
          ╵ ~~~~~~

  This file is considered to be an ECMAScript module because the file name ends in ".mjs".
```

Some bundling tests currently use `module.exports` to make
functions/symbols available to specs later requiring the bundle (in
order to run the bundle). Instead of using the CJS global here, the
logic can be attached consistently to `window` (there is currently a
mismatch of window vs. module.exports anyway..).

PR Close #46642
2022-07-01 10:20:52 -07:00
Paul Gschwendtner 545c527399 test: update schematics workspace test to no longer verify JSON5 features (#46642)
The Angular CLI has removed the JSON5 parsing and now always uses
`jsonc-parser`. Our test checks if JSON5 features can be parsed, but
this now breaks and the test needs to be adjusted.

We still want to keep the test to ensure we do not parse the Angular
CLI workspace file in a different way, not e.g. supporting jsonc.

PR Close #46642
2022-07-01 10:20:52 -07:00
Andrew Scott 70a88bbd67 docs: Update runGuardsAndResolvers documentation (#46671)
fixes  #46001

PR Close #46671
2022-07-01 10:19:22 -07:00
Andrew Scott 7fe81a9a0c refactor(router): Convert user-visible router errors to RuntimeError (#46630)
This commit refactors the Router errors to use the standard
`RuntimeError` used by the framework packages.

PR Close #46630
2022-06-30 13:37:17 -07:00
Alex Rickabaugh 1bd0b5665d refactor(core): remove experimental renderComponent function (#46646)
This commit removes the experimental `renderComponent` operation, which
implemented an alternative, lighter-weight bootstrapping option. This
experiment is being discontinued as the path towards it being a supported
production API was not clear. In particular, it lacked a clear roadmap for
supporting Angular's change detection, particularly when consuming existing
components.

PR Close #46646
2022-06-30 12:44:30 -07:00
Alex Rickabaugh 368765c4a1 refactor(core): remove experimental Renderer3 abstraction (#46646)
This commit removes the `Renderer3` experiment which attempted to use the
real DOM API as Angular's renderer. As shown in the diff, having this
experiment around added real code complexity to Angular that could not be
removed by an optimizer.

Since we no longer feel this experiment is worth continuing, we're removing
the `Renderer3` concept and all supporting code.

PR Close #46646
2022-06-30 12:44:30 -07:00
Alex Rickabaugh 4272da5de6 refactor(core): disable automatic usage of Renderer3 (#46646)
Previously, when instantiating a component, Angular would look in the DI
hierarchy for `RendererFactory2`. Any DI tree which rolls up through an
application injector (that is, one created with `BrowserModule`) should be
able to provide this interface. If not found, Angular would switch to the
experimental `Renderer3` mechanism. This switch was designed this way,
because it allowed for the creation of experimental applications where
`RendererFactory2` was not included in the bundle at all.

In this commit, instead of automatically falling back on `Renderer3`-style
rendering, an error is raised instead if `RendererFactory2` is missing from
the DI hierarchy.

PR Close #46646
2022-06-30 12:44:30 -07:00
Alex Rickabaugh 6c3267f4b1 test(core): migrate tests off of Renderer3 interfaces (#46646)
This commit migrates any remaining Angular tests which are using some form
of Renderer3 interfaces. Instead, they're switched to Renderer2.

PR Close #46646
2022-06-30 12:44:29 -07:00
Alex Rickabaugh 497df1a1bf refactor(core): rename the ProceduralRenderer3 interface to Renderer (#46646)
Due to the restrictions of circular dependency checking, we need a separate
internal interface for a renderer. We cannot use `Renderer2` as a type
internally as even importing it as a type incurs a dependency on its
implementation, which creates a major potential for circular dependencies.

Previously this role was served by the `Renderer3` type. As we prepare to
remove the `Renderer3` abstraction (the idea of using `document` as a
differently-shaped renderer), this commit renames `ProceduralRenderer3` to
the more generic term `Renderer`.

`RendererFactory3` is also renamed to the more generic `RendererFactory` for
consistency.

PR Close #46646
2022-06-30 12:44:29 -07:00
Andrew Scott a3bd65e2b8 fix(router): Ensure APP_INITIALIZER of enabledBlocking option completes (#46634)
Previously, if `initialNavigation` were set to `enabledBlocking`, the
Router's `APP_INITIALIZER` would never resolve if that initial
navigation failed. This results in the application load hanging and
never completing.

fixes #44355

PR Close #46634
2022-06-29 15:19:34 -07:00
Andrew Kushnir 88298cab50 test(core): set parent injector in createEnvironmentInjector calls in tests (#46633)
This commit updates the `createEnvironmentInjector` calls in standalone components tests, so that an injector is wired to the DI hierarchy and the code doesn't fall back to using a Renderer3.

PR Close #46633
2022-06-29 14:30:19 -07:00
Pawel Kozlowski a183a2df50 test(core): remove enableRenderer3 and Renderer3 from tests (#46612)
Remove calls to enableRenderer3 in the functional unit tests.
This effectivelly cuts code paths going through the Renderer3
in the functional tests.

PR Close #46612
2022-06-29 11:18:22 -07:00
Alan Agius 153c7cbd2a refactor: remove no longer used prompts utils (#46587)
These utils are no longer used in Angular migrations.

PR Close #46587
2022-06-29 10:31:18 -07:00
renovate[bot] 3da6afbf79 build: update dependency google-closure-compiler to v20220601 (#46565)
PR Close #46565
2022-06-29 10:18:27 -07:00
Dylan Hunn 74a26d870e fix(forms): Convert existing reactive errors to use RuntimeErrorCode. (#46560)
This allows for better tree-shakability, as well as the addition of guides in the future as needed.

PR Close #46560
2022-06-29 10:15:43 -07:00
renovate[bot] 7276a74dbb build: update dependency @rollup/plugin-commonjs to v22 (#46556)
PR Close #46556
2022-06-29 10:08:30 -07:00
Paul Gschwendtner e74ab2c5a6 refactor: clean-up pre-CLDR 39 safety check (#46606)
This commit cleans-up/removes a check we added before we supported CLDR
39. This check was necessary due to a incomplete/invalid list of locales
provided as part of the JSON data.

PR Close #46606
2022-06-29 10:06:39 -07:00
Andrew Kushnir cee8181e1a refactor(core): remove no longer needed utils (#46571)
This commit removes a file that contained utils (including `TemplateFixture`) that are no longer used.

PR Close #46571
2022-06-29 10:01:36 -07:00
Andrew Kushnir d716ff8e87 test(core): update various tests to avoid referencing TemplateFixture (#46571)
This commit updates the remaining set of tests to avoid referencing `TemplateFixture` class.

PR Close #46571
2022-06-29 10:01:36 -07:00
Andrew Kushnir b9049f5c41 test(core): avoid TemplateFixture usages in LViewDebug spec (#46571)
This commit further reduces the use of an obsolete `TemplateFixture` class.

PR Close #46571
2022-06-29 10:01:36 -07:00
Andrew Kushnir 07a7b721be test(core): avoid TemplateFixture usages in i18n spec (#46571)
This commit further reduces the use of an obsolete `TemplateFixture` class.

PR Close #46571
2022-06-29 10:01:36 -07:00
Andrew Kushnir 5442aad62b test(core): move Pipe-related tests to the acceptance folder (#46571)
This commit refactors a  Pipe-related test to use TestBed and moves it to the `acceptance` folder.

PR Close #46571
2022-06-29 10:01:36 -07:00
Alan Agius 72976c7a28 test: update golden symbols (#46582)
This is causing CI to fail

PR Close #46582
2022-06-29 00:53:52 -07:00
Alex Rickabaugh 0a36ee70fc test(core): convert remaining bundling tests to not use renderComponent (#46559)
This commit converts the remaining bundling tests which were using
`renderComponent` to use regular bootstrapping instead.

Since `renderComponent` is synchronous and regular bootstrapping is not,
some test adjustments were necessary to wait for bootstrapping before test
assertions could run.

Additionally, debug servers were adjusted in some cases where they'd broken
(likely some time ago).

PR Close #46559
2022-06-28 21:37:46 -07:00
Alex Rickabaugh 290ccc36c7 test(core): add symbol tests back to todo, hello_world bundling tests (#46559)
The deleted r3 versions of these tests had symbol tests, but their r2
equivalents did not. This commit adds symbol tests to the r2 variants.

PR Close #46559
2022-06-28 21:37:46 -07:00
Alex Rickabaugh 5e4be235ca test(core): rename r2-based hello_world and todo bundling tests (#46559)
In the previous commit, the r3-based hello_world and todo tests were deleted
in favor of the r2 versions. This commit renames the r2 versions to drop the
r2 suffix.

PR Close #46559
2022-06-28 21:37:46 -07:00
Alex Rickabaugh 5b84168ee8 test(core): remove redundant renderComponent-based bundling tests (#46559)
The `hello_world` and `todo` bundling tests use the experimental
`renderComponent` function (and `Renderer3`) as a result, and have
corresponding `Renderer2` equivalents. This commit removes these tests in
favor of the `Renderer2` versions, which will be renamed in a future commit.

PR Close #46559
2022-06-28 21:37:46 -07:00
Andrew Kushnir a2171c11e4 refactor(core): remove no longer used helper methods in the renderer3 folder (#46561)
This commit updates the `render_util.ts` file to drop no longer needed helpers.

PR Close #46561
2022-06-28 21:28:22 -07:00