-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: cached values inside attribute tags
- Loading branch information
1 parent
e982500
commit 97ec7db
Showing
7 changed files
with
111 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@marko/tags-api-preview": patch | ||
--- | ||
|
||
Fix issue with cached values inside attribute tags. |
18 changes: 18 additions & 0 deletions
18
...es/misc/attribute-tags/__snapshots__/misc-attribute-tags/single/node.render.expected.html
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,18 @@ | ||
<div | ||
data-key="hello" | ||
name="Frank" | ||
> | ||
Hello Frank! | ||
</div> | ||
<div | ||
data-key="hello" | ||
name="Frank" | ||
> | ||
Hello Frank! | ||
</div> | ||
<div | ||
data-key="hello" | ||
name="John" | ||
> | ||
Hello John! | ||
</div> |
18 changes: 18 additions & 0 deletions
18
...res/misc/attribute-tags/__snapshots__/misc-attribute-tags/single/web.render.expected.html
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,18 @@ | ||
<div | ||
data-key="hello" | ||
name="Frank" | ||
> | ||
Hello Frank! | ||
</div> | ||
<div | ||
data-key="hello" | ||
name="Frank" | ||
> | ||
Hello Frank! | ||
</div> | ||
<div | ||
data-key="hello" | ||
name="John" | ||
> | ||
Hello John! | ||
</div> |
17 changes: 17 additions & 0 deletions
17
src/__tests__/fixtures/misc/attribute-tags/components/test.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,17 @@ | ||
<!-- use tags --> | ||
<for|key, value| in=input> | ||
<if=value> | ||
<if=Array.isArray(value)> | ||
<for|item| of=value> | ||
<div data-key=key ...item> | ||
<${item}/> | ||
</div> | ||
</for> | ||
</if> | ||
<else> | ||
<div data-key=key ...value> | ||
<${value}/> | ||
</div> | ||
</else> | ||
</if> | ||
</for> |
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 @@ | ||
import fixture from "../../../fixture"; | ||
|
||
describe("misc attribute tags", () => { | ||
describe("single", fixture("./templates/single.marko")); | ||
}); |
17 changes: 17 additions & 0 deletions
17
src/__tests__/fixtures/misc/attribute-tags/templates/single.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,17 @@ | ||
<!-- use tags --> | ||
<test> | ||
<@hello name="Frank" onClick() { | ||
console.log('Hello Frank!'); | ||
}> | ||
Hello Frank! | ||
</@hello> | ||
</test> | ||
<test> | ||
<for|name| of=["Frank", "John"]> | ||
<@hello name=name onClick() { | ||
console.log('Hello ' + name + '!'); | ||
}> | ||
Hello ${name}! | ||
</@hello> | ||
</for> | ||
</test> |
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