Commit Graph

10143 Commits

Author SHA1 Message Date
Paul Gschwendtner ccf0dc1884 test: add test to ensure variable bindings work 2023-07-14 13:12:38 +00:00
Paul Gschwendtner ebf646a9c9 fixup! WIP: generate propertyCreate instructions in template pipeline
Fix expression lexical read transforms
2023-07-14 13:12:38 +00:00
Paul Gschwendtner 732e45a730 WIP: prepare tests for failing scenarios discovered during collab
* Local refs needs more testing
* Basic variable read failed
* We do not have any tests for listeners? there was some restore view
  issue: https://github.com/angular/angular/commit/3acfdf4861d5eeed5b2ad42978547da929cc3567
2023-07-14 13:12:38 +00:00
Pawel Kozlowski 399e173d8c fix(core): properly bind to the same input from multiple views
Before this fix bindings to the same input from multiple LViews didn't
work properly as the binding expression was assigned to LView only on
the first create pass (instead of assigning on each durective usage pass).
2023-07-14 13:12:38 +00:00
Alex Rickabaugh 05ecc619fc wip: allocate vars for PropertyCreateOp
This commit adds the `ConsumesVarsTrait` to `PropertyCreateOp` which causes
vars to be counted for use in the virtual instructions it might add. This
allows the DOM test to pass.
2023-07-14 13:12:38 +00:00
Pawel Kozlowski 52f508ab4d test: failing test case for non-primitive literals in a template 2023-07-14 13:12:38 +00:00
Pawel Kozlowski 2a61fea64b test: add test veryfing bindings to multiple directives 2023-07-14 13:12:38 +00:00
Pawel Kozlowski 10c1ae5b6e test: add failing test for dom property bindings
The test is skipped as we are not propagating number of vars
based on the bindings found in a template.
2023-07-14 13:12:38 +00:00
Pawel Kozlowski 9208e64e74 test: re-organize tests 2023-07-14 13:12:38 +00:00
JoostK 65d45e4919 test: add test to bind a signal to a signal input 2023-07-14 13:12:38 +00:00
JoostK 080bdfa77f test: allow signal component test to pass 2023-07-14 13:12:38 +00:00
Alex Rickabaugh 977bd97717 refactor(compiler): only reference a view via a variable if it's not ctx
Previously the template pipeline would prefer to use a local variable
definition in favor of ctx. This commit improves the logic to prefer `ctx`
for the root view even if a variable for the context is available.
2023-07-14 13:12:38 +00:00
Alex Rickabaugh a90dc4310c wip: bypass pure functions in input computations 2023-07-14 13:12:38 +00:00
Alex Rickabaugh 2426b2e1f1 wip: fix signals test
(required and initial values for inputs are mutually incompatible)
2023-07-14 13:12:38 +00:00
Alex Rickabaugh 912c7252f8 wip: switch to the real input() implementation 2023-07-14 13:12:38 +00:00
Paul Gschwendtner 8e64d9e1d8 refactor: fix lint warnings 2023-07-14 13:12:38 +00:00
Paul Gschwendtner 4d7b23e99e refactor: wire up propertyCreate instruction for JIT generation 2023-07-14 13:12:38 +00:00
Paul Gschwendtner 59d278c07c WIP: setup template pipeline acceptance tests on CI and base setup 2023-07-14 13:12:38 +00:00
Pawel Kozlowski 7e1de8cb6a refactor: making CI green-ish
Would be great to keep CI green, making changes in this direction.
2023-07-14 13:12:37 +00:00
Alex Rickabaugh f6bda0eb4d wip: working signal input and all 3 binding types 2023-07-14 13:12:37 +00:00
Alex Rickabaugh c7c4b9e390 wip: specialize virtual instructions
* splits propertyCreate virtual instructions into DOM vs zone inputs
* integrates with `InputSignal` setting (untested)
* deletes old interfaces/virtual_property impl in favor of Paul's
2023-07-14 13:12:37 +00:00
Alex Rickabaugh a77924ff38 input signals 2023-07-14 13:12:37 +00:00
Paul Gschwendtner d04408d67d fixup! WIP: create new instruction "propertyCreate"
More work
2023-07-14 13:12:37 +00:00
Paul Gschwendtner f556b29d05 fixup! WIP: generate propertyCreate instructions in template pipeline
More work
2023-07-14 13:12:37 +00:00
Paul Gschwendtner a9be2b3628 Fix that signals: true views are never running update mode 2023-07-14 13:12:37 +00:00
Paul Gschwendtner a34a479ee5 WIP: generate propertyCreate instructions in template pipeline 2023-07-14 13:12:35 +00:00
Paul Gschwendtner f0c9eeceba WIP: create new instruction "propertyCreate" 2023-07-14 13:11:53 +00:00
Paul Gschwendtner e737d45ad0 WIP: setup http server for test app to test runtime 2023-07-14 13:11:53 +00:00
Paul Gschwendtner c7bede629b WIP: type checking for signal inputs 2023-07-14 13:11:53 +00:00
Paul Gschwendtner 992f51bc6d WIP: Discover input class members in directive shared code. No type-chechking yet. 2023-07-14 13:11:53 +00:00
Paul Gschwendtner f2658e34a2 WIP: implementation of input function signature 2023-07-14 13:11:53 +00:00
Paul Gschwendtner 89813aea70 WIP: initial input function and test app 2023-07-14 13:11:53 +00:00
Alex Rickabaugh e6e5021eb9 wip: basic proof of concept for virtual instructions 2023-07-14 13:11:53 +00:00
Matthieu Riegler b8107b1914 refactor(common): remove supportScrollRestoration (#50056)
`scrollRestoration` is supported across all everygreen browsers we can remove the testing method.

PR Close #50056
2023-07-13 09:42:05 -07:00
Payam Valadkhan 3b78d068ea refactor(compiler-cli): basic local compilation for components (#50545)
A minimal change to full compilation mode to work in local mode. Now compiler can compile components without ctor injections, though the compiled code missing the following items which will be added in subsequent commits:
* it does not produce `dependencies` for component definition.
* it fails if component has ctor injection

PR Close #50545
2023-07-13 09:34:53 -07:00
Payam Valadkhan 68fd99fad3 refactor(compiler-cli): Trait compiler workflow for local compilation mode (#50545)
The compiler will only include analysis and compile phases in local mode. Also a new `compileLocal` method is added to the annotation handler for local compilation.

This commit makes no change to the full/partial compilation code paths.

PR Close #50545
2023-07-13 09:34:53 -07:00
Kristiyan Kostadinov b14a78ebb0 refactor(compiler): implement block syntax in html ast (#50953)
⚠️Disclaimer⚠️ this PR implements syntax that is still in an open RFC. It will be adjusted once the RFC is closed.

These changes implement the `BlockGroup` and `Block` AST nodes that will then be used to generate instructions based on the new syntax. A `BlockGroup` is a container for `Block` instances. The first block of a block is always implicit and required while any subsequent blocks are optional.

PR Close #50953
2023-07-13 09:32:53 -07:00
Charles Lyding 5bd530ab32 refactor(compiler-cli): add internal compiler option to control NgModule selector scope emit (#51007)
An internal compiler option named `supportJitMode` is now available for use by the Angular CLI.
This option currently controls the emit of NgModule selector scope information. This emitted
information is only needed in AOT mode when an application also uses JIT. However, AOT mode
combined with JIT mode is not currently supported nor will work in the Angular CLI. With
the Angular CLI, JIT mode is only supported if the entire application is built in JIT mode.
Without this option, the CLI needs to manually perform a code transform to remove the information
and also replicate TypeScript's import eliding. This is can be a complicated operation and must
be continually kept up to date with any changes to both the Angular compiler and TypeScript.
The introduction of this new option alleviates these concerns while also removing several build
time actions that would otherwise need to be performed on every application build.

PR Close #51007
2023-07-13 09:32:11 -07:00
Alan Agius f1b629961f perf(platform-browser): do not remove renderer from cache when REMOVE_STYLES_ON_COMPONENT_DESTROY is enabled. (#51005)
Removing the renderer from cache is not needed when `REMOVE_STYLES_ON_COMPONENT_DESTROY` is enabled. This change retains the behaviour of keeping the renderer cached for the entire lifecycle of the application the same way it is done when `REMOVE_STYLES_ON_COMPONENT_DESTROY` is disabled.

This seems to have be causing an increase in scripting. See: http://b/290666638

PR Close #51005
2023-07-11 10:11:51 -07:00
Alex Castle 1837efb9da feat(common): Allow ngSrc to be changed post-init (#50683)
Remove thrown error when ngSrc is modified after an NgOptimizedImage image is initialized

PR Close #50683
2023-07-11 08:30:49 -07:00
Daniel Puckowski c27a1e61d6 feat(compiler): scope selectors in @scope queries (#50747)
make sure selectors inside @scope queries are correctly scoped

PR Close #50747
2023-07-11 08:29:53 -07:00
Matthieu Riegler 3dafc14e84 refactor(core): Log a warning when multiple pipes match a name (#50389)
Since this might be too breaking, let's log for now and wait for a major to throw an actual error.

Fixes #13569

PR Close #50389
2023-07-11 08:29:07 -07:00
Antonio Pekeljevic 1ec2aa902d docs: add missing jsdocs for static ngzone methods (#50924)
PR Close #50924
2023-07-11 08:28:38 -07:00
Matthieu Riegler a14bdfe859 fix(animations): Ensure elements are removed from the cache after leave animation. (#50929)
This commit fixes a memory leak.

`_namespaceLookup` was cleared before the call to `processLeaveNode()` which was using the lookup.
Without that lookup `clearElementCache()` wasn't called thus keeping a reference to the element.

Fixes #24197 & #50533

PR Close #50929
2023-07-11 08:28:10 -07:00
Matthieu Riegler 253d756464 fix(upgrade): Use takeUntil on leaky subscription. (#50901)
Using the life cycling hook `onDestroy` to end the subscription.

fixes #48032

PR Close #50901
2023-07-11 08:24:30 -07:00
Dzhavat Ushev 8bb6b7ddb5 docs: add missing backtick character (#50908)
PR Close #50908
2023-07-11 08:23:48 -07:00
Matthieu Riegler 61be62d621 refactor(core): fix Tnode/TView assertion. (#50914)
The debug data structure was removed in #48281. Before this fix the assertion relied on it.

PR Close #50914
2023-07-11 08:23:18 -07:00
Matthieu Riegler 5d6ec0336b fix(core): handle deref returning null on RefactiveNode. (#50992)
On Safari <16.1 there is a bug where `deref` can return `null`.

Fixes #50989

PR Close #50992
2023-07-11 08:22:47 -07:00
Kristiyan Kostadinov 29aaded0c3 refactor(compiler): introduce block parsing in lexer (#50895)
⚠️Disclaimer⚠️ this PR implements syntax that is still in an open RFC. It will be adjusted once the RFC is closed.

These changes extend the lexer to recognize the concepts of a block group (`{#foo paramA; paramB}{/foo}`) and a block (`{:foo paramA; paramB;}`) which will be useful later on for the control flow and defer proposals. Block groups can be used anywhere and require a closing tag while block can only be used inside of a block.

The idea is that in the next PRs the markup AST will be expanded to have some more specialized node like `ConditionalBlock` or `DeferBlock` which will then be turned into instructions.

PR Close #50895
2023-07-11 08:21:48 -07:00
Dylan Hunn 875851776c refactor(compiler): Generate attribute and attributeInterpolate instructions in template pipeline (#50818)
This commit adds the ability to generate attribute instructions as a result of property bindings such as `[attr.foo]='bar'` or `attr.foo='{{bar}}'`. "Singleton" interpolations, such as the previous example, will also be transformed into a simple `attribute` instruction.

PR Close #50818
2023-07-10 07:17:18 -07:00