@microsoft/fast-element 2.10.2 → 2.10.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ARCHITECTURE_FASTELEMENT.md +1 -1
- package/ARCHITECTURE_HTML_TAGGED_TEMPLATE_LITERAL.md +3 -1
- package/ARCHITECTURE_INTRO.md +1 -1
- package/ARCHITECTURE_OVERVIEW.md +1 -1
- package/CHANGELOG.json +108 -1
- package/CHANGELOG.md +10 -2
- package/DESIGN.md +506 -0
- package/biome.json +4 -0
- package/dist/context/context.api.json +17 -1
- package/dist/di/di.api.json +17 -1
- package/dist/dts/hydration/target-builder.d.ts +17 -1
- package/dist/dts/templating/html-binding-directive.d.ts +39 -4
- package/dist/dts/templating/html-directive.d.ts +7 -1
- package/dist/dts/templating/template.d.ts +19 -1
- package/dist/dts/templating/view.d.ts +11 -0
- package/dist/dts/tsdoc-metadata.json +1 -1
- package/dist/esm/components/hydration.js +17 -0
- package/dist/esm/hydration/target-builder.js +22 -1
- package/dist/esm/templating/compiler.js +29 -11
- package/dist/esm/templating/html-binding-directive.js +59 -4
- package/dist/esm/templating/html-directive.js +7 -1
- package/dist/esm/templating/install-hydratable-view-templates.js +6 -0
- package/dist/esm/templating/markup.js +8 -0
- package/dist/esm/templating/template.js +19 -1
- package/dist/esm/templating/view.js +13 -0
- package/dist/fast-element.api.json +20 -4
- package/dist/fast-element.debug.js +176 -227
- package/dist/fast-element.debug.min.js +2 -2
- package/dist/fast-element.js +176 -227
- package/dist/fast-element.min.js +2 -2
- package/dist/fast-element.untrimmed.d.ts +76 -6
- package/docs/api-report.api.md +3 -3
- package/package.json +7 -19
- package/tsconfig.api-extractor.json +6 -0
- package/.eslintrc.json +0 -19
- package/karma.conf.cjs +0 -148
|
@@ -42,7 +42,7 @@ flowchart TD
|
|
|
42
42
|
|
|
43
43
|
The rendering of the template on the `ElementController` is by the `renderTemplate` method which is called during the `ElementController.connect` method which is triggered by `HTMLElement`s `connectedCallback` lifecycle.
|
|
44
44
|
|
|
45
|
-
The `renderTemplate` identifies the Custom Element, and the shadow root associated with the Custom Element. This then places a rendering of the template (an `ElementView`) onto the internal `view` of the controller. When creating the `ElementView`/`HTMLView` using the `ViewTemplate.render`, the `
|
|
45
|
+
The `renderTemplate` identifies the Custom Element, and the shadow root associated with the Custom Element. This then places a rendering of the template (an `ElementView`) onto the internal `view` of the controller. When creating the `ElementView`/`HTMLView` using the `ViewTemplate.render`, the `Compiler.compile()` method identifies a `DocumentFragment` either by using an existing `<template>` tag, or creating one to wrap the contents of the shadow root. A new `CompilationContext` is created and the `compileAttributes` function is called, this results in the replacement of the placeholder attributes initally set-up during the pre-render step with their values if a value has been assigned. The factories with the associated nodes identified are then passed to the context. The view then binds all behaviors to the source element. The `CompilationContext.createView` is executed with the `DocumentFragment` as the root, and returns an `HTMLView`. This `HTMLView` includes an `appendTo` method to attach the fragment to the host element, which it then does. It should be noted that the compiled HTML is a `string`, which when set on the `DocumentFragment` as `innerHTML`, this allows the browser to dictate the creation of HTML nodes.
|
|
46
46
|
|
|
47
47
|
### 🔄 **Lifecycle**: Component is disconnected
|
|
48
48
|
|
|
@@ -6,10 +6,12 @@ The `html` export from `@microsoft/fast-element` is used to create the template
|
|
|
6
6
|
|
|
7
7
|
Before the template can be used it goes through a step to convert it into a `ViewTemplate` which it does via the `ViewTemplate.create()` method. This is then used during the `compose` step, before `FASTElement` is instantiated.
|
|
8
8
|
|
|
9
|
-
During the `
|
|
9
|
+
During the static `ViewTemplate.create()` method (called by the `html` tag), the following happens for each string:
|
|
10
10
|
- Factories with unique IDs are created for each tag template literal argument (or `TemplateValue`) which matches with the corresponding string
|
|
11
11
|
- A binding is created from the `TemplateValue`
|
|
12
12
|
|
|
13
|
+
The `Compiler.compile()` method is called lazily the first time the template is rendered (via `ViewTemplate.compile()`, which is triggered by `ViewTemplate.create()` instance method or `ViewTemplate.render()`).
|
|
14
|
+
|
|
13
15
|
A resulting string using a `createHTML()` function is produced using the `HTMLDirective`s executed for each factory. The behavior is augmented by the previous string from the `html` tag template which determines the aspect if one exists, these aspects are the `@`, `:`, or other binding aspect attached to attributes.
|
|
14
16
|
|
|
15
17
|
The `createHTML()` function utilizes a `Markup` attribute which is assigned to a factory's unique ID. The strings are concatenated and passed to a new `ViewTemplate` with all the factories (empty until one is assigned) that act as a dictionary with the unique IDs as the key to look up each factory once it has been created. The string this creates is injected into a `<template>` as `innerHTML`, which allows the browser to create the nodes and placeholder factory IDs, with the only `DOM` node that is explicitly created being the wrapping `<template>` element.
|
package/ARCHITECTURE_INTRO.md
CHANGED
|
@@ -6,5 +6,5 @@ This document (and the linked documents) explains how the exports and side effec
|
|
|
6
6
|
|
|
7
7
|
- [Overview](./ARCHITECTURE_OVERVIEW.md): How the `@microsoft/fast-element` should be used by a developer and what code is executed during the first render.
|
|
8
8
|
- [`FASTElement`](./ARCHITECTURE_FASTELEMENT.md): How the `FASTElement` is architected.
|
|
9
|
-
- [`html` tagged template literal](./ARCHITECTURE_HTML_TAGGED_TEMPLATE_LITERAL.md): How the `html` tagged template literal takes and converts the contents into a `
|
|
9
|
+
- [`html` tagged template literal](./ARCHITECTURE_HTML_TAGGED_TEMPLATE_LITERAL.md): How the `html` tagged template literal takes and converts the contents into a `ViewTemplate`.
|
|
10
10
|
- [`Updates` queue](./ARCHITECTURE_UPDATES.md): How updates to attributes and observables are processed.
|
package/ARCHITECTURE_OVERVIEW.md
CHANGED
|
@@ -39,7 +39,7 @@ flowchart TD
|
|
|
39
39
|
A --> B
|
|
40
40
|
C@{ shape: rect, label: "A Custom Element executes the <code>compose</code> step"}
|
|
41
41
|
B --> C
|
|
42
|
-
D@{ shape: procs, label: "<ul style=
|
|
42
|
+
D@{ shape: procs, label: "<ul style='text-align: left'><li>Any defined observable decorators are added to the FAST global</li><li>An attribute decorator locates the associated Custom Elements constructor which it uses to push itself to the Custom Elements attribute collection</li></ul>"}
|
|
43
43
|
C --> D
|
|
44
44
|
F@{ shape: rect, label: "An HTML tagged template literal is executed for the FAST Custom Element and applied to the definition" }
|
|
45
45
|
D --> F
|
package/CHANGELOG.json
CHANGED
|
@@ -2,7 +2,114 @@
|
|
|
2
2
|
"name": "@microsoft/fast-element",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "
|
|
5
|
+
"date": "Wed, 08 Apr 2026 00:19:52 GMT",
|
|
6
|
+
"version": "2.10.3",
|
|
7
|
+
"tag": "@microsoft/fast-element_v2.10.3",
|
|
8
|
+
"comments": {
|
|
9
|
+
"patch": [
|
|
10
|
+
{
|
|
11
|
+
"author": "863023+radium-v@users.noreply.github.com",
|
|
12
|
+
"package": "@microsoft/fast-element",
|
|
13
|
+
"commit": "e222ea1a8f0dfce91622f3b8504539c5fed1ddbd",
|
|
14
|
+
"comment": "fix: replace direct property access with Reflect.get for lazy getter resolution"
|
|
15
|
+
}
|
|
16
|
+
],
|
|
17
|
+
"none": [
|
|
18
|
+
{
|
|
19
|
+
"author": "7559015+janechu@users.noreply.github.com",
|
|
20
|
+
"package": "@microsoft/fast-element",
|
|
21
|
+
"commit": "72e9f0d675f7a08de40eff911fefb783d1c43b3a",
|
|
22
|
+
"comment": "chore: add DESIGN.md and fix architecture doc errors"
|
|
23
|
+
}
|
|
24
|
+
]
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"date": "Tue, 07 Apr 2026 00:50:48 GMT",
|
|
29
|
+
"version": "2.10.2",
|
|
30
|
+
"tag": "@microsoft/fast-element_v2.10.2",
|
|
31
|
+
"comments": {
|
|
32
|
+
"none": [
|
|
33
|
+
{
|
|
34
|
+
"author": "863023+radium-v@users.noreply.github.com",
|
|
35
|
+
"package": "@microsoft/fast-element",
|
|
36
|
+
"commit": "05ccb88f41eb44ec6cbe263335cc030de99f80a4",
|
|
37
|
+
"comment": "chore: add biome script to run biome on changed files in packages"
|
|
38
|
+
}
|
|
39
|
+
]
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"date": "Sat, 04 Apr 2026 00:22:26 GMT",
|
|
44
|
+
"version": "2.10.2",
|
|
45
|
+
"tag": "@microsoft/fast-element_v2.10.2",
|
|
46
|
+
"comments": {
|
|
47
|
+
"none": [
|
|
48
|
+
{
|
|
49
|
+
"author": "7559015+janechu@users.noreply.github.com",
|
|
50
|
+
"package": "@microsoft/fast-element",
|
|
51
|
+
"commit": "4371b6c6124feaec26dd51116cb6d777a6507a99",
|
|
52
|
+
"comment": "Add documentation on FAST templating"
|
|
53
|
+
}
|
|
54
|
+
]
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"date": "Thu, 26 Mar 2026 00:04:08 GMT",
|
|
59
|
+
"version": "2.10.2",
|
|
60
|
+
"tag": "@microsoft/fast-element_v2.10.2",
|
|
61
|
+
"comments": {
|
|
62
|
+
"none": [
|
|
63
|
+
{
|
|
64
|
+
"author": "863023+radium-v@users.noreply.github.com",
|
|
65
|
+
"package": "@microsoft/fast-element",
|
|
66
|
+
"commit": "6b0fd6c4a4b0c635d4e5c18d251b28abbf32bab5",
|
|
67
|
+
"comment": "chore: migrate to biome for linting and formatting"
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"author": "863023+radium-v@users.noreply.github.com",
|
|
71
|
+
"package": "@microsoft/fast-element",
|
|
72
|
+
"commit": "11227f6085b9aa2a3048c70427867a1f8d2f6873",
|
|
73
|
+
"comment": "chore: replace old clean script with new implementation"
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"author": "7559015+janechu@users.noreply.github.com",
|
|
77
|
+
"package": "@microsoft/fast-element",
|
|
78
|
+
"commit": "ea46496f56cd94cb0dae65b7026998c88604aaac",
|
|
79
|
+
"comment": "chore: fix publish blocker due to biome"
|
|
80
|
+
}
|
|
81
|
+
]
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"date": "Fri, 20 Mar 2026 00:07:36 GMT",
|
|
86
|
+
"version": "2.10.2",
|
|
87
|
+
"tag": "@microsoft/fast-element_v2.10.2",
|
|
88
|
+
"comments": {
|
|
89
|
+
"none": [
|
|
90
|
+
{
|
|
91
|
+
"author": "7559015+janechu@users.noreply.github.com",
|
|
92
|
+
"package": "@microsoft/fast-element",
|
|
93
|
+
"commit": "6df43be90d257a49389c188935400792b7108cc6",
|
|
94
|
+
"comment": "Split tests to assist in base PR build gate times"
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"author": "863023+radium-v@users.noreply.github.com",
|
|
98
|
+
"package": "@microsoft/fast-element",
|
|
99
|
+
"commit": "1dd81b899a21eb28ed7dd15bdf1c558196775c3e",
|
|
100
|
+
"comment": "chore: update dependencies and configurations"
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"author": "7559015+janechu@users.noreply.github.com",
|
|
104
|
+
"package": "@microsoft/fast-element",
|
|
105
|
+
"commit": "8f79bdbf1d7c3af827ca807347fc1134bbf45731",
|
|
106
|
+
"comment": "Remove karma/mocha/chai and related unused dependencies"
|
|
107
|
+
}
|
|
108
|
+
]
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
"date": "Fri, 13 Mar 2026 18:13:56 GMT",
|
|
6
113
|
"version": "2.10.2",
|
|
7
114
|
"tag": "@microsoft/fast-element_v2.10.2",
|
|
8
115
|
"comments": {
|
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
# Change Log - @microsoft/fast-element
|
|
2
2
|
|
|
3
|
-
<!-- This log was last generated on
|
|
3
|
+
<!-- This log was last generated on Wed, 08 Apr 2026 00:19:52 GMT and should not be manually modified. -->
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## 2.10.3
|
|
8
|
+
|
|
9
|
+
Wed, 08 Apr 2026 00:19:52 GMT
|
|
10
|
+
|
|
11
|
+
### Patches
|
|
12
|
+
|
|
13
|
+
- fix: replace direct property access with Reflect.get for lazy getter resolution (863023+radium-v@users.noreply.github.com)
|
|
14
|
+
|
|
7
15
|
## 2.10.2
|
|
8
16
|
|
|
9
|
-
Fri, 13 Mar 2026 18:
|
|
17
|
+
Fri, 13 Mar 2026 18:13:56 GMT
|
|
10
18
|
|
|
11
19
|
### Patches
|
|
12
20
|
|