You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: change/@microsoft-fast-element-61e3e3bd-e227-4449-9ff6-8edc104819d9.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
{
2
2
"type": "major",
3
-
"comment": "Move declarative HTML APIs into @microsoft/fast-element/declarative.js and remove the @microsoft/fast-html package.",
3
+
"comment": "Move declarative HTML APIs into @microsoft/fast-element/declarative.js, expose schema map helpers from extension subpaths, and remove the @microsoft/fast-html package.",
Copy file name to clipboardExpand all lines: packages/fast-element/DECLARATIVE_DESIGN.md
+38-29Lines changed: 38 additions & 29 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -118,11 +118,10 @@ An optional layer that uses the `Schema` to automatically:
118
118
- Install property-change handlers that wrap newly assigned objects/arrays in `Proxy` instances.
119
119
- Propagate deep property mutations back through FAST's observable system so bindings re-render.
120
120
121
-
Enabled via the `observerMap()` definition extension. Prefer importing the
122
-
extension from `@microsoft/fast-element/extensions/observer-map.js`; the
123
-
declarative entrypoint continues to re-export it for existing declarative
124
-
imports. Calling `observerMap()` without arguments observes all root properties
125
-
discovered in the template or supplied schema.
121
+
Enabled via the `observerMap()` definition extension. Import the extension from
122
+
`@microsoft/fast-element/extensions/observer-map.js`; the declarative entrypoint
123
+
does not re-export it. Calling `observerMap()` without arguments observes all
124
+
root properties discovered in the template or supplied schema.
126
125
127
126
#### Path-level observation control
128
127
@@ -202,12 +201,11 @@ An optional layer that uses the `Schema` to automatically register `@attr`-style
202
201
- Properties already decorated with `@attr` or `@observable` are left untouched.
203
202
-`FASTElementDefinition.attributeLookup` is keyed by the HTML attribute name, and `propertyLookup` is keyed by the JS property name so `attributeChangedCallback` correctly delegates to the new `AttributeDefinition`.
204
203
205
-
Enabled via the `attributeMap()` definition extension. Prefer importing the
206
-
extension from `@microsoft/fast-element/extensions/attribute-map.js`; the
207
-
declarative entrypoint continues to re-export it for existing declarative
208
-
imports. Calling `attributeMap()` without arguments uses the default
209
-
`"camelCase"` strategy. To preserve binding keys exactly as written, pass
`@microsoft/fast-element/declarative.js` still re-exports `attributeMap()`,
311
-
`observerMap()`, and their configuration types for existing declarative imports.
312
-
The extension subpaths are preferred when a consumer only needs the maps or is
313
-
using manually supplied schemas.
308
+
The declarative entrypoint does not re-export the map helpers or their
309
+
configuration types. Use the extension subpaths whether the maps are paired with
310
+
declarative templates or manually supplied schemas.
314
311
315
-
Primary exports intended for application code:
312
+
Primary exports from `@microsoft/fast-element/declarative.js` intended for
313
+
application code:
316
314
317
315
| Export | Purpose |
318
316
|---|---|
319
317
|`declarativeTemplate()`| Template resolver for `FASTElement.define()`; auto-defines the internal `<f-template>` publisher and waits for the matching template. |
320
-
|`attributeMap()`| Define extension that registers `@attr`-style properties for leaf bindings discovered during parsing or supplied by `definition.schema`. |
321
-
|`observerMap()`| Define extension that defines observable root properties and proxy-based deep change tracking from `config.schema`, `definition.schema`, or a declarative template schema. |
322
318
|`TemplateParser`| Standalone parser that converts declarative HTML into `ViewTemplate` strings/values. Can be used independently of `<f-template>` for programmatic template compilation. |
323
319
|`Schema`| JSON schema builder that records binding paths discovered during template parsing. Each instance owns its own schema map and registers itself in the `schemaRegistry` for cross-element `$ref` resolution. |
324
320
|`schemaRegistry`| Module-level `Map<string, Map<string, JSONSchema>>` that indexes schemas by custom element name. Used for cross-element lookups (e.g. nested component `$ref` resolution). |
325
321
322
+
Primary map extension exports:
323
+
324
+
| Export | Public subpath | Purpose |
325
+
|---|---|---|
326
+
|`attributeMap()`|`@microsoft/fast-element/extensions/attribute-map.js`| Define extension that registers `@attr`-style properties for leaf bindings discovered during parsing or supplied by `definition.schema`. |
327
+
|`observerMap()`|`@microsoft/fast-element/extensions/observer-map.js`| Define extension that defines observable root properties and proxy-based deep change tracking from `config.schema`, `definition.schema`, or a declarative template schema. |
328
+
326
329
The implementation element class (`<f-template>`), `TemplateElement.config()`,
327
330
`TemplateElement.options()`, `ElementOptions*`, and
328
331
`HydrationLifecycleCallbacks` are not exported from the public declarative
329
-
entrypoint. Use `declarativeTemplate()`, `attributeMap()`, `observerMap()`, and
330
-
`enableHydration()` instead. The `AttributeMap` and `ObserverMap` implementation
331
-
classes are available from their extension subpaths for advanced scenarios, but
332
-
application code should normally use the extension factories.
332
+
entrypoint. Use `declarativeTemplate()`, extension subpath `attributeMap()` and
333
+
`observerMap()`, and `enableHydration()` instead. The `AttributeMap` and
334
+
`ObserverMap` implementation classes are available from their extension subpaths
335
+
for advanced scenarios, but application code should normally use the extension
336
+
factories.
333
337
334
-
Additionally, the following types are exported:
338
+
Additionally, `@microsoft/fast-element/declarative.js` exports these types:
335
339
336
340
| Type | Source Module | Purpose |
337
341
|---|---|---|
338
342
|`FASTElementExtension`|`fast-definitions.ts`| Definition extension callback signature used by `attributeMap()` and `observerMap()`. |
339
343
|`TemplateLifecycleCallbacks`|`fast-definitions.ts`| Per-element lifecycle callbacks accepted by `declarativeTemplate()`. |
340
-
|`ObserverMapConfig`|`extensions/observer-map.ts`| Configuration object for `observerMap()`; accepts optional `schema` and `properties` keys. |
341
-
|`ObserverMapPathEntry`|`observer-map.ts`|`boolean \| ObserverMapPathNode` — a node in the observation path tree. |
342
-
|`ObserverMapPathNode`|`observer-map.ts`| Object node with optional `$observe` and child property overrides. |
343
-
|`AttributeMapConfig`|`extensions/attribute-map.ts`| Configuration object for `attributeMap()`; accepts `attribute-name-strategy`. |
344
344
|`JSONSchema`|`components/schema.ts`| JSON Schema interface used by `Schema` for property structure. |
345
345
|`CachedPathMap`|`components/schema.ts`|`Map<string, Map<string, JSONSchema>>` — the shape of the schema registry. |
346
346
347
+
The extension subpaths export their own configuration types:
348
+
349
+
| Type | Public subpath | Purpose |
350
+
|---|---|---|
351
+
|`ObserverMapConfig`|`@microsoft/fast-element/extensions/observer-map.js`| Configuration object for `observerMap()`; accepts optional `schema` and `properties` keys. |
352
+
|`ObserverMapPathEntry`|`@microsoft/fast-element/extensions/observer-map.js`|`boolean \| ObserverMapPathNode` — a node in the observation path tree. |
353
+
|`ObserverMapPathNode`|`@microsoft/fast-element/extensions/observer-map.js`| Object node with optional `$observe` and child property overrides. |
354
+
|`AttributeMapConfig`|`@microsoft/fast-element/extensions/attribute-map.js`| Configuration object for `attributeMap()`; accepts `attribute-name-strategy`. |
0 commit comments