Commit 3af0ed5
authored
refactor: add template resolver pipeline (#7490)
# Pull Request
## 📖 Description
This draft lays the groundwork for definition-aware template resolution in `@microsoft/fast-element`.
- treat `PartialFASTElementDefinition.template` as either a concrete template or a function-based resolver
- apply FAST element extensions before template resolution and platform registration
- keep `FASTElementDefinition.template` concrete by resolving async templates before registration completes
- add focused Playwright coverage for async template resolution, concurrent define calls, and deferred registration behavior
## 👩💻 Reviewer Notes
This is the stack base for the declarative-template work. The main areas to review are the resolver API shape in `fast-definitions.ts` and the updated `FASTElement.define()` sequencing.
## 📑 Test Plan
- `npm run build:tsc -w @microsoft/fast-element`
- `npm run doc -w @microsoft/fast-element`
- `npx @biomejs/biome check --colors=off packages/fast-element/src/components/fast-definitions.pw.spec.ts packages/fast-element/src/components/fast-definitions.ts packages/fast-element/src/components/fast-element.pw.spec.ts packages/fast-element/src/components/fast-element.ts packages/fast-element/src/index.ts`
- `npm run checkchange`
- `npx playwright test src/components/fast-definitions.pw.spec.ts src/components/fast-element.pw.spec.ts --project=chromium`
## ✅ Checklist
### General
- [x] I have included a change request file using `$ npm run change`
- [x] I have added tests for my changes.
- [x] I have tested my changes.
- [x] I have updated the project documentation to reflect my changes.
- [x] I have read the [CONTRIBUTING](https://github.com/microsoft/fast/blob/main/CONTRIBUTING.md) documentation and followed the [standards](https://github.com/microsoft/fast/blob/main/CODE_OF_CONDUCT.md#our-standards) for this project.
## ⏭ Next Steps
Follow-up draft PRs will build the declarative `<f-template>` publication path, add `declarativeTemplate()`, and then remove the remaining `sideEffects` metadata.1 parent 4656c46 commit 3af0ed5
65 files changed
Lines changed: 962 additions & 389 deletions
File tree
- change
- packages/fast-element
- docs
- src
- components
- declarative
- test/declarative/fixtures
- bindings
- attribute
- content
- dot-syntax
- event
- host
- directives
- children
- ref
- repeat
- slotted
- when
- ecosystem
- lifecycle-callbacks
- performance-metrics
- extensions
- attribute-map-naming-strategy-camel-case
- attribute-map-naming-strategy
- attribute-map
- observer-map-config-object
- observer-map-deep-merge
- observer-map-properties
- observer-map
- scenarios/nested-elements
- sites
- benchmarks/src/scenarios
- all/hydration
- attr-reflect/hydration
- bind-event/hydration
- dot-syntax
- csr
- hydration
- ref-slotted/hydration
- repeat/hydration
- when/hydration
- website/src/docs/3.x
- api
- resources
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
533 | 533 | | |
534 | 534 | | |
535 | 535 | | |
536 | | - | |
| 536 | + | |
537 | 537 | | |
538 | | - | |
| 538 | + | |
539 | 539 | | |
540 | 540 | | |
541 | 541 | | |
542 | 542 | | |
543 | 543 | | |
544 | | - | |
| 544 | + | |
545 | 545 | | |
546 | 546 | | |
547 | 547 | | |
548 | 548 | | |
549 | 549 | | |
550 | | - | |
| 550 | + | |
551 | 551 | | |
552 | 552 | | |
553 | 553 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
24 | | - | |
| 23 | + | |
| 24 | + | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
94 | | - | |
95 | 94 | | |
96 | 95 | | |
97 | 96 | | |
98 | | - | |
| 97 | + | |
99 | 98 | | |
100 | 99 | | |
101 | 100 | | |
| |||
Lines changed: 16 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
17 | | - | |
18 | | - | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
| 42 | + | |
| 43 | + | |
43 | 44 | | |
44 | 45 | | |
45 | 46 | | |
46 | 47 | | |
47 | 48 | | |
48 | 49 | | |
49 | 50 | | |
50 | | - | |
| 51 | + | |
51 | 52 | | |
52 | 53 | | |
53 | 54 | | |
54 | 55 | | |
55 | 56 | | |
56 | 57 | | |
57 | | - | |
58 | | - | |
| 58 | + | |
| 59 | + | |
59 | 60 | | |
60 | 61 | | |
61 | 62 | | |
| |||
82 | 83 | | |
83 | 84 | | |
84 | 85 | | |
85 | | - | |
| 86 | + | |
86 | 87 | | |
87 | | - | |
| 88 | + | |
| 89 | + | |
88 | 90 | | |
89 | | - | |
90 | | - | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
91 | 94 | | |
92 | 95 | | |
93 | 96 | | |
94 | 97 | | |
95 | 98 | | |
96 | 99 | | |
97 | 100 | | |
98 | | - | |
| 101 | + | |
99 | 102 | | |
100 | 103 | | |
101 | 104 | | |
| |||
123 | 126 | | |
124 | 127 | | |
125 | 128 | | |
126 | | - | |
| 129 | + | |
127 | 130 | | |
128 | 131 | | |
129 | 132 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
97 | | - | |
| 97 | + | |
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
106 | | - | |
| 106 | + | |
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
110 | | - | |
| 110 | + | |
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
| |||
375 | 375 | | |
376 | 376 | | |
377 | 377 | | |
378 | | - | |
379 | | - | |
380 | | - | |
| 378 | + | |
381 | 379 | | |
382 | 380 | | |
383 | 381 | | |
| |||
499 | 497 | | |
500 | 498 | | |
501 | 499 | | |
502 | | - | |
| 500 | + | |
503 | 501 | | |
504 | 502 | | |
505 | 503 | | |
| |||
550 | 548 | | |
551 | 549 | | |
552 | 550 | | |
553 | | - | |
| 551 | + | |
554 | 552 | | |
555 | 553 | | |
556 | 554 | | |
| |||
0 commit comments