@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/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@microsoft/fast-element",
|
|
3
3
|
"description": "A library for constructing Web Components",
|
|
4
|
-
"version": "3.0.0-rc.
|
|
4
|
+
"version": "3.0.0-rc.2",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Microsoft",
|
|
7
7
|
"url": "https://discord.gg/FcSNfg4"
|
|
@@ -35,6 +35,11 @@
|
|
|
35
35
|
"test": "./src/components/fast-element.ts",
|
|
36
36
|
"default": "./dist/esm/components/fast-element.js"
|
|
37
37
|
},
|
|
38
|
+
"./registry.js": {
|
|
39
|
+
"types": "./dist/dts/registry.d.ts",
|
|
40
|
+
"test": "./src/registry.ts",
|
|
41
|
+
"default": "./dist/esm/registry.js"
|
|
42
|
+
},
|
|
38
43
|
"./declarative.js": {
|
|
39
44
|
"types": "./dist/dts/declarative/index.d.ts",
|
|
40
45
|
"test": "./src/declarative/index.ts",
|
|
@@ -199,32 +204,39 @@
|
|
|
199
204
|
"doc": "api-extractor run --local",
|
|
200
205
|
"doc:ci": "api-extractor run",
|
|
201
206
|
"doc:exports": "node ./scripts/run-api-extractor.js",
|
|
207
|
+
"doc:path-exports": "node ./scripts/check-path-exports-docs.js --write",
|
|
208
|
+
"doc:path-exports:check": "node ./scripts/check-path-exports-docs.js --check",
|
|
202
209
|
"doc:exports:ci": "node ./scripts/run-api-extractor.js ci",
|
|
203
|
-
"build": "npm run build:tsc && npm run build:rollup && npm run build:sizes && npm run doc && npm run doc:exports && npm run build:fixtures",
|
|
210
|
+
"build": "npm run build:tsc && npm run test:exports && npm run build:rollup && npm run build:sizes && npm run doc && npm run doc:exports && npm run build:fixtures",
|
|
204
211
|
"build:fixtures": "node scripts/declarative/build-fixtures.js",
|
|
205
212
|
"build:fixtures:webui": "node scripts/declarative/build-fixtures-with-webui.js",
|
|
206
213
|
"build:rollup": "rollup -c",
|
|
207
214
|
"build:sizes": "node scripts/measure-sizes.js",
|
|
208
|
-
"build:tsc": "
|
|
209
|
-
"dev": "
|
|
215
|
+
"build:tsc": "tsgo -p ./tsconfig.json",
|
|
216
|
+
"dev": "tsgo -p ./tsconfig.json -w",
|
|
210
217
|
"dev:declarative": "concurrently -k -n tsc,server \"npm run dev\" \"npm run test-server:declarative\"",
|
|
211
218
|
"prepublishOnly": "npm run clean && npm run build",
|
|
212
219
|
"lint": "biome-changed",
|
|
213
220
|
"lint:fix": "biome-changed -- --fix",
|
|
214
221
|
"test:playwright": "playwright test && npm run test:playwright:declarative",
|
|
222
|
+
"test:exports": "node ./scripts/smoke-package-exports.js",
|
|
215
223
|
"test:playwright:declarative": "playwright test --config=playwright.declarative.config.ts",
|
|
216
224
|
"test:chromium": "playwright test --project=chromium && npm run test:chromium:declarative",
|
|
217
225
|
"test:chromium:declarative": "playwright test --config=playwright.declarative.config.ts --project=chromium",
|
|
218
226
|
"test-server": "npx vite test/ --clearScreen false",
|
|
219
227
|
"test-server:declarative": "npx vite test/declarative --clearScreen false --port 5174 --strictPort",
|
|
220
228
|
"test-server:declarative:webui": "npx vite temp/integrations/webui --clearScreen false --port 5174 --strictPort",
|
|
221
|
-
"test": "npm run lint && npm run doc:ci && npm run doc:exports:ci && npm run test:playwright",
|
|
222
|
-
"test:ci": "npm run doc:ci && npm run doc:exports:ci && npm run test:playwright",
|
|
229
|
+
"test": "npm run lint && npm run doc:path-exports:check && npm run doc:ci && npm run doc:exports:ci && npm run test:exports && npm run test:playwright",
|
|
230
|
+
"test:ci": "npm run doc:path-exports:check && npm run doc:ci && npm run doc:exports:ci && npm run test:exports && npm run test:playwright",
|
|
223
231
|
"test:ui:declarative": "concurrently -k -n tsc,playwright \"npm run dev\" \"npx playwright test --config=playwright.declarative.config.ts --ui\"",
|
|
224
232
|
"test:webui-integration": "npm run build:fixtures:webui && playwright test --config=playwright.declarative.webui.config.ts"
|
|
225
233
|
},
|
|
226
234
|
"devDependencies": {
|
|
227
|
-
"@microsoft/fast-build": "
|
|
228
|
-
"@microsoft/webui": "0.0.
|
|
229
|
-
}
|
|
235
|
+
"@microsoft/fast-build": "0.8.0-fast-element-v3-rc-20260615",
|
|
236
|
+
"@microsoft/webui": "0.0.12"
|
|
237
|
+
},
|
|
238
|
+
"files": [
|
|
239
|
+
"./dist",
|
|
240
|
+
"CHANGELOG.md"
|
|
241
|
+
]
|
|
230
242
|
}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
# FASTElement
|
|
2
|
-
|
|
3
|
-
The `FASTElement` is our extension of the `HTMLElement`. As such it leverages the lifecycles but also requires additional setup before before the class `constructor` or the `connectedCallback` method is executed which are explained in the [overview](./ARCHITECTURE_OVERVIEW.md). This document explains specifically what `FASTElement` leverages inside the `HTMLElement`s lifecycle hooks.
|
|
4
|
-
|
|
5
|
-
For an explanation into `HTMLElement` lifecycle hooks refer to the [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/API/Web_components/Using_custom_elements#custom_element_lifecycle_callbacks).
|
|
6
|
-
|
|
7
|
-
## A Custom Element is Detected by the Browser
|
|
8
|
-
|
|
9
|
-
Because the `FASTElement` is an extension of the `HTMLElement`, it makes use of the same lifecycle hooks and extends them with `$fastController`. It also initializes using another class `ElementController`, the methods this are called during the custom elements native `constructor`, `connectedCallback`, `disconnectedCallback`, and `attributeChangedCallback` lifecycle hooks.
|
|
10
|
-
|
|
11
|
-
### 🔄 **Lifecycle**: Initialization
|
|
12
|
-
|
|
13
|
-
```mermaid
|
|
14
|
-
flowchart TD
|
|
15
|
-
A[A <code>FASTElement</code> web component is added to the <code>DOM</code>] --> B
|
|
16
|
-
B[<code>FASTElement</code> initializes the <code>ElementController.forCustomElement</code> passing the Custom Element instance] --> C
|
|
17
|
-
B --> F[Observables applied to the <code>FASTElement</code> are updated on the FAST global without values]
|
|
18
|
-
C{Is an <code>ElementController</code> available?}
|
|
19
|
-
C --> |yes|E
|
|
20
|
-
C --> |no|D
|
|
21
|
-
D[Initialize a new <code>ElementController</code> referred to as setting an element controller strategy]
|
|
22
|
-
D --> F
|
|
23
|
-
E[<code>ElementController</code> captures the Custom Element instance and the definition and attaches them to the <code>$fastController</code> which is then attached to the instance]
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
### 🔄 **Lifecycle**: Component is connected
|
|
27
|
-
|
|
28
|
-
```mermaid
|
|
29
|
-
flowchart TD
|
|
30
|
-
A[browser <code>HTMLElement</code>'s <code>connectedCallback</code> is called] --> B
|
|
31
|
-
B[<code>this.$fastController.connect</code> in FASTElement is called] --> C
|
|
32
|
-
B --> D
|
|
33
|
-
B --> E
|
|
34
|
-
B --> F
|
|
35
|
-
C[bind observables by capturing the Custom Elements properties and setting the values from the bound observables on the Custom Element]
|
|
36
|
-
D[connect behaviors by call the <code>connectedCallback</code> on all behaviors]
|
|
37
|
-
E[render template, execute an <code>ElementViewTemplate</code>'s render method]
|
|
38
|
-
F[add styles either as an appended <code>StyleElement</code> node or an <code>adoptedStylesheet</code> which may include and attach behaviors]
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
#### Render Template
|
|
42
|
-
|
|
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
|
-
|
|
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
|
-
|
|
47
|
-
### 🔄 **Lifecycle**: Component is disconnected
|
|
48
|
-
|
|
49
|
-
When a component is disconnected, a cleanup step is created to remove associated behaviors.
|
|
50
|
-
|
|
51
|
-
### 🔄 **Lifecycle**: Attribute has been changed
|
|
52
|
-
|
|
53
|
-
Attributes have an `AttributeDefinition` which allows for converters, attachment of the `<attributName>Changed` aspect of the `@attr` decorator among other capabilities.
|
|
54
|
-
|
|
55
|
-
```mermaid
|
|
56
|
-
flowchart TD
|
|
57
|
-
A[The browser <code>HTMLElement</code>'s <code>attributeChangedCallback</code> is called] --> B
|
|
58
|
-
B[<code>this.$fastController.onAttributeChangedCallback</code> in <code>FASTElement</code> is called] --> C
|
|
59
|
-
C[calls the attribute definitions <code>onAttributeChangedCallback</code> method with the updated value] --> D
|
|
60
|
-
D[An <code>Updates.enqueue</code> is called which places the update in the task queue which is then executed, these are performed async unless otherwise specified]
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
These changes are observed and similar to the way `Observables` work, they utilize an `Accessor` pattern which has a `getValue` and `setValue` in which DOM updates are applied.
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
# `html` tagged template literal
|
|
2
|
-
|
|
3
|
-
The `html` export from `@microsoft/fast-element` is used to create the template logic for the custom element.
|
|
4
|
-
|
|
5
|
-
## Pre-processing the `html` tagged template literal contents
|
|
6
|
-
|
|
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
|
-
|
|
9
|
-
During the static `ViewTemplate.create()` method (called by the `html` tag), the following happens for each string:
|
|
10
|
-
- Factories with unique IDs are created for each tag template literal argument (or `TemplateValue`) which matches with the corresponding string
|
|
11
|
-
- A binding is created from the `TemplateValue`
|
|
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
|
-
|
|
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.
|
|
16
|
-
|
|
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.
|
|
18
|
-
|
|
19
|
-
## Directives
|
|
20
|
-
|
|
21
|
-
The `HTMLBindingDirective` applies bindings to items identified as various `TemplateValue`s within the `html` tagged template. The `createHTML` step uses the factory associated with the binding to create strings in the markup using the factory's ID.
|
|
22
|
-
|
|
23
|
-
```mermaid
|
|
24
|
-
flowchart TD
|
|
25
|
-
A[A <code>new HTMLBindingDirective</code> is created with a data binding which has a policy, options, <code>createObserver</code>, and an evaluate method assigned to the passed arrow function such as <pre>x => x.foo</pre>]
|
|
26
|
-
B[<code>oneTime</code> binding passes the corresponding tag template argument, an arrow function]
|
|
27
|
-
C[<code>oneWay</code> binding passes a copy of the corresponding tag template argument, an arrow function]
|
|
28
|
-
D[An already specified binding such as a <code>repeat</code> or <code>when</code> directive is passed]
|
|
29
|
-
A --> B
|
|
30
|
-
A --> C
|
|
31
|
-
A --> D
|
|
32
|
-
E[When a <code>createObserver</code> is called, an <code>Observable.binding</code> is created passing the arrow function to be evaluated and the subscriber to be notified]
|
|
33
|
-
C --> E
|
|
34
|
-
F[When a <code>createObserver</code> is called, the instance of the one time binding is returned which includes a bind method returning the arrow function executed against the controller source and context]
|
|
35
|
-
B --> F
|
|
36
|
-
```
|
package/ARCHITECTURE_INTRO.md
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
# Introduction
|
|
2
|
-
|
|
3
|
-
This document (and the linked documents) explains how the exports and side effects of `@microsoft/fast-element` are used to create custom elements.
|
|
4
|
-
|
|
5
|
-
## Glossary
|
|
6
|
-
|
|
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
|
-
- [`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 `ViewTemplate`.
|
|
10
|
-
- [`Updates` queue](./ARCHITECTURE_UPDATES.md): How updates to attributes and observables are processed.
|
package/ARCHITECTURE_OVERVIEW.md
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
# General FAST usage
|
|
2
|
-
|
|
3
|
-
`FASTElement` is an extension of `HTMLElement` which makes use of Custom Element APIs native to the browser. It also supplies the following methods:
|
|
4
|
-
|
|
5
|
-
- The `compose` method combines the Custom Element name, template, style, and other options to create the definition for the Custom Element.
|
|
6
|
-
- The `define` method makes use of the native Custom Element [`define()`](https://developer.mozilla.org/en-US/docs/Web/API/CustomElementRegistry/define) to register the Custom Element with a Custom Element Registry.
|
|
7
|
-
- The `from` method allows the use of Customized Built-in elements, which extend from native elements such as `HTMLButtonElement`.
|
|
8
|
-
|
|
9
|
-
### Creating a Custom Element from FASTElement
|
|
10
|
-
|
|
11
|
-
A basic developer flow for defining a custom element looks like this:
|
|
12
|
-
|
|
13
|
-
```mermaid
|
|
14
|
-
flowchart TD
|
|
15
|
-
A[Create a <code>FASTElement</code> web component by extending the <code>FASTElement</code> class] --> F
|
|
16
|
-
F[Compose with <code>FASTElement.compose</code> to include template and styles] --> G[Define the component in the browser with <code>FASTElement.define</code>]
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
Let's take a look at the compose step to see what the FAST architecture is doing at this stage.
|
|
20
|
-
|
|
21
|
-
### Composing a Custom Element
|
|
22
|
-
|
|
23
|
-
The `FASTElement.compose()` function creates a new `FASTElementDefinition`, which includes all metadata needed for the element (such as templates, attributes, and styles). The element definition is registered with the global `FAST` for re-use, and the `FASTElementDefinition` is returned. The resulting object can be retrieved via `ElementController.definition`.
|
|
24
|
-
|
|
25
|
-
## A Custom Element in JavaScript is sent to the Browser
|
|
26
|
-
|
|
27
|
-
Let's step back from defining the Custom Element and consider what is happening when we import from the `@microsoft/fast-element` package.
|
|
28
|
-
|
|
29
|
-
First, a global `FAST` property will be created if one does not already exist, typically in browser on the `window`.
|
|
30
|
-
|
|
31
|
-
Additionally, when Custom Elements are included in a script a few things might happen even before a Custom Element gets detected by the browser. First, there are initial side effects caused by the use of decorators. These include the `attr` decorator from `@microsoft/fast-element` and the `observable` decorator from `@microsoft/fast-element`.
|
|
32
|
-
|
|
33
|
-
Here is a basic flow of what code is executed and when during initial load of a script that contains a FAST defined Custom Element:
|
|
34
|
-
|
|
35
|
-
```mermaid
|
|
36
|
-
flowchart TD
|
|
37
|
-
A@{ shape: circle, label: "The browser loads the JavaScript file containing FAST and FAST Custom Element definitions" }
|
|
38
|
-
B@{ shape: rect, label: "The FAST global is added to the window" }
|
|
39
|
-
A --> B
|
|
40
|
-
C@{ shape: rect, label: "A Custom Element executes the <code>compose</code> step"}
|
|
41
|
-
B --> C
|
|
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
|
-
C --> D
|
|
44
|
-
F@{ shape: rect, label: "An HTML tagged template literal is executed for the FAST Custom Element and applied to the definition" }
|
|
45
|
-
D --> F
|
|
46
|
-
G@{ shape: rect, label: "The <code>define</code> step is hit and the <code>customElement</code> is registered with the Custom Element Registry" }
|
|
47
|
-
F --> G
|
|
48
|
-
H@{ shape: rect, label: "A Custom Element is detected on the page and the browser initializes it" }
|
|
49
|
-
I@{ shape: dbl-circ, label: "The lifecycle steps for <code>FASTElement</code> are executed" }
|
|
50
|
-
G --> H
|
|
51
|
-
H --> I
|
|
52
|
-
```
|
package/ARCHITECTURE_UPDATES.md
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
# `Updates`
|
|
2
|
-
|
|
3
|
-
The `Updates` API is part of the `FAST` global. The updates that are queued include updates to attributes, observables, and observed arrays.
|
|
4
|
-
|
|
5
|
-
## Attributes
|
|
6
|
-
|
|
7
|
-
An attribute change may be queued when the value of the attribute is updated. This change is triggered by `HTMLElement` lifecycle hook `attributeChangedCallback`. The `Updates` queue is used to try to reflect the attribute with the updated value onto the element using `DOM` APIs.
|
|
8
|
-
|
|
9
|
-
## Observables
|
|
10
|
-
|
|
11
|
-
The `Reflect` API is used to override `defineProperty` in order to observe a property on an Custom Element, this overrides the getter and setter, which allows subscribers to be notified of changes. Any changes which `set` the value are passed to the `Updates` queue.
|