Skip to content

Commit c31bc76

Browse files
janechuCopilot
andcommitted
build(fast-html): add entry/templates/state files for attribute-map fixture
Split the hand-written index.html into entry.html, templates.html, and state.json to match the pattern used by all other fixtures. Add attribute-map to the build-fixtures.js list so index.html is generated by npm run build:fixtures with SSR-rendered shadow DOM. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 7e0da86 commit c31bc76

File tree

5 files changed

+55
-17
lines changed

5 files changed

+55
-17
lines changed

packages/fast-html/scripts/build-fixtures.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ const fixtures = [
2424
"nested-elements",
2525
"performance-metrics",
2626
"observer-map",
27+
"attribute-map",
2728
];
2829

2930
const __dirname = dirname(fileURLToPath(import.meta.url));
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<!DOCTYPE html>
2+
<html lang="en-US">
3+
<head>
4+
<meta charset="utf-8">
5+
<title></title>
6+
</head>
7+
<body>
8+
<attribute-map-test-element id="test-element"></attribute-map-test-element>
9+
<attribute-map-existing-attr-test-element
10+
id="existing-attr-test-element"
11+
></attribute-map-existing-attr-test-element>
12+
<script type="module" src="./main.ts"></script>
13+
</body>
14+
</html>

packages/fast-html/test/fixtures/attribute-map/index.html

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,29 @@
33
<head>
44
<meta charset="utf-8">
55
<title></title>
6-
<script type="module" src="./main.ts"></script>
76
</head>
87
<body>
9-
<attribute-map-test-element id="test-element"></attribute-map-test-element>
10-
<f-template name="attribute-map-test-element">
11-
<template>
12-
<div class="foo-value">{{ foo }}</div>
13-
<div class="foo-bar-value">{{ foo-bar }}</div>
14-
<button type="button" @click="{setFoo()}">Set Foo</button>
15-
<button type="button" @click="{setFooBar()}">Set FooBar</button>
16-
<button type="button" @click="{setMultiple()}">Set Multiple</button>
17-
</template>
18-
</f-template>
19-
<attribute-map-existing-attr-test-element
20-
id="existing-attr-test-element"
21-
></attribute-map-existing-attr-test-element>
22-
<f-template name="attribute-map-existing-attr-test-element">
23-
<template> <div class="existing-foo-value">{{ foo }}</div> </template>
24-
</f-template>
8+
<attribute-map-test-element id="test-element"><template shadowrootmode="open" shadowroot="open"><div class="foo-value"><!--fe-b$$start$$0$$foo-0$$fe-b--><!--fe-b$$end$$0$$foo-0$$fe-b--></div>
9+
<div class="foo-bar-value"><!--fe-b$$start$$1$$foo-bar-1$$fe-b--><!--fe-b$$end$$1$$foo-bar-1$$fe-b--></div>
10+
<button type="button" data-fe-c-2-1>Set Foo</button>
11+
<button type="button" data-fe-c-3-1>Set FooBar</button>
12+
<button type="button" data-fe-c-4-1>Set Multiple</button></template></attribute-map-test-element>
13+
<attribute-map-existing-attr-test-element id="existing-attr-test-element"><template shadowrootmode="open" shadowroot="open"><div class="existing-foo-value"><!--fe-b$$start$$0$$foo-0$$fe-b--><!--fe-b$$end$$0$$foo-0$$fe-b--></div></template></attribute-map-existing-attr-test-element>
14+
<f-template name="attribute-map-test-element">
15+
<template>
16+
<div class="foo-value">{{foo}}</div>
17+
<div class="foo-bar-value">{{foo-bar}}</div>
18+
<button type="button" @click="{setFoo()}">Set Foo</button>
19+
<button type="button" @click="{setFooBar()}">Set FooBar</button>
20+
<button type="button" @click="{setMultiple()}">Set Multiple</button>
21+
</template>
22+
</f-template>
23+
<f-template name="attribute-map-existing-attr-test-element">
24+
<template>
25+
<div class="existing-foo-value">{{foo}}</div>
26+
</template>
27+
</f-template>
28+
29+
<script type="module" src="./main.ts"></script>
2530
</body>
2631
</html>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"foo": "",
3+
"foo-bar": ""
4+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<f-template name="attribute-map-test-element">
2+
<template>
3+
<div class="foo-value">{{foo}}</div>
4+
<div class="foo-bar-value">{{foo-bar}}</div>
5+
<button type="button" @click="{setFoo()}">Set Foo</button>
6+
<button type="button" @click="{setFooBar()}">Set FooBar</button>
7+
<button type="button" @click="{setMultiple()}">Set Multiple</button>
8+
</template>
9+
</f-template>
10+
<f-template name="attribute-map-existing-attr-test-element">
11+
<template>
12+
<div class="existing-foo-value">{{foo}}</div>
13+
</template>
14+
</f-template>

0 commit comments

Comments
 (0)