Commit graph

29561 commits

Author SHA1 Message Date
Dylan Hunn
833cb8ef69 refactor(compiler): Enable additional tests for the template pipeline (#50899)
A number of tests were previously disabled, but are now passing with the latest changes.

PR Close #50899
2023-07-27 15:08:05 -07:00
Dylan Hunn
5a0ecdb58b refactor(compiler): Allow host binding functions to specialize bindings (#50899)
Interestingly, host bindings are parsed quite differently from template functions. For example, bindings such as `[style.foo]: 3px` would be parsed into a value, unit, and type when bound to a template, but will not be parsed as such when used in a host binding.

In this commit, we remedy this shortcoming by adding support for bindings in host binding functions to the template pipeline. In particular, we create a phase to process these bindings, and transform them into the correct output binding kind.

Additionally, we fix some other minor bugs and omissions.

Finally, we enable compilation of host bindings with the template pipeline, which requires us to turn off a number of failing tests.

PR Close #50899
2023-07-27 15:08:05 -07:00
Dylan Hunn
7652ec7b67 refactor(compiler): Allow host bindings to be ingested into the template pipeline. (#50899)
Alter the compiler code to ingest and process host bindings, using the newly updated compilation passes.

This is currently switched off in the outer compiler layer, but lays the foundation for actually generating the host binding functions using template pipeline.

PR Close #50899
2023-07-27 15:08:05 -07:00
Dylan Hunn
5ed8db2287 refactor(compiler): Refactor processing of bindings and interpolations. (#50899)
Today, bindings on templates are ingested in highly distinct ways, depending on the parsed binding kind, as well as special cases for `style` and `class`. This makes it very difficult to also ingest them for host bindings without duplicating all this subtle logic.

To solve this, we introduce two major related refactors:

1. Move all processing of attributes into phases. This dramatically reduces the amount of code in `ingest.ts`, which is now only responsible for ingesting an abstract `BindingOp`. The later phases replace each `BindingOp` with more specific ops for each binding kind. For example, `binding_specialization.ts` transforms each abstract `BindingOp` into a concrete `PropertyOp`, `AttributeOp`, etc. Likewise, `style_binding_specialization.ts` performs special-case transformations for style and class bindings. This approach has the additional advantage of separating the creation of attribute and property bindings from other special cases.

2. Eliminate all interpolation ops. Instead, allow the expression inside of an op to be of a new `Interpolation` type. The reify code will then emit the appropriate instruction variant (interpolated or unary).

3. Separate some concerns that were previously mixed in, such as empty bindings and listeners on templates.

These refactors cause major downstream code changes across the system, especially to attribute extraction and variable counting.

PR Close #50899
2023-07-27 15:08:05 -07:00
Dylan Hunn
30237d1751 refactor(compiler): Template pipeline: accept host bindings in additional phases (#50899)
Modify most of the remaining necessary phases to accept generic `CompilationJobs`. This includes `phasePureLiteralStructures`, `phaseNullishCoalescing`, `phaseExpandSafeReads`, `phaseVariableOptimization`, `phaseNaming`, and `phasePureFunctionExtraction`.

PR Close #50899
2023-07-27 15:08:05 -07:00
Dylan Hunn
8f67c0751d refactor(compiler): Prepare the template pipeline to support host bindings. (#50899)
Refactor `compilation.ts` by introducing two new concepts:
1. A compilation unit, which has create and update ops. Compilations of individual views are compilation units, as are individual host bindings.
2. Aa compilation job, which has several compilation units. For example, a whole component is a compilation job, because it can have many view compilation units. A host binding compilation is a job in addition to a unit, because each host binding unit is always a singleton.

Then, we begin modifying phases to accept general compilation jobs instead of component compilations specifically, which will allow us to run them on host bindings. In particular, we update the following phases: `phaseReify`, and `phaseChaining`.

PR Close #50899
2023-07-27 15:08:04 -07:00
Dylan Hunn
fe7de0dcea refactor(compiler): Compatibility mode for the template pipeline. (#50899)
Add a compatibility setting to the component compilation. Accordingly, remove all the custom compatibility flags passed to each phase, and use the main setting instead.

PR Close #50899
2023-07-27 15:08:04 -07:00
Dylan Hunn
31ff476060 refactor(compiler): Introduce source maps in the template pipeline. (#50899)
Begin producing source maps for the template pipeline, for a couple fundamental kinds of instructions, including elements, templates, properties, text, and interpolations.

PR Close #50899
2023-07-27 15:08:04 -07:00
Dylan Hunn
8a6a72e7cb refactor(compiler): Fix $event in listeners for template pipeline (#50899)
Previously, `$event` was interpreted as a lexical read on the enclosing context. Now, a new pass converts such reads into simple output AST reads of `$event`, so they are not processed by the context resolution or naming phases. Additionally, the same pass sets a field on the enclosing listener op, so that the reify phase does not have to search for reads of `$event`.

PR Close #50899
2023-07-27 15:08:04 -07:00
Dylan Hunn
c6010f0610 refactor(compiler): Support $any in template pipeline (#50899)
`$any(...)` casts should be dropped, except when they are an explicit call on `this.$any(...)`. Fix a bug in which we were transforming `ThisReceiver` into an implicit receiver.

PR Close #50899
2023-07-27 15:08:04 -07:00
Kristiyan Kostadinov
3a59de681f fix(devtools): ensure that inspected component label is always in the viewport (#50656)
Currently the label showing the component name is always positioned from the bottom/right edge of the element which may be outside of the viewport. These changes add some logic to fall back to a different position so that the label is always visible.

I've also cleaned the `highlighter.ts` file up a bit.

Fixes #48479.

PR Close #50656
2023-07-26 10:04:26 -07:00
sunilbaba
bb0f3bc125 docs(docs-infra): Adding required and Transform Args into the usage and documentation of input (#51173)
I# No commands remaining.

PR Close #51173
2023-07-26 10:03:41 -07:00
Sid
53aa35befc docs: improve readability, use future tense to indicate future events (#49578)
Summary of changes:
* change 'notice that' -> note that
* break large sentence to smaller ones to improve readability
* use future tense & modal verbs to indicate future events
PR Close #49578
2023-07-26 10:03:04 -07:00
abergquist
29a41031e1 docs: fixed grammar error in vulnerability reporting (#47326)
Split a run-on sentence into 2 sentences and improved link accessibility.
PR Close #47326
2023-07-26 10:01:29 -07:00
Andrew Kushnir
d9a4ca642d release: cut the v16.2.0-next.4 release 2023-07-26 09:11:32 -07:00
Andrew Kushnir
d2b7d76a50 docs: release notes for the v16.1.7 release 2023-07-26 09:05:18 -07:00
Joey Perrott
d6efd71278 ci: correct changed github action paths (#51168)
Change to the new paths to the github actions after dev-infra refactor

PR Close #51168
2023-07-25 10:48:47 -07:00
alkavats1
2c5e5e4970 docs: updated the tour of heroes doc file (#51151)
PR Close #51151
2023-07-25 10:24:52 -07:00
Matthieu Riegler
d886887360 refactor(core): Better use of Object.keys() (#51153)
Code cleaning arround the `Object.keys()` in the core tests.

PR Close #51153
2023-07-25 09:17:46 -07:00
hyperlife1119
29d358170b feat(common): add component input binding support for NgComponentOutlet (#51148)
This commit add component input binding support for NgComponentOutlet.

PR Close #51148
2023-07-25 09:16:19 -07:00
Matthieu Riegler
b5cf5d22e5 docs: remove orphan migration docs (#51147)
These docs are orphoned, no longer referenced anywhere in the docs, we can safery remove them.

PR Close #51147
2023-07-24 08:20:22 -07:00
alkavats1
8b32f89583 docs: updated the word in tutorial template (#51150)
PR Close #51150
2023-07-24 08:18:34 -07:00
Matthieu Riegler
daaa0a449b docs: remove trailing periods after @see (#51144)
This fixes a rendering issue where the periods would be bellow the text block.

PR Close #51144
2023-07-24 08:14:51 -07:00
Kristiyan Kostadinov
92ebfd1ca7 refactor(compiler): handle braces in block parameters (#51143)
Fixes that using braces in the block parameters would result in incorrect tokens being produced. Currently we don't have any blocks that allow object literal parameters, but it may come up in the future.

PR Close #51143
2023-07-24 08:13:51 -07:00
Angular Robot
27d43a4a7f build: lock file maintenance (#51134)
See associated pull request for more information.

PR Close #51134
2023-07-24 08:12:51 -07:00
Kevin Boss
4120a03805 docs: fix typos in first app tutorial (#51115)
PR Close #51115
2023-07-21 17:31:24 +00:00
Matthieu Riegler
0c9c825b14 docs: Add links to the injection context guide (#51129)
PR Close #51129
2023-07-21 16:46:42 +00:00
arturovt
57e8412e53 fix(http): check whether Zone is defined (#51119)
Accessing the `Zone` variable without checking if it's defined or not
leads to an error "Zone is not defined" if zone.js is not imported (nooped).
This commit adds an additional check before getting the current zone where
the `doRequest` is being called.

PR Close #51119
2023-07-21 16:45:26 +00:00
alkavats1
3106054c50 docs: updated the benchpress readme doc (#51110)
PR Close #51110
2023-07-21 16:43:30 +00:00
Angular Robot
189d60198a build: update cross-repo angular dependencies (#51132)
See associated pull request for more information.

PR Close #51132
2023-07-21 16:42:35 +00:00
Angular Robot
528fea7da1 build: update cross-repo angular dependencies (#51127)
See associated pull request for more information.

PR Close #51127
2023-07-21 14:12:58 +00:00
Angular Robot
39899fe250 build: update io_bazel_rules_sass digest to e2e30df (#51126)
See associated pull request for more information.

PR Close #51126
2023-07-21 14:11:33 +00:00
Matthieu Riegler
0413e5568b docs: remove the links to docs.angular.lat (#51117)
docs.angular.lat hasn't been updated in a while and is stuck at v10. Let's remove it.

Fixes #47644

PR Close #51117
2023-07-20 20:21:29 +00:00
Matthieu Riegler
33acf4f6ea docs(docs-infra): fix rendering of Exported from section on Firefox. (#51116)
On Firefox when an `a` element contains a `block` element, the `a` element is not aligned with the `li` marker.

Fixes #51112

PR Close #51116
2023-07-20 19:58:11 +00:00
Angular Robot
6fed684301 build: update github/codeql-action action to v2.21.0 (#51077)
See associated pull request for more information.

PR Close #51077
2023-07-20 19:57:22 +00:00
Angular Robot
d2e08a60f2 build: update dependency @types/convert-source-map to v2 (#51085)
See associated pull request for more information.

PR Close #51085
2023-07-20 19:56:54 +00:00
Matthieu Riegler
7092b21a11 build: Upgrade firebase-tools and puppeteer to fix transitive dependency vulnerability. (#51114)
`vm2` was pulled by `firebase-tools` < 12.4.5 and `puppeteer` < 20.8.2.

Fixes #51080

PR Close #51114
2023-07-20 19:55:52 +00:00
Jessica Janiuk
05657cfde4 release: cut the v16.2.0-next.3 release 2023-07-19 12:32:42 -07:00
Jessica Janiuk
16e132f31f docs: release notes for the v16.1.6 release 2023-07-19 12:14:38 -07:00
Jessica Janiuk
386cb2f18b Revert "docs: added the alt attribute in the img tag (#51102)" (#51107)
This reverts commit 3b248c59c6.

PR Close #51107
2023-07-19 18:48:59 +00:00
Simona Cotin
32e49f58fd docs: update v16.2 date (#51104)
PR Close #51104
2023-07-19 17:57:12 +00:00
Gerard Tyedmers
646292438a docs(docs-infra): fix wrong links in first-app-lesson-14.md (#51097)
docs(docs-infra): fix wrong links in first-app-lesson-14.md

in first-app-lesson-14.md, the links to starting code point to the wrong lesson 06 instead of lesson 13 and the links to completed code point to lesson 07 instead of lesson 14
PR Close #51097
2023-07-19 17:52:13 +00:00
alkavats1
551b2463de docs: updated the angular-compiler-option doc (#51095)
PR Close #51095
2023-07-19 17:44:04 +00:00
alkavats1
3b248c59c6 docs: added the alt attribute in the img tag (#51102)
PR Close #51102
2023-07-19 17:39:44 +00:00
Angular Robot
385adbbc53 build: update dependency core-js to v3 (#51099)
See associated pull request for more information.

PR Close #51099
2023-07-19 17:37:36 +00:00
Gerard Tyedmers
ddf1769f2b docs(docs-infra): fix wrong links in first-app-lesson-13.md (#51094)
docs(docs-infra): fix wrong links in first-app-lesson-13.md

in first-app-lesson-13.md, the links to starting code point to the wrong lesson 13 instead of lesson 12 and the links to completed code point to lesson 14 instead of lesson 13
PR Close #51094
2023-07-19 17:10:05 +00:00
Andrii Kurdiumov
8fb9db9dad docs: Fix path to sample (#51076)
PR Close #51076
2023-07-19 17:09:30 +00:00
Andrew Kushnir
24bf133eb6 refactor(compiler): add support for dynamic imports in the output AST (#51087)
This commit updates the output AST (and related visitors) to support dynamic imports. This functionality will be used later to generate the output for defer blocks.

PR Close #51087
2023-07-19 16:54:42 +00:00
Angular Robot
3ef81958db build: update dependency @types/systemjs to v6 (#51088)
See associated pull request for more information.

PR Close #51088
2023-07-19 14:37:01 +00:00
Angular Robot
dd43615202 build: update all non-major dependencies (#50994)
See associated pull request for more information.

PR Close #50994
2023-07-18 21:01:44 +00:00