-
Notifications
You must be signed in to change notification settings - Fork 601
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add default operations, enable user to add and run custom operations …
…5841 (#5921) * added update 10th test, moved all template generate logic to template.js, now just need to add one .ts file to run benchmark * add default tests * enable operations argument to run specified operations Co-authored-by: Wendy <[email protected]>
- Loading branch information
1 parent
75c4f80
commit 0e9f246
Showing
18 changed files
with
658 additions
and
295 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
Empty file.
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
10 changes: 0 additions & 10 deletions
10
packages/web-components/fast-benchmarks/benchmarks/fast-element/render/shared.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
47 changes: 47 additions & 0 deletions
47
packages/web-components/fast-benchmarks/benchmarks/fast-element/test/index.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,47 @@ | ||
import { | ||
attr, | ||
css, | ||
customElement, | ||
FASTElement, | ||
html, | ||
observable, | ||
repeat, | ||
} from "@microsoft/fast-element"; | ||
import { data, RandomItem } from "../../../utils/index.js"; | ||
|
||
@customElement({ | ||
name: "x-item", | ||
template: html<XItem>` | ||
<div @click="${x => x.onClick}" class="item"> | ||
${x => x.value} | ||
</div> | ||
`, | ||
styles: css` | ||
.item { | ||
display: flex; | ||
} | ||
`, | ||
}) | ||
class XItem extends FASTElement { | ||
@attr value: string | undefined; | ||
onClick(e: MouseEvent) { | ||
console.log(e.type); | ||
} | ||
} | ||
|
||
@customElement({ | ||
name: "x-app", | ||
template: html<XApp>` | ||
<div> | ||
${repeat( | ||
x => x.items, | ||
html` | ||
<x-item :value="${x => x.label}"></x-item> | ||
` | ||
)} | ||
</div> | ||
`, | ||
}) | ||
class XApp extends FASTElement { | ||
@observable items: RandomItem[] = data; | ||
} |
55 changes: 55 additions & 0 deletions
55
packages/web-components/fast-benchmarks/benchmarks/fast-element/test/index2.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,55 @@ | ||
import { | ||
attr, | ||
bind, | ||
css, | ||
customElement, | ||
FASTElement, | ||
html, | ||
oneTime, | ||
repeat, | ||
} from "@microsoft/fast-element"; | ||
import { data, RandomItem } from "../../../utils/index.js"; | ||
|
||
const xItemTemplate = html<XItem>` | ||
<div @click="${x => x.onClick}" class="item"> | ||
${x => x.value} | ||
</div> | ||
`; | ||
|
||
const styles = css` | ||
.item { | ||
display: flex; | ||
} | ||
`; | ||
@customElement({ | ||
name: "x-item", | ||
template: xItemTemplate, | ||
styles, | ||
}) | ||
class XItem extends FASTElement { | ||
@attr value: string | undefined; | ||
|
||
onClick(e: MouseEvent) { | ||
console.log(e.type); | ||
} | ||
} | ||
|
||
const xAppTemplate = html<XApp>` | ||
<div id="test-container"> | ||
${repeat( | ||
x => x.items, | ||
html<RandomItem>` | ||
<x-item | ||
:value="${bind((x: { label: string }) => x.label, oneTime)}" | ||
></x-item> | ||
` | ||
)} | ||
</div> | ||
`; | ||
@customElement({ | ||
name: "x-app", | ||
template: xAppTemplate, | ||
}) | ||
class XApp extends FASTElement { | ||
items: RandomItem[] = data; | ||
} |
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
Oops, something went wrong.