@microsoft/fast-element 3.0.0-rc.1 → 3.0.0-rc.2
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/CHANGELOG.md +51 -1
- package/README.md +50 -14
- package/dist/context/context.api.json +13 -13
- package/dist/declarative/declarative.api.json +654 -15
- package/dist/di/di.api.json +15 -15
- package/dist/dts/__test__/helpers.d.ts +6 -0
- package/dist/dts/__test__/setup-node.d.ts +0 -0
- package/dist/dts/binding/binding.d.ts +15 -5
- package/dist/dts/binding/one-time.d.ts +1 -1
- package/dist/dts/binding/one-way.d.ts +1 -1
- package/dist/dts/binding/signal.d.ts +1 -1
- package/dist/dts/binding/two-way.d.ts +1 -1
- package/dist/dts/components/attributes.d.ts +1 -1
- package/dist/dts/components/enable-hydration.d.ts +22 -2
- package/dist/dts/components/fast-definitions.d.ts +7 -4
- package/dist/dts/components/fast-element.d.ts +42 -12
- package/dist/dts/components/hydration-tracker.d.ts +47 -4
- package/dist/dts/components/hydration.d.ts +5 -0
- package/dist/dts/context.d.ts +7 -7
- package/dist/dts/declarative/debug.d.ts +2 -3
- package/dist/dts/declarative/index.d.ts +3 -2
- package/dist/dts/declarative/interfaces.d.ts +1 -2
- package/dist/dts/declarative/template.d.ts +2 -1
- package/dist/dts/declarative/utilities.d.ts +50 -4
- package/dist/dts/di/di.d.ts +6 -6
- package/dist/dts/dom-policy.d.ts +22 -4
- package/dist/dts/dom.d.ts +4 -16
- package/dist/dts/hydration/diagnostics.d.ts +93 -0
- package/dist/dts/hydration/hydration-debugger.d.ts +35 -0
- package/dist/dts/hydration/messages.d.ts +62 -0
- package/dist/dts/hydration/target-builder.d.ts +26 -1
- package/dist/dts/hydration.d.ts +7 -3
- package/dist/dts/index.d.ts +7 -3
- package/dist/dts/interfaces.d.ts +1 -0
- package/dist/dts/observation/observable.d.ts +3 -3
- package/dist/dts/platform.d.ts +20 -4
- package/dist/dts/registry.d.ts +1 -0
- package/dist/dts/templating/children.d.ts +1 -1
- package/dist/dts/templating/compiler.d.ts +1 -1
- package/dist/dts/templating/html-binding-directive.d.ts +6 -2
- package/dist/dts/templating/html-directive.d.ts +2 -1
- package/dist/dts/templating/hydration-view.d.ts +24 -3
- package/dist/dts/templating/ref.d.ts +1 -1
- package/dist/dts/templating/render.d.ts +2 -2
- package/dist/dts/templating/repeat.d.ts +1 -1
- package/dist/dts/templating/slotted.d.ts +1 -1
- package/dist/dts/templating/template.d.ts +5 -5
- package/dist/dts/templating/when.d.ts +1 -1
- package/dist/dts/testing/fakes.d.ts +4 -4
- package/dist/esm/__test__/helpers.js +22 -0
- package/dist/esm/__test__/setup-node.js +18 -0
- package/dist/esm/binding/two-way.js +1 -2
- package/dist/esm/components/attributes.js +12 -8
- package/dist/esm/components/element-controller.js +11 -6
- package/dist/esm/components/enable-hydration.js +27 -3
- package/dist/esm/components/fast-definitions.js +19 -18
- package/dist/esm/components/hydration-tracker.js +34 -5
- package/dist/esm/components/hydration.js +85 -6
- package/dist/esm/debug.js +1 -0
- package/dist/esm/declarative/attribute-map.js +2 -1
- package/dist/esm/declarative/debug.js +0 -1
- package/dist/esm/declarative/index.js +1 -0
- package/dist/esm/declarative/interfaces.js +0 -1
- package/dist/esm/declarative/observer-map-utilities.js +58 -55
- package/dist/esm/declarative/template-bridge.js +4 -14
- package/dist/esm/declarative/template.js +4 -3
- package/dist/esm/declarative/utilities.js +236 -1
- package/dist/esm/di/di.js +2 -1
- package/dist/esm/dom-policy.js +33 -4
- package/dist/esm/hydration/diagnostics.js +50 -0
- package/dist/esm/hydration/hydration-debugger.js +112 -0
- package/dist/esm/hydration/messages.js +84 -0
- package/dist/esm/hydration/target-builder.js +65 -19
- package/dist/esm/hydration.js +3 -1
- package/dist/esm/index.js +6 -2
- package/dist/esm/interfaces.js +1 -0
- package/dist/esm/metadata.js +2 -8
- package/dist/esm/observation/notifier.js +2 -4
- package/dist/esm/registry.js +1 -0
- package/dist/esm/templating/html-binding-directive.js +1 -1
- package/dist/esm/templating/hydration-view.js +20 -27
- package/dist/esm/templating/render.js +39 -18
- package/dist/esm/templating/repeat.js +51 -17
- package/dist/esm/templating/view.js +1 -1
- package/dist/esm/testing/fixture.js +2 -2
- package/dist/esm/testing/timeout.js +2 -2
- package/dist/fast-element.api.json +1329 -99
- package/dist/fast-element.d.ts +147 -66
- package/dist/fast-element.debug.js +392 -99
- package/dist/fast-element.debug.min.js +2 -2
- package/dist/fast-element.js +392 -99
- package/dist/fast-element.min.js +2 -2
- package/dist/fast-element.untrimmed.d.ts +133 -70
- package/dist/hydration/hydration.api.json +1280 -57
- package/dist/styles/styles.api.json +1 -1
- package/package.json +21 -9
- package/ARCHITECTURE_FASTELEMENT.md +0 -63
- package/ARCHITECTURE_HTML_TAGGED_TEMPLATE_LITERAL.md +0 -36
- package/ARCHITECTURE_INTRO.md +0 -10
- package/ARCHITECTURE_OVERVIEW.md +0 -52
- package/ARCHITECTURE_UPDATES.md +0 -11
- package/CHANGELOG.json +0 -2275
- package/DECLARATIVE_DESIGN.md +0 -806
- package/DECLARATIVE_HTML.md +0 -470
- package/DECLARATIVE_MIGRATION.md +0 -215
- package/DECLARATIVE_RENDERING.md +0 -530
- package/DECLARATIVE_RENDERING_LIFECYCLE.md +0 -288
- package/DECLARATIVE_SCHEMA_OBSERVER_MAP.md +0 -489
- package/DESIGN.md +0 -615
- package/MIGRATION.md +0 -387
- package/SIZES.md +0 -25
- package/api-extractor.arrays.json +0 -15
- package/api-extractor.context.json +0 -15
- package/api-extractor.declarative.json +0 -15
- package/api-extractor.di.json +0 -15
- package/api-extractor.hydration.json +0 -15
- package/api-extractor.styles.json +0 -15
- package/biome.json +0 -4
- package/docs/ACKNOWLEDGEMENTS.md +0 -12
- package/docs/api-report.api.md +0 -1299
- package/docs/arrays/api-report.api.md +0 -114
- package/docs/context/api-report.api.md +0 -69
- package/docs/declarative/api-report.api.md +0 -397
- package/docs/di/api-report.api.md +0 -315
- package/docs/fast-element-2-changes.md +0 -15
- package/docs/hydration/api-report.api.md +0 -285
- package/docs/styles/api-report.api.md +0 -135
- package/playwright.config.ts +0 -26
- package/playwright.declarative.config.ts +0 -26
- package/playwright.declarative.webui.config.ts +0 -20
- package/scripts/declarative/build-fixtures-with-webui.js +0 -135
- package/scripts/declarative/build-fixtures.js +0 -49
- package/scripts/declarative/build-fixtures.utilities.js +0 -101
- package/scripts/measure-sizes.js +0 -219
- package/scripts/run-api-extractor.js +0 -70
- package/test/declarative/fixtures/README.md +0 -72
- package/test/declarative/fixtures/WRITING_FIXTURES.md +0 -330
- package/test/declarative/fixtures/bindings/README.md +0 -12
- package/test/declarative/fixtures/bindings/attribute/entry.html +0 -13
- package/test/declarative/fixtures/bindings/attribute/fast-build.config.json +0 -6
- package/test/declarative/fixtures/bindings/attribute/index.html +0 -25
- package/test/declarative/fixtures/bindings/attribute/main.ts +0 -41
- package/test/declarative/fixtures/bindings/attribute/state.json +0 -8
- package/test/declarative/fixtures/bindings/attribute/templates.html +0 -11
- package/test/declarative/fixtures/bindings/content/entry.html +0 -12
- package/test/declarative/fixtures/bindings/content/fast-build.config.json +0 -6
- package/test/declarative/fixtures/bindings/content/index.html +0 -19
- package/test/declarative/fixtures/bindings/content/main.ts +0 -27
- package/test/declarative/fixtures/bindings/content/state.json +0 -4
- package/test/declarative/fixtures/bindings/content/templates.html +0 -6
- package/test/declarative/fixtures/bindings/dot-syntax/entry.html +0 -11
- package/test/declarative/fixtures/bindings/dot-syntax/fast-build.config.json +0 -6
- package/test/declarative/fixtures/bindings/dot-syntax/index.html +0 -47
- package/test/declarative/fixtures/bindings/dot-syntax/main.ts +0 -59
- package/test/declarative/fixtures/bindings/dot-syntax/state.json +0 -16
- package/test/declarative/fixtures/bindings/dot-syntax/templates.html +0 -17
- package/test/declarative/fixtures/bindings/event/entry.html +0 -11
- package/test/declarative/fixtures/bindings/event/fast-build.config.json +0 -6
- package/test/declarative/fixtures/bindings/event/index.html +0 -43
- package/test/declarative/fixtures/bindings/event/main.ts +0 -43
- package/test/declarative/fixtures/bindings/event/state.json +0 -3
- package/test/declarative/fixtures/bindings/event/templates.html +0 -18
- package/test/declarative/fixtures/bindings/host/entry.html +0 -40
- package/test/declarative/fixtures/bindings/host/fast-build.config.json +0 -6
- package/test/declarative/fixtures/bindings/host/index.html +0 -96
- package/test/declarative/fixtures/bindings/host/main.ts +0 -222
- package/test/declarative/fixtures/bindings/host/state.json +0 -9
- package/test/declarative/fixtures/bindings/host/templates.html +0 -55
- package/test/declarative/fixtures/directives/README.md +0 -12
- package/test/declarative/fixtures/directives/children/entry.html +0 -11
- package/test/declarative/fixtures/directives/children/fast-build.config.json +0 -6
- package/test/declarative/fixtures/directives/children/index.html +0 -15
- package/test/declarative/fixtures/directives/children/main.ts +0 -22
- package/test/declarative/fixtures/directives/children/state.json +0 -3
- package/test/declarative/fixtures/directives/children/templates.html +0 -3
- package/test/declarative/fixtures/directives/ref/entry.html +0 -11
- package/test/declarative/fixtures/directives/ref/fast-build.config.json +0 -6
- package/test/declarative/fixtures/directives/ref/index.html +0 -15
- package/test/declarative/fixtures/directives/ref/main.ts +0 -17
- package/test/declarative/fixtures/directives/ref/state.json +0 -1
- package/test/declarative/fixtures/directives/ref/templates.html +0 -3
- package/test/declarative/fixtures/directives/repeat/entry.html +0 -21
- package/test/declarative/fixtures/directives/repeat/fast-build.config.json +0 -6
- package/test/declarative/fixtures/directives/repeat/index.html +0 -133
- package/test/declarative/fixtures/directives/repeat/main.ts +0 -110
- package/test/declarative/fixtures/directives/repeat/sprites.svg +0 -8
- package/test/declarative/fixtures/directives/repeat/state.json +0 -10
- package/test/declarative/fixtures/directives/repeat/templates.html +0 -75
- package/test/declarative/fixtures/directives/slotted/entry.html +0 -17
- package/test/declarative/fixtures/directives/slotted/fast-build.config.json +0 -6
- package/test/declarative/fixtures/directives/slotted/index.html +0 -27
- package/test/declarative/fixtures/directives/slotted/main.ts +0 -29
- package/test/declarative/fixtures/directives/slotted/state.json +0 -1
- package/test/declarative/fixtures/directives/slotted/templates.html +0 -7
- package/test/declarative/fixtures/directives/when/entry.html +0 -51
- package/test/declarative/fixtures/directives/when/fast-build.config.json +0 -6
- package/test/declarative/fixtures/directives/when/index.html +0 -136
- package/test/declarative/fixtures/directives/when/main.ts +0 -172
- package/test/declarative/fixtures/directives/when/state.json +0 -12
- package/test/declarative/fixtures/directives/when/templates.html +0 -75
- package/test/declarative/fixtures/ecosystem/README.md +0 -11
- package/test/declarative/fixtures/ecosystem/declarative-no-hydration/entry.html +0 -12
- package/test/declarative/fixtures/ecosystem/declarative-no-hydration/fast-build.config.json +0 -6
- package/test/declarative/fixtures/ecosystem/declarative-no-hydration/index.html +0 -20
- package/test/declarative/fixtures/ecosystem/declarative-no-hydration/main.ts +0 -68
- package/test/declarative/fixtures/ecosystem/declarative-no-hydration/state.json +0 -4
- package/test/declarative/fixtures/ecosystem/declarative-no-hydration/templates.html +0 -7
- package/test/declarative/fixtures/ecosystem/errors/entry.html +0 -12
- package/test/declarative/fixtures/ecosystem/errors/fast-build.config.json +0 -6
- package/test/declarative/fixtures/ecosystem/errors/index.html +0 -20
- package/test/declarative/fixtures/ecosystem/errors/main.ts +0 -17
- package/test/declarative/fixtures/ecosystem/errors/state.json +0 -1
- package/test/declarative/fixtures/ecosystem/errors/templates.html +0 -7
- package/test/declarative/fixtures/ecosystem/lifecycle-callbacks/entry.html +0 -17
- package/test/declarative/fixtures/ecosystem/lifecycle-callbacks/fast-build.config.json +0 -6
- package/test/declarative/fixtures/ecosystem/lifecycle-callbacks/index.html +0 -56
- package/test/declarative/fixtures/ecosystem/lifecycle-callbacks/main.ts +0 -134
- package/test/declarative/fixtures/ecosystem/lifecycle-callbacks/state.json +0 -12
- package/test/declarative/fixtures/ecosystem/lifecycle-callbacks/templates.html +0 -34
- package/test/declarative/fixtures/ecosystem/performance-metrics/entry.html +0 -25
- package/test/declarative/fixtures/ecosystem/performance-metrics/fast-build.config.json +0 -6
- package/test/declarative/fixtures/ecosystem/performance-metrics/fast-card.css +0 -10
- package/test/declarative/fixtures/ecosystem/performance-metrics/index.html +0 -181
- package/test/declarative/fixtures/ecosystem/performance-metrics/main.ts +0 -58
- package/test/declarative/fixtures/ecosystem/performance-metrics/state.json +0 -6
- package/test/declarative/fixtures/ecosystem/performance-metrics/templates.html +0 -15
- package/test/declarative/fixtures/extensions/README.md +0 -15
- package/test/declarative/fixtures/extensions/attribute-map/entry.html +0 -14
- package/test/declarative/fixtures/extensions/attribute-map/fast-build.config.json +0 -6
- package/test/declarative/fixtures/extensions/attribute-map/index.html +0 -31
- package/test/declarative/fixtures/extensions/attribute-map/main.ts +0 -40
- package/test/declarative/fixtures/extensions/attribute-map/state.json +0 -4
- package/test/declarative/fixtures/extensions/attribute-map/templates.html +0 -14
- package/test/declarative/fixtures/extensions/attribute-map-naming-strategy/entry.html +0 -12
- package/test/declarative/fixtures/extensions/attribute-map-naming-strategy/fast-build.config.json +0 -7
- package/test/declarative/fixtures/extensions/attribute-map-naming-strategy/index.html +0 -25
- package/test/declarative/fixtures/extensions/attribute-map-naming-strategy/main.ts +0 -31
- package/test/declarative/fixtures/extensions/attribute-map-naming-strategy/state.json +0 -5
- package/test/declarative/fixtures/extensions/attribute-map-naming-strategy/templates.html +0 -11
- package/test/declarative/fixtures/extensions/attribute-map-naming-strategy-camel-case/entry.html +0 -13
- package/test/declarative/fixtures/extensions/attribute-map-naming-strategy-camel-case/fast-build.config.json +0 -7
- package/test/declarative/fixtures/extensions/attribute-map-naming-strategy-camel-case/index.html +0 -23
- package/test/declarative/fixtures/extensions/attribute-map-naming-strategy-camel-case/main.ts +0 -37
- package/test/declarative/fixtures/extensions/attribute-map-naming-strategy-camel-case/state.json +0 -1
- package/test/declarative/fixtures/extensions/attribute-map-naming-strategy-camel-case/templates.html +0 -9
- package/test/declarative/fixtures/extensions/observer-map/entry.html +0 -15
- package/test/declarative/fixtures/extensions/observer-map/fast-build.config.json +0 -6
- package/test/declarative/fixtures/extensions/observer-map/index.html +0 -442
- package/test/declarative/fixtures/extensions/observer-map/main.ts +0 -482
- package/test/declarative/fixtures/extensions/observer-map/state.json +0 -158
- package/test/declarative/fixtures/extensions/observer-map/templates.html +0 -172
- package/test/declarative/fixtures/extensions/observer-map-config-object/entry.html +0 -16
- package/test/declarative/fixtures/extensions/observer-map-config-object/fast-build.config.json +0 -6
- package/test/declarative/fixtures/extensions/observer-map-config-object/index.html +0 -27
- package/test/declarative/fixtures/extensions/observer-map-config-object/main.ts +0 -53
- package/test/declarative/fixtures/extensions/observer-map-config-object/state.json +0 -9
- package/test/declarative/fixtures/extensions/observer-map-config-object/templates.html +0 -12
- package/test/declarative/fixtures/extensions/observer-map-deep-merge/README.md +0 -98
- package/test/declarative/fixtures/extensions/observer-map-deep-merge/entry.html +0 -156
- package/test/declarative/fixtures/extensions/observer-map-deep-merge/fast-build.config.json +0 -6
- package/test/declarative/fixtures/extensions/observer-map-deep-merge/index.html +0 -376
- package/test/declarative/fixtures/extensions/observer-map-deep-merge/main.ts +0 -366
- package/test/declarative/fixtures/extensions/observer-map-deep-merge/state.json +0 -69
- package/test/declarative/fixtures/extensions/observer-map-deep-merge/templates.html +0 -91
- package/test/declarative/fixtures/extensions/observer-map-properties/entry.html +0 -14
- package/test/declarative/fixtures/extensions/observer-map-properties/fast-build.config.json +0 -6
- package/test/declarative/fixtures/extensions/observer-map-properties/index.html +0 -110
- package/test/declarative/fixtures/extensions/observer-map-properties/main.ts +0 -175
- package/test/declarative/fixtures/extensions/observer-map-properties/state.json +0 -29
- package/test/declarative/fixtures/extensions/observer-map-properties/templates.html +0 -55
- package/test/declarative/fixtures/scenarios/README.md +0 -7
- package/test/declarative/fixtures/scenarios/nested-elements/entry.html +0 -16
- package/test/declarative/fixtures/scenarios/nested-elements/fast-build.config.json +0 -6
- package/test/declarative/fixtures/scenarios/nested-elements/index.html +0 -126
- package/test/declarative/fixtures/scenarios/nested-elements/main.ts +0 -214
- package/test/declarative/fixtures/scenarios/nested-elements/state.json +0 -10
- package/test/declarative/fixtures/scenarios/nested-elements/templates.html +0 -54
- package/test/declarative/index.html +0 -12
- package/test/declarative/vite.config.ts +0 -55
- package/test/declarative-main.ts +0 -6
- package/test/extension-subpaths-main.ts +0 -9
- package/test/index.html +0 -11
- package/test/main.ts +0 -109
- package/test/pure-declarative-main.ts +0 -1
- package/test/vite.config.ts +0 -19
- package/tsconfig.api-extractor.json +0 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,9 +1,59 @@
|
|
|
1
1
|
# Change Log - @microsoft/fast-element
|
|
2
2
|
|
|
3
|
-
<!-- This log was last generated on Fri,
|
|
3
|
+
<!-- This log was last generated on Fri, 19 Jun 2026 22:15:55 GMT and should not be manually modified. -->
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## 3.0.0-rc.2
|
|
8
|
+
|
|
9
|
+
Fri, 19 Jun 2026 22:15:55 GMT
|
|
10
|
+
|
|
11
|
+
### Changes
|
|
12
|
+
|
|
13
|
+
- Filter late attribute MutationObserver records. (7559015+janechu@users.noreply.github.com)
|
|
14
|
+
- fix: align @attr({ mode: 'boolean' }) and booleanConverter with native HTML boolean attribute semantics (7559015+janechu@users.noreply.github.com)
|
|
15
|
+
- feat: expose declarative HTML syntax constants from declarative utilities (7559015+janechu@users.noreply.github.com)
|
|
16
|
+
- fix: restore CaptureType generic type capture for template directives (7559015+janechu@users.noreply.github.com)
|
|
17
|
+
- feat: change default attribute-name-strategy from none to camelCase (7559015+janechu@users.noreply.github.com)
|
|
18
|
+
- feat: auto-escape `{` and `}` inside `<code>` elements so binding-like syntax in code samples renders as literal text (mirrors webui-press and the server-side `escape_code_sample_elements` pass in `@microsoft/fast-build`, which additionally handles `<f-when>`/`<f-repeat>` directive tags) (7559015+janechu@users.noreply.github.com)
|
|
19
|
+
- Improve hydration mismatch behaviour: render() falls back to client rendering when SSR view boundaries are empty, repeat() reconciles SSR/client item-count mismatches by creating missing client views or removing extra SSR ranges, and unrecoverable mismatches throw via a pluggable HydrationDiagnostic. Opt in to the rich 'Expected / Received' format with the SSR HTML snippet and structured expected/received fields on HydrationBindingError / HydrationTargetElementError by passing enableHydration({ debugger: hydrationDebugger() }) (hydrationDebugger is exported from '@microsoft/fast-element/hydration.js'). (7559015+janechu@users.noreply.github.com)
|
|
20
|
+
- Add hydration configuration for streamed Declarative Shadow DOM. (7559015+janechu@users.noreply.github.com)
|
|
21
|
+
- Avoid mutating render template bindings (7559015+janechu@users.noreply.github.com)
|
|
22
|
+
- feat: propagate shadowroot attributes from f-template to declarative shadow DOM template (7559015+janechu@users.noreply.github.com)
|
|
23
|
+
- Preserve view context when rebinding the same source. (7559015+janechu@users.noreply.github.com)
|
|
24
|
+
- feat: warn when duplicate render instruction registrations replace existing entries (7559015+janechu@users.noreply.github.com)
|
|
25
|
+
- Add a registry path export for FAST element definition lookups. (7559015+janechu@users.noreply.github.com)
|
|
26
|
+
- Bump @microsoft/fast-build to v0.8.0-fast-element-v3-rc-20260615
|
|
27
|
+
|
|
28
|
+
## 3.0.0-rc.1
|
|
29
|
+
|
|
30
|
+
Tue, 28 Apr 2026 04:42:02 GMT
|
|
31
|
+
|
|
32
|
+
### Major changes
|
|
33
|
+
|
|
34
|
+
- remove FASTGlobal version tracking (7559015+janechu@users.noreply.github.com)
|
|
35
|
+
- Remove hydration view template side effect and unused export paths (7559015+janechu@users.noreply.github.com)
|
|
36
|
+
- Move optional helpers to dedicated flat fast-element subpath exports such as @microsoft/fast-element/children.js, @microsoft/fast-element/repeat.js, @microsoft/fast-element/two-way.js, @microsoft/fast-element/signal.js, @microsoft/fast-element/attribute-map.js, and @microsoft/fast-element/observer-map.js while keeping controller and definition internals on the root entrypoint. (7559015+janechu@users.noreply.github.com)
|
|
37
|
+
- Remove the public declarative TemplateElement configuration APIs and make declarative templates use an internal native f-template publisher with explicit hydration opt-in. (7559015+janechu@users.noreply.github.com)
|
|
38
|
+
- Replace HydratableElementController with automatic prerendered content optimization. When a component connects with an existing shadow root, bindings skip attribute/booleanAttribute DOM updates during initial render while still setting up event listeners, observers, and dependency tracking. Added isPrerendered flag to ElementController and ViewController. Added template-pending guard for defineAsync flow. (7559015+janechu@users.noreply.github.com)
|
|
39
|
+
- Move declarative HTML APIs into @microsoft/fast-element/declarative.js, expose schema map helpers from extension subpaths, and remove the @microsoft/fast-html package. (7559015+janechu@users.noreply.github.com)
|
|
40
|
+
- Remove ElementStyles.withBehaviors, CSS style behaviors, and CSS bindings in fast-element. (7559015+janechu@users.noreply.github.com)
|
|
41
|
+
- Remove TemplateOptions from fast-element definitions and drop templateOptions-based connection/define waiting. (7559015+janechu@users.noreply.github.com)
|
|
42
|
+
- Simplify hydration markers to data-free sequential format (fe:b, fe:/b, fe:r, fe:/r, fe:e, fe:/e). Replace regex parsing with string equality checks. Single data-fe attribute replaces three old formats. Breaking change: SSR output format changed. (7559015+janechu@users.noreply.github.com)
|
|
43
|
+
- remove deprecated declarative event e support (7559015+janechu@users.noreply.github.com)
|
|
44
|
+
- Make declarative runtime setup lazy and change @microsoft/fast-element/debug.js to require an explicit enableDebug() call. (7559015+janechu@users.noreply.github.com)
|
|
45
|
+
- Remove defineAsync and composeAsync — define() and compose() now return Promises (7559015+janechu@users.noreply.github.com)
|
|
46
|
+
- Remove the built-in globalThis polyfill; fast-element v3 now requires native globalThis (7559015+janechu@users.noreply.github.com)
|
|
47
|
+
- fix: remove the fast-kernel multi-kernel modes. Breaking change: FAST no longer supports configuring isolated or version-scoped kernels via the script attribute. (7559015+janechu@users.noreply.github.com)
|
|
48
|
+
|
|
49
|
+
### Minor changes
|
|
50
|
+
|
|
51
|
+
- Add schema-driven attributeMap and observerMap extension subpaths, optional definition schema, and observerMap schema configuration. (7559015+janechu@users.noreply.github.com)
|
|
52
|
+
- add declarativeTemplate for auto-resolving <f-template> markup (7559015+janechu@users.noreply.github.com)
|
|
53
|
+
- Add extensions array argument to FASTElement.define() and FASTElementDefinition.define() (7559015+janechu@users.noreply.github.com)
|
|
54
|
+
- feat: modularize hydration and expose lifecycle callbacks via enableHydration() and declarativeTemplate() (7559015+janechu@users.noreply.github.com)
|
|
55
|
+
- add function-based template resolver sequencing (7559015+janechu@users.noreply.github.com)
|
|
56
|
+
|
|
7
57
|
## 2.10.4
|
|
8
58
|
|
|
9
59
|
Fri, 17 Apr 2026 00:26:37 GMT
|
package/README.md
CHANGED
|
@@ -55,11 +55,17 @@ Looking for a quick guide on building components? Check out [our Cheat Sheet](.
|
|
|
55
55
|
|
|
56
56
|
## Browser Requirements
|
|
57
57
|
|
|
58
|
-
FAST Element v3 assumes a
|
|
59
|
-
|
|
60
|
-
|
|
58
|
+
FAST Element v3 assumes a client-side browser `Window` runtime with native
|
|
59
|
+
`globalThis`, Custom Elements, DOM, Shadow DOM, and `requestAnimationFrame`.
|
|
60
|
+
The `FAST` object is now a module-scoped export (not on `globalThis`). If you
|
|
61
|
+
need to support an older browser without `globalThis`, load that polyfill before
|
|
61
62
|
importing `@microsoft/fast-element`.
|
|
62
63
|
|
|
64
|
+
The FAST Element client runtime is not intended to execute in workers,
|
|
65
|
+
server-side JavaScript runtimes, or other non-window hosts. Use server-side
|
|
66
|
+
rendering tools to produce HTML for the browser, and run FAST Element in the
|
|
67
|
+
client window where custom elements connect, render, update, and hydrate.
|
|
68
|
+
|
|
63
69
|
## Debug entrypoint
|
|
64
70
|
|
|
65
71
|
`@microsoft/fast-element/debug.js` exports `enableDebug()` instead of configuring
|
|
@@ -74,15 +80,17 @@ enableDebug();
|
|
|
74
80
|
|
|
75
81
|
## Export Sizes
|
|
76
82
|
|
|
77
|
-
Bundle sizes for each tree-shakeable export are tracked in [`SIZES.md`](./SIZES.md) and regenerated on every build. See the [Export Sizes](https://www.fast.design/docs/
|
|
83
|
+
Bundle sizes for each tree-shakeable export are tracked in [`SIZES.md`](./SIZES.md) and regenerated on every build. See the [Export Sizes](https://www.fast.design/docs/2.x/resources/export-sizes/) documentation page for the latest numbers.
|
|
78
84
|
|
|
79
85
|
## Root Imports and Path Exports
|
|
80
86
|
|
|
81
87
|
The root `@microsoft/fast-element` entrypoint exports the FAST Element
|
|
82
88
|
implementation APIs, including the element base class, kernel, controller,
|
|
83
89
|
definition APIs, template APIs, binding helpers, directives, styles, and schema
|
|
84
|
-
helpers.
|
|
85
|
-
|
|
90
|
+
helpers. The FAST element registry is also available from
|
|
91
|
+
`@microsoft/fast-element/registry.js` for focused definition lookups.
|
|
92
|
+
Declarative, hydration, context, and dependency injection APIs are available
|
|
93
|
+
from their focused path exports.
|
|
86
94
|
|
|
87
95
|
Focused package path exports remain available for consumers that want to import
|
|
88
96
|
a narrower entrypoint directly. The website's
|
|
@@ -136,8 +144,10 @@ MyElement.define({
|
|
|
136
144
|
`declarativeTemplate()` automatically defines FAST's internal native
|
|
137
145
|
`<f-template>` publisher in the relevant registry, resolves the matching
|
|
138
146
|
`<f-template name="my-element">`, and keeps the definition template concrete
|
|
139
|
-
before `define()` resolves.
|
|
140
|
-
|
|
147
|
+
before `define()` resolves. If multiple matching `<f-template>` elements are
|
|
148
|
+
connected, the first connected element supplies the template and later duplicates
|
|
149
|
+
do not reassign it. Consumers should not import or define the `<f-template>`
|
|
150
|
+
implementation directly.
|
|
141
151
|
|
|
142
152
|
Declarative schema behavior is enabled with define extensions:
|
|
143
153
|
|
|
@@ -188,6 +198,18 @@ enableHydration({
|
|
|
188
198
|
});
|
|
189
199
|
```
|
|
190
200
|
|
|
201
|
+
By default, hydration handles the initial prerendered batch and then no-ops
|
|
202
|
+
after `hydrationComplete` fires. If your app streams Declarative Shadow DOM
|
|
203
|
+
after the initial batch, keep the hydration hook active:
|
|
204
|
+
|
|
205
|
+
```typescript
|
|
206
|
+
import { enableHydration, StopHydration } from "@microsoft/fast-element/hydration.js";
|
|
207
|
+
|
|
208
|
+
enableHydration({
|
|
209
|
+
stopHydration: StopHydration.never,
|
|
210
|
+
});
|
|
211
|
+
```
|
|
212
|
+
|
|
191
213
|
When hydration is enabled and a FAST element connects with an existing shadow root (from server-side rendering or declarative shadow DOM), `ElementController` detects this and hydrates instead of re-rendering. Two properties on the controller let you inspect the result:
|
|
192
214
|
|
|
193
215
|
- **`isPrerendered: Promise<boolean>`** — resolves `true` when the element had a declarative shadow root (DSD) at connect time, regardless of whether hydration ran.
|
|
@@ -202,6 +224,25 @@ This enables several optimizations:
|
|
|
202
224
|
- **Attribute skip**: `onAttributeChangedCallback()` skips processing during initial upgrade when the element is prerendered, since server-rendered attribute values are already correct.
|
|
203
225
|
- **Binding skip**: `HTMLBindingDirective.bind()` skips `updateTarget` for `attribute` and `booleanAttribute` aspect types when the view is prerendered.
|
|
204
226
|
|
|
227
|
+
### Hydration Mismatch Diagnostics
|
|
228
|
+
|
|
229
|
+
If a prerendered DOM diverges from the client template in a way FAST cannot
|
|
230
|
+
reconcile (the `render()` empty-boundary and `repeat()` count-mismatch cases
|
|
231
|
+
recover silently), `HydrationBindingError` or `HydrationTargetElementError` is
|
|
232
|
+
thrown. By default the message is a single line pointing at the opt-in
|
|
233
|
+
`hydrationDebugger()`. Install the debugger to get a rich
|
|
234
|
+
"Expected … / Received …" report with the SSR HTML snippet and structured
|
|
235
|
+
`expected` / `received` fields on the thrown error:
|
|
236
|
+
|
|
237
|
+
```typescript
|
|
238
|
+
import { enableHydration, hydrationDebugger } from "@microsoft/fast-element/hydration.js";
|
|
239
|
+
|
|
240
|
+
enableHydration({ debugger: hydrationDebugger() });
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
The debugger module is tree-shaken out of production hydration bundles when
|
|
244
|
+
not imported, so the rich diagnostic helpers only land in builds that opt in.
|
|
245
|
+
|
|
205
246
|
Per-element lifecycle callbacks can be passed directly to `declarativeTemplate()`:
|
|
206
247
|
|
|
207
248
|
```typescript
|
|
@@ -236,7 +277,7 @@ Custom directives can also await `controller.isPrerendered` and `controller.isHy
|
|
|
236
277
|
|
|
237
278
|
## Define Extensions
|
|
238
279
|
|
|
239
|
-
`
|
|
280
|
+
The static `define()` method on a `FASTElement` subclass accepts an optional second argument — an array of extension callbacks that are invoked with the resolved element definition before the element is registered with the platform. This enables a plugin pattern where reusable behaviors can hook into element registration.
|
|
240
281
|
|
|
241
282
|
```typescript
|
|
242
283
|
import { FASTElement, type FASTElementExtension } from "@microsoft/fast-element";
|
|
@@ -251,11 +292,6 @@ class MyComponent extends FASTElement {
|
|
|
251
292
|
// component code
|
|
252
293
|
}
|
|
253
294
|
|
|
254
|
-
// Method style
|
|
255
295
|
MyComponent.define({ name: "my-component", template, styles }, [logger()]);
|
|
256
|
-
|
|
257
|
-
// Static style
|
|
258
|
-
FASTElement.define(MyComponent, { name: "my-component" }, [logger()]);
|
|
259
296
|
```
|
|
260
|
-
|
|
261
297
|
Each extension receives the full `FASTElementDefinition`, which includes the resolved element name, type, template, styles, and attribute metadata. Extensions run before `customElements.define()`, so any setup they perform is available when existing DOM elements are upgraded.
|
|
@@ -252,7 +252,7 @@
|
|
|
252
252
|
},
|
|
253
253
|
{
|
|
254
254
|
"kind": "Content",
|
|
255
|
-
"text": "<T>;\n create<
|
|
255
|
+
"text": "<T>;\n create<T = unknown>(name: string, initialValue?: T): "
|
|
256
256
|
},
|
|
257
257
|
{
|
|
258
258
|
"kind": "Reference",
|
|
@@ -261,7 +261,7 @@
|
|
|
261
261
|
},
|
|
262
262
|
{
|
|
263
263
|
"kind": "Content",
|
|
264
|
-
"text": "<
|
|
264
|
+
"text": "<T>;\n setDefaultRequestStrategy(strategy: "
|
|
265
265
|
},
|
|
266
266
|
{
|
|
267
267
|
"kind": "Reference",
|
|
@@ -270,7 +270,7 @@
|
|
|
270
270
|
},
|
|
271
271
|
{
|
|
272
272
|
"kind": "Content",
|
|
273
|
-
"text": "): void;\n get<
|
|
273
|
+
"text": "): void;\n get<T extends "
|
|
274
274
|
},
|
|
275
275
|
{
|
|
276
276
|
"kind": "Reference",
|
|
@@ -288,7 +288,7 @@
|
|
|
288
288
|
},
|
|
289
289
|
{
|
|
290
290
|
"kind": "Content",
|
|
291
|
-
"text": ", context:
|
|
291
|
+
"text": ", context: T): "
|
|
292
292
|
},
|
|
293
293
|
{
|
|
294
294
|
"kind": "Reference",
|
|
@@ -297,7 +297,7 @@
|
|
|
297
297
|
},
|
|
298
298
|
{
|
|
299
299
|
"kind": "Content",
|
|
300
|
-
"text": "<
|
|
300
|
+
"text": "<T>;\n request<T extends "
|
|
301
301
|
},
|
|
302
302
|
{
|
|
303
303
|
"kind": "Reference",
|
|
@@ -315,7 +315,7 @@
|
|
|
315
315
|
},
|
|
316
316
|
{
|
|
317
317
|
"kind": "Content",
|
|
318
|
-
"text": ", context:
|
|
318
|
+
"text": ", context: T, callback: "
|
|
319
319
|
},
|
|
320
320
|
{
|
|
321
321
|
"kind": "Reference",
|
|
@@ -333,7 +333,7 @@
|
|
|
333
333
|
},
|
|
334
334
|
{
|
|
335
335
|
"kind": "Content",
|
|
336
|
-
"text": "<
|
|
336
|
+
"text": "<T>>, multiple?: boolean): void;\n dispatch<T extends "
|
|
337
337
|
},
|
|
338
338
|
{
|
|
339
339
|
"kind": "Reference",
|
|
@@ -351,7 +351,7 @@
|
|
|
351
351
|
},
|
|
352
352
|
{
|
|
353
353
|
"kind": "Content",
|
|
354
|
-
"text": ", context:
|
|
354
|
+
"text": ", context: T, callback: "
|
|
355
355
|
},
|
|
356
356
|
{
|
|
357
357
|
"kind": "Reference",
|
|
@@ -369,7 +369,7 @@
|
|
|
369
369
|
},
|
|
370
370
|
{
|
|
371
371
|
"kind": "Content",
|
|
372
|
-
"text": "<
|
|
372
|
+
"text": "<T>>, multiple?: boolean): void;\n provide<T extends "
|
|
373
373
|
},
|
|
374
374
|
{
|
|
375
375
|
"kind": "Reference",
|
|
@@ -387,7 +387,7 @@
|
|
|
387
387
|
},
|
|
388
388
|
{
|
|
389
389
|
"kind": "Content",
|
|
390
|
-
"text": ", context:
|
|
390
|
+
"text": ", context: T, value: "
|
|
391
391
|
},
|
|
392
392
|
{
|
|
393
393
|
"kind": "Reference",
|
|
@@ -396,7 +396,7 @@
|
|
|
396
396
|
},
|
|
397
397
|
{
|
|
398
398
|
"kind": "Content",
|
|
399
|
-
"text": "<
|
|
399
|
+
"text": "<T>): void;\n handle<T extends "
|
|
400
400
|
},
|
|
401
401
|
{
|
|
402
402
|
"kind": "Reference",
|
|
@@ -423,7 +423,7 @@
|
|
|
423
423
|
},
|
|
424
424
|
{
|
|
425
425
|
"kind": "Content",
|
|
426
|
-
"text": "<
|
|
426
|
+
"text": "<T>) => void, context?: T): void;\n defineProperty<T extends "
|
|
427
427
|
},
|
|
428
428
|
{
|
|
429
429
|
"kind": "Reference",
|
|
@@ -459,7 +459,7 @@
|
|
|
459
459
|
},
|
|
460
460
|
{
|
|
461
461
|
"kind": "Content",
|
|
462
|
-
"text": ", propertyName: string, context:
|
|
462
|
+
"text": ", propertyName: string, context: T): void;\n}>"
|
|
463
463
|
}
|
|
464
464
|
],
|
|
465
465
|
"fileUrlPath": "dist/dts/context.d.ts",
|