Commit graph

26799 commits

Author SHA1 Message Date
Alex Rickabaugh
0afdd1f7a6 refactor(compiler): introduce ir.VisitorContextFlag to template pipeline (#49797)
This commit introduces a flag which is tracked while visiting expression
nodes in the template pipeline. This flag can be used to differentiate when
in an immediate evaluation context vs. a closure, which is useful for
certain operations.

PR Close #49797
2023-04-18 17:00:50 +00:00
Alex Rickabaugh
e8b2b5ca3c refactor(compiler): generate correct fn names in the template pipeline (#49797)
The `TemplateDefinitionBuilder` has a specific pattern it uses for template
function names for embedded view template functions. This commit changes the
template pipeline to use the same format, allowing the generated code to
match between them.

PR Close #49797
2023-04-18 17:00:50 +00:00
Alex Rickabaugh
b4da472952 refactor(compiler): rethink ir.SemanticVariables and their naming (#49797)
The `TemplateDefinitionBuilder` uses the same name for the same semantic
variables across different views declared in a component. This commit
refactors the template pipeline's concept of `ir.SemanticVariable` to share
instances across all `ViewCompilation`s. This allows the `name` of the
variable to be stored on the `ir.SemanticVariable` instance instead of on
the `ir.VariableOp` (which makes sense as variables are often named based on
the `ir.SemanticVariable` anyway).

PR Close #49797
2023-04-18 17:00:50 +00:00
Alex Rickabaugh
fe0425b5ce refactor(compiler): read context of the correct view for let- variables (#49797)
The template pipeline was previously reading the context of the wrong view,
resulting in incorrect generated code. Previously only `ctx` was being used,
since the context read was always that of the current view being compiled,
even for variables which exist on the contexts of parent views.

PR Close #49797
2023-04-18 17:00:50 +00:00
Alex Rickabaugh
0443cb4b38 refactor(compiler): reorder fields for template pipeline output (#49797)
The template pipeline was emitting fields on the component definition in a
different order than the `TemplateDefinitionBuilder`, which causes test
failures. Additionally, the `consts` field was being emitted even if it was
empty.

PR Close #49797
2023-04-18 17:00:50 +00:00
CodeMaster7000
c118569c6e docs: update README.md (#48423)
PR Close #48423
2023-04-18 16:59:38 +00:00
Vasil Chimev
35dabf9862 docs: typos and wording (#48597)
PR Close #48597
2023-04-18 16:58:31 +00:00
Matthieu Riegler
d4ef20736f refactor(compiler): handle #24571 todos. (#49220)
This commit removes the remaining TODO(issue/24571) in compiler code base.

PR Close #49220
2023-04-18 16:30:44 +00:00
Vladyslav Makarenko
34b796f904 docs: add a dot (#49434)
The first sentence misses a dot in the end, however other sentences have it
PR Close #49434
2023-04-18 16:22:50 +00:00
Ikko Eltociear Ashimine
3ce1c98b1d refactor: fix typo in windows-chromium-path.js (#49676)
preceeding -> preceding
PR Close #49676
2023-04-18 16:22:09 +00:00
John Manners
36ed47fdf4 docs: fix errors in toh-pt6.md (#49129)
Line 182 and line 185 - grammatical and typo errors.
PR Close #49129
2023-04-18 16:21:35 +00:00
Angular Robot
09332e7c5c build: update io_bazel_rules_sass digest to 898e4dd (#49575)
See associated pull request for more information.

PR Close #49575
2023-04-18 16:20:53 +00:00
Matthieu Riegler
1816c89326 refactor(platform-browser): cleanup references to dart (#49858)
The repo doesn't support dart anymore, we can reduce the references to it .

PR Close #49858
2023-04-18 14:00:45 +00:00
Matthieu Riegler
ff0d23d6da refactor(core): cleanup references to dart (#49858)
The repo doesn't support dart anymore, we can reduce the references to it .

PR Close #49858
2023-04-18 14:00:45 +00:00
Matthieu Riegler
93ce7b7629 refactor(compiler): cleanup references to dart (#49858)
The repo doesn't support dart anymore, we can reduce the references to it .

PR Close #49858
2023-04-18 14:00:45 +00:00
Matthieu Riegler
da5071fc20 refactor(core): Remove ununsed Zone mock from testing internals. (#49873)
The last time it was used in was on the v10 branch.

PR Close #49873
2023-04-18 14:00:15 +00:00
Pawel Kozlowski
b7392f9064 fix(core): execute template creation in non-reactive context (#49883)
This fix assures that templates functions executed in the creation mode
are run outside of the reactive context. This avoids the situation where
signal reads in a directive constructor (executed as part of the creation
mode) would mark the host component as dirty.

Fixes #49871

PR Close #49883
2023-04-18 13:59:42 +00:00
Angular Robot
ec30674e20 build: update scorecard action dependencies (#49897)
See associated pull request for more information.

PR Close #49897
2023-04-18 13:58:53 +00:00
Andrew Kushnir
79292c9b65 docs: include a note on blocking initial navigation when destructive hydration is used (#49895)
This commit updates the docs for the `withNoDomReuse` function, which lets to opt out of non-destructive hydration.
The docs now mention the need to configure an initial navigation option for the Router to be blocking, i.e.
use `withEnabledBlockingInitialNavigation()` Router feature.

PR Close #49895
2023-04-18 13:56:06 +00:00
Jessica Janiuk
2845017f83 Revert "refactor(core): throw an error when APP_INITIALIZER token is not an array. (#49860)" (#49893)
This reverts commit bf2e11c035.

PR Close #49893
2023-04-17 18:57:47 +00:00
Kristiyan Kostadinov
8f3fca03d2 build: update PullApprove config (#49878)
Updates the PullApprove config to add myself to `fw-compiler` and `fw-core` with the following reasoning:
* We talked about `fw-compiler` some time ago, because it would help with TypeScript updates and because I'm familiar with the compiler.
* Also adding myself to `fw-core` to make it easier with some upcoming features and because I can help with the review load for the runtime changes.

PR Close #49878
2023-04-17 18:32:15 +00:00
Lara Newsom
8926b558af docs(docs-infra): add lara newsom to GDE resources (#49620)
PR Close #49620
2023-04-17 18:31:14 +00:00
Andrew Scott
3c65305b10 refactor(router): remove targetPageId from transition (#49799)
The `targetPageId` was pre-calculated at the start of a navigation using
the same logic that exists in `setBrowserUrl` now. Doing the calculation
ahead of time is not necessary and complicates the transition state.

PR Close #49799
2023-04-17 17:36:02 +00:00
Matthieu Riegler
f6b9cf3f66 refactor(compiler): Remove unnecessary assertion in jit_compiler_facade. (#49852)
This commit removes unnecessary types assertions.

PR Close #49852
2023-04-17 17:35:28 +00:00
Andrew Scott
a49279d0f2 fix(core): Ensure effects can be created when Zone is not defined (#49890)
Effects should run in the same zone they were created in. However, if ZoneJS is not used at all,
effects should just run (without zone). This is similar to what's done
in the elements `ComponentNgElementStrategy`.

fixes #49798

PR Close #49890
2023-04-17 17:34:57 +00:00
Matthieu Riegler
49386de19f docs: Specify when an app is debuggable by the DevTools. (#48970)
DevMode is when the ng debug object is available. `Optimization:true` is responsible for treeshaking everything behind `ngDevMode`.

Fixes #48968

PR Close #48970
2023-04-17 17:32:41 +00:00
Matthieu Riegler
6daa454e40 fix(devtools): Specify when an app is considered in dev mode. (#48970)
DevMode is when the ng debug object is available. `Optimization:true` is responsible for treeshaking everything behind `ngDevMode`.

PR Close #48970
2023-04-17 17:32:41 +00:00
Matthieu Riegler
2aa6d6d616 refactor(compiler-cli): cleanup inferences (#49863)
With the ts compiler updates these inferences have been fixed.

PR Close #49863
2023-04-17 17:23:29 +00:00
Angular Robot
8f28f1999b build: update dependency eslint-plugin-jsdoc to v41 (#49885)
See associated pull request for more information.

PR Close #49885
2023-04-17 15:48:23 +00:00
Angular Robot
f023020368 build: update cross-repo angular dependencies (#49887)
See associated pull request for more information.

PR Close #49887
2023-04-17 15:46:39 +00:00
Matthieu Riegler
3ba5dcc150 refactor(compiler-cli): remove unused integration tests. (#49862)
Theses tests have been disabled when the ViewEngine code has been remove in v13.1

PR Close #49862
2023-04-17 14:57:02 +00:00
Matthieu Riegler
a7dbb23bc8 refactor(compiler-cli): remove incrementalDriver on the compiler (#49869)
The CLI now only uses the `incrementalDriver` property.

PR Close #49869
2023-04-17 14:54:53 +00:00
Alex Rickabaugh
78c76cecf9 perf(compiler-cli): optimize NgModule emit for standalone components (#49837)
NgModules which import standalone components currently list those components
in their injector definitions, because we assume that any standalone
component may export providers from its own imports.

This commit adds an optimization for that emit, which attempts to statically
analyze the NgModule imports and determine which standalone components, if
any are present, do not export providers and thus can be omitted.

This analysis is imperfect, because some imported components may be declared
outside of the current compilation, or transitively import types which are
declared outside the compilation. These types are therefore _assumed_ to
carry providers and so the optimization isn't applied to them.

PR Close #49837
2023-04-17 14:51:58 +00:00
Andrew Scott
14b5a5d595 refactor(router): Do not access browserPageId if not computed resolution (#49850)
This commit avoids accessing the routerPageId if the
canceldNavigationResolution is not computed.

PR Close #49850
2023-04-17 14:47:16 +00:00
Alan Agius
3659e035f7 test: refactor platform-server tests to use async/await (#49855)
This commit changes the platform-server integration tests to use async/await instead of waitForAsync.

PR Close #49855
2023-04-17 14:07:34 +00:00
Matthieu Riegler
18e763709c refactor(common): Remove check for createShadowRoot (#49756)
`createShadowRoot` is not used since the drop of `ViewEncapsulation.Native` in v11 by #38882

PR Close #49756
2023-04-17 14:06:02 +00:00
Matthieu Riegler
288f2c8468 refactor(docs-infra): cleanup deprecated code (#49671)
This commit replaces (non material-related) deprecated code present in the aio app.

* `pageYOffset` can be replaced by `scrollY`
*  RxJs' `mapTo()` is just a `map()`
* `createNgModuleRef` can be replaced by `createNgModule`
* HttpEmits `ProgressEvent` not `ErrorEvent`  (see #34748)
* `SwUpdate.available` is replaced by  `versionUpdates` with a `filter`
* `SwUpdate.activated` is replaced by the returned promised of `SwUpdate.activateUpdate`.

PR Close #49671
2023-04-17 14:04:26 +00:00
Matthieu Riegler
f3366c60e1 refactor(core): improve styling coverage (#49868)
The test was waiting for #34202 to be merged.

PR Close #49868
2023-04-17 14:02:40 +00:00
Matthieu Riegler
8c0285b4af docs: remove outdated/unsupported webworker doc (#49856)
The webworker platform has been removed in v11 by #38846

PR Close #49856
2023-04-17 14:01:41 +00:00
Matthieu Riegler
f9886e1e28 refactor(docs-infra): remove dart support & mentions (#49857)
There is no need to keep the support for Dart here.

PR Close #49857
2023-04-17 14:00:49 +00:00
Qiuran Hu
ea4d9e8ef8 docs: fix typo in Hierarchical injectors doc (#49824)
PR Close #49824
2023-04-17 13:59:09 +00:00
ChrTall
fd0c26e430 docs: Fixed Typo (#49753)
Fixed Typo
PR Close #49753
2023-04-17 13:58:15 +00:00
Matthieu Riegler
bf2e11c035 refactor(core): throw an error when APP_INITIALIZER token is not an array. (#49860)
Providing a non-multi token for `APP_INITIALIZER` now throws `INVALID_MULTI_PROVIDER` (NG209)

PR Close #49860
2023-04-17 13:37:09 +00:00
Andrew Kushnir
d994f8520c fix(core): include inner ViewContainerRef anchor nodes into ViewRef.rootNodes output (#49867)
Currently, the `ViewRef.rootNodes` output is missing anchor (comment) nodes for inner `ViewContainerRef`s,
when an achor node was created for that instance of a `ViewContainerRef` (which happens in all cases except
when an <ng-container> was used as a host for a view container).

This issue affects hydration logic, which relies on the number of root nodes within a view to properly determine
segments in DOM that belong to a particular view.

Resolves #49849.

PR Close #49867
2023-04-17 13:35:58 +00:00
Andrew Kushnir
f37cb477a8 refactor(core): log hydration setup warning in dev mode only (#49876)
This commit updates the code to log hydration setup warning in dev mode only. Previously, the warning was retained in the code even after optimization, thus making it into production bundles. The warning is meant to let developers know that hydration was enabled, but wasn't activated, so it's safe to tree-shake it away from production bundles.

PR Close #49876
2023-04-17 13:34:53 +00:00
Andrew Kushnir
96a4e74069 refactor(platform-server): refactor internal _render function (#49851)
The change in 8c3b92cfb3 inspired a followup refactor where the `_render` method can just accept a PlatformRef and an ApplicationRef instances directly.

PR Close #49851
2023-04-17 13:34:00 +00:00
Angular Robot
3fcf8bd667 build: update actions/checkout digest to 8e5e7e5 (#49815)
See associated pull request for more information.

PR Close #49815
2023-04-17 13:31:19 +00:00
Alan Agius
8c3b92cfb3 refactor(platform-server): simplify _render method (#49840)
This commits simplifies the `_render` method by using async/await.

PR Close #49840
2023-04-14 15:28:41 -04:00
Alan Agius
9e9b424332 test(router): enable a subset of bootstrapping test to ran on node (#49843)
Some of these test can run on Node.js

PR Close #49843
2023-04-14 14:14:55 -04:00
Andrew Scott
cbca5817d8 fix(router): canceledNavigationResolution: 'computed' with redirects to the current URL (#49793)
The `canceledNavigationResolution: 'computed'` option does not correctly
assign page IDs or restore them when redirects result in navigating to
the current URL. This change ensures that the page IDs are still
incremented and restored correctly in this scenario.

PR Close #49793
2023-04-14 14:55:06 +00:00