-
Notifications
You must be signed in to change notification settings - Fork 27k
Add support for spread syntax in templates #66213
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| return this.sharedConstants.get(key)!; | ||
| } | ||
|
|
||
| getLiteralFactory(literal: o.LiteralArrayExpr | o.LiteralMapExpr): { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method was unused so I deleted it and the related utilities.
9b830e5 to
016638e
Compare
JeanMeche
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Beside the nit, LGTM 🚀
|
|
||
| do { | ||
| positionals.push(this.parsePipe()); | ||
| positionals.push(this.next.isOperator('...') ? this.parseSpreadElement() : this.parsePipe()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: should we create a custom method isSpearOperator ?
Updates the expression lexer to handle spread operators.
Updates the output AST to account for spread elements.
Updates the linker to account for spread assignments in object literals.
Updates the expression AST to have support for spread elements inside object literals.
Adds support for spread expressions inside of object literals. This can be handy when constructing maps for `class` bindings.
Adds the ability to generate spread elements in the linker.
Adds spread elements to the output AST which can be used in arrays and function calls.
Updates the expression AST to support spread elements that will be used for arrays and function calls.
Expands the template syntax to support spread elements inside arrays. This can be handy for some bindings.
016638e to
4e50304
Compare
Updates the template syntax to support rest arguments in function calls. This can be handy for functions with a variable number of arguments.
4e50304 to
355588a
Compare
|
This PR was merged into the repository. The changes were merged into the following branches:
|
Adds support for spread/rest syntax in the following places in the template syntax:
{a: 1, ...foo}.[1, ...foo].fn(1, ...foo).For arrays and object literals the spread arguments integrate into the existing pure function infrastructure in order to avoid re-creating the object on each change detection.
Fixes #11850.
Fixes #61800.
Note: I took a couple of commits from #66206 and #66190 to avoid conflicts.