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
@@ -199,11 +199,11 @@ An optional layer that uses the `Schema` to automatically register `@attr`-style
199
199
-`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`.
200
200
201
201
Enabled via the `attributeMap()` definition extension exported from
202
-
`@microsoft/fast-element`. Calling `attributeMap()` without arguments uses the
203
-
default `"camelCase"` strategy. To preserve binding keys exactly as written,
templates, `attributeMap()` uses the optional `schema` on the FAST element
206
-
definition.
202
+
`@microsoft/fast-element/attribute-map.js`. Calling `attributeMap()` without
203
+
arguments uses the default `"camelCase"` strategy. To preserve binding keys
204
+
exactly as written, pass `attributeMap({ "attribute-name-strategy": "none" })`.
205
+
Outside declarative templates, `attributeMap()` uses the optional `schema` on the
206
+
FAST element definition.
207
207
208
208
### Syntax constants (`syntax.ts`)
209
209
@@ -275,42 +275,48 @@ Schema transforms run in deterministic order. `attributeMap()` runs before
275
275
import {
276
276
declarativeTemplate,
277
277
TemplateParser,
278
+
typeResolvedStringsAndValues,
279
+
} from"@microsoft/fast-element/declarative.js";
280
+
import {
278
281
Schema,
279
282
schemaRegistry,
280
283
typeCachedPathMap,
281
-
typeFASTElementExtension,
282
284
typeJSONSchema,
283
-
typeResolvedStringsAndValues,
285
+
} from"@microsoft/fast-element/schema.js";
286
+
import {
287
+
typeFASTElementExtension,
284
288
typeTemplateLifecycleCallbacks,
289
+
} from"@microsoft/fast-element";
290
+
import {
285
291
attributeMap,
286
292
typeAttributeMapConfig,
293
+
} from"@microsoft/fast-element/attribute-map.js";
294
+
import {
287
295
observerMap,
288
296
typeObserverMapConfig,
289
297
typeObserverMapPathEntry,
290
298
typeObserverMapPathNode,
291
-
} from"@microsoft/fast-element";
299
+
} from"@microsoft/fast-element/observer-map.js";
292
300
```
293
301
294
-
The root entrypoint exports the declarative template helpers, map helpers, and
295
-
their configuration types. Focused path exports are also available for direct
296
-
entrypoint imports.
302
+
Declarative template helpers, map helpers, and their configuration types are
303
+
available from focused path exports.
297
304
298
-
Primary exports from `@microsoft/fast-element` intended for
299
-
application code:
305
+
Primary declarative exports intended for application code:
300
306
301
307
| Export | Purpose |
302
308
|---|---|
303
-
|`declarativeTemplate()`|Template resolver for `FASTElement.define()`; auto-defines the internal `<f-template>` publisher and waits for the matching template. |
304
-
|`TemplateParser`|Standalone parser that converts declarative HTML into `ViewTemplate` strings/values. Can be used independently of `<f-template>` for programmatic template compilation. |
305
-
|`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. |
306
-
|`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). |
309
+
|`declarativeTemplate()`|`@microsoft/fast-element/declarative.js` template resolver for `FASTElement.define()`; auto-defines the internal `<f-template>` publisher and waits for the matching template. |
310
+
|`TemplateParser`|`@microsoft/fast-element/declarative.js` standalone parser that converts declarative HTML into `ViewTemplate` strings/values. Can be used independently of `<f-template>` for programmatic template compilation. |
311
+
|`Schema`|`@microsoft/fast-element/schema.js`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. |
312
+
|`schemaRegistry`|`@microsoft/fast-element/schema.js` 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). |
307
313
308
314
Primary map extension exports:
309
315
310
316
| Export | Import path | Purpose |
311
317
|---|---|---|
312
-
|`attributeMap()`|`@microsoft/fast-element`| Define extension that registers `@attr`-style properties for leaf bindings discovered during parsing or supplied by `definition.schema`. |
313
-
|`observerMap()`|`@microsoft/fast-element`| Define extension that defines observable root properties and proxy-based deep change tracking from `config.schema`, `definition.schema`, or a declarative template schema. |
318
+
|`attributeMap()`|`@microsoft/fast-element/attribute-map.js`| Define extension that registers `@attr`-style properties for leaf bindings discovered during parsing or supplied by `definition.schema`. |
319
+
|`observerMap()`|`@microsoft/fast-element/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. |
314
320
315
321
The implementation element class (`<f-template>`), `TemplateElement.config()`,
316
322
`TemplateElement.options()`, `ElementOptions*`, and
@@ -329,14 +335,14 @@ Additionally, `@microsoft/fast-element` exports these types:
329
335
|`JSONSchema`|`components/schema.ts`| JSON Schema interface used by `Schema` for property structure. |
330
336
|`CachedPathMap`|`components/schema.ts`|`Map<string, Map<string, JSONSchema>>` — the shape of the schema registry. |
331
337
332
-
The root entrypoint exports the map configuration types:
338
+
The map configuration types are exported from the same map-specific paths:
333
339
334
340
| Type | Import path | Purpose |
335
341
|---|---|---|
336
-
|`ObserverMapConfig`|`@microsoft/fast-element`| Configuration object for `observerMap()`; accepts optional `schema` and `properties` keys. |
337
-
|`ObserverMapPathEntry`|`@microsoft/fast-element`|`boolean \| ObserverMapPathNode` — a node in the observation path tree. |
338
-
|`ObserverMapPathNode`|`@microsoft/fast-element`| Object node with optional `$observe` and child property overrides. |
339
-
|`AttributeMapConfig`|`@microsoft/fast-element`| Configuration object for `attributeMap()`; accepts `attribute-name-strategy`. |
342
+
|`ObserverMapConfig`|`@microsoft/fast-element/observer-map.js`| Configuration object for `observerMap()`; accepts optional `schema` and `properties` keys. |
343
+
|`ObserverMapPathEntry`|`@microsoft/fast-element/observer-map.js`|`boolean \| ObserverMapPathNode` — a node in the observation path tree. |
344
+
|`ObserverMapPathNode`|`@microsoft/fast-element/observer-map.js`| Object node with optional `$observe` and child property overrides. |
345
+
|`AttributeMapConfig`|`@microsoft/fast-element/attribute-map.js`| Configuration object for `attributeMap()`; accepts `attribute-name-strategy`. |
Copy file name to clipboardExpand all lines: packages/fast-element/DECLARATIVE_MIGRATION.md
+5-6Lines changed: 5 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -174,7 +174,7 @@ implementation is internal and is defined automatically by `declarativeTemplate(
174
174
|`AttributeMap` / `ObserverMap` class exports from the old declarative public surface |`attributeMap()` / `observerMap()` extension helpers and their config types |
175
175
176
176
Hydration is also no longer installed by `@microsoft/fast-element`.
177
-
Call `enableHydration()` from `@microsoft/fast-element` before FAST
177
+
Call `enableHydration()` from `@microsoft/fast-element/hydration.js` before FAST
178
178
elements connect when prerendered Declarative Shadow DOM should be reused.
179
179
180
180
## Schema-driven maps and optional definition schema
@@ -184,8 +184,8 @@ factored away from declarative templating. Import them from
184
184
`@microsoft/fast-element` for declarative or non-declarative use:
0 commit comments