-
Notifications
You must be signed in to change notification settings - Fork 643
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: transform for binding syntax (#2271)
- Loading branch information
Showing
20 changed files
with
194 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
export const taglibs: any; | ||
export const optionalTaglibs: any; | ||
export const analyze: any; | ||
export const transform: any; | ||
export const translate: any; | ||
export const getRuntimeEntryFiles: any; | ||
export const internalEntryBuilder: any; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
..._tests__/fixtures/error-let-invalid-binding/__snapshots__/dom.expected/template.error.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
|
||
at packages/translator-tags/src/__tests__/fixtures/error-let-invalid-binding/template.marko:1:11 | ||
> 1 | <let/count:=1/> | ||
| ^^^ Attributes may only be bound to identifiers or member expressions | ||
2 | |
5 changes: 5 additions & 0 deletions
5
...tests__/fixtures/error-let-invalid-binding/__snapshots__/html.expected/template.error.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
|
||
at packages/translator-tags/src/__tests__/fixtures/error-let-invalid-binding/template.marko:1:11 | ||
> 1 | <let/count:=1/> | ||
| ^^^ Attributes may only be bound to identifiers or member expressions | ||
2 | |
1 change: 1 addition & 0 deletions
1
packages/translator-tags/src/__tests__/fixtures/error-let-invalid-binding/template.marko
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<let/count:=1/> |
1 change: 1 addition & 0 deletions
1
packages/translator-tags/src/__tests__/fixtures/error-let-invalid-binding/test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export const error_compiler = true; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
.../src/__tests__/fixtures/let-tag-controllable-child/__snapshots__/dom.expected/template.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,5 +3,8 @@ | |
<button> | ||
1|1 | ||
</button> | ||
<button> | ||
1|1 | ||
</button> | ||
source=1 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 6 additions & 1 deletion
7
.../translator-tags/src/__tests__/fixtures/let-tag-controllable-child/components/child.marko
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,9 @@ | ||
<let/state=input.value valueChange=input.valueChange/> | ||
<let/state:=input.value/> | ||
<button onClick() { state++; }> | ||
${input.value}|${state} | ||
</button> | ||
|
||
<let/otherState:=input["value"]/> | ||
<button onClick() { otherState++; }> | ||
${input.value}|${otherState} | ||
</button> |
4 changes: 1 addition & 3 deletions
4
packages/translator-tags/src/__tests__/fixtures/let-tag-controllable-child/template.marko
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
<let/source=1/> | ||
<child value=source valueChange(newValue) { | ||
source = newValue; | ||
} /> | ||
<child value:=source /> | ||
-- source=${source} |
2 changes: 1 addition & 1 deletion
2
packages/translator-tags/src/__tests__/fixtures/let-tag-controllable-child/test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
export const steps = [{}, click, click, click]; | ||
|
||
function click(container: Element) { | ||
container.querySelector("button")!.click(); | ||
container.querySelectorAll("button")!.forEach((item) => item.click()); | ||
} | ||
|
||
export const skip_resume = true; |
Oops, something went wrong.