refactor: modularize Schema, ObserverMap, and AttributeMap in fast-html#7478
Merged
janechu merged 2 commits intoreleases/fast-element-v3from Apr 22, 2026
Conversation
Move configuration types and constants to their owning modules, reversing the dependency direction so that observer-map.ts and attribute-map.ts no longer import from template.ts: - ObserverMapConfig, ObserverMapPathEntry, ObserverMapPathNode, and ObserverMapOption moved from template.ts to observer-map.ts - AttributeMapConfig and AttributeMapOption moved from template.ts to attribute-map.ts - Schema.jsonSchemaMap (static) replaced with instance-level schemaMap and module-level schemaRegistry for cross-element $ref resolution - Schema, AttributeMap, schemaRegistry, JSONSchema, and CachedPathMap added to the public API exports - Updated DESIGN.md, SCHEMA_OBSERVER_MAP.md, MIGRATION.md, and api-report BREAKING CHANGE: Schema.jsonSchemaMap removed; use schemaRegistry export. Config types now imported from their owning modules. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
dd95c17 to
c926ac0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request
📖 Description
Modularize Schema, ObserverMap, and AttributeMap in
@microsoft/fast-htmlto reduce tight coupling with TemplateElement. This is a breaking change.Key changes:
ObserverMapConfig,ObserverMapPathEntry,ObserverMapPathNode, andObserverMapOptionfromtemplate.tstoobserver-map.tsAttributeMapConfigandAttributeMapOptionfromtemplate.tstoattribute-map.tsSchema.jsonSchemaMap(static property) with an instance-levelschemaMapand a module-levelschemaRegistryexport for cross-element$refresolutionSchema,AttributeMap,schemaRegistry,JSONSchema, andCachedPathMapto the public API exportstemplate.tsnow imports fromobserver-map.tsandattribute-map.ts, instead of the other way around👩💻 Reviewer Notes
The module dependency direction is now:
📑 Test Plan
All 873 existing tests pass across Chromium, Firefox, and WebKit. No new tests were needed as the refactor preserves all existing behavior — only the internal module boundaries and export surface changed.
✅ Checklist
General
$ npm run change