-
Notifications
You must be signed in to change notification settings - Fork 637
docs: add deepMerge array replacement migration guidance in fast-html聽#7583
Copy link
Copy link
Open
Labels
area:fast-elementPertains to fast-elementPertains to fast-elementarea:ssrPertains to SSR.Pertains to SSR.breaking-changeA breaking change to a shipping packageA breaking change to a shipping packagechoreMaintenance or non-code workMaintenance or non-code workdocs:articleAdditions, improvements, or fixes to site articlesAdditions, improvements, or fixes to site articlesfast-element-v3Pertains to fast-element-v3Pertains to fast-element-v3status:plannedWork is plannedWork is planned
Description
Activity
Metadata
Metadata
Assignees
Labels
area:fast-elementPertains to fast-elementPertains to fast-elementarea:ssrPertains to SSR.Pertains to SSR.breaking-changeA breaking change to a shipping packageA breaking change to a shipping packagechoreMaintenance or non-code workMaintenance or non-code workdocs:articleAdditions, improvements, or fixes to site articlesAdditions, improvements, or fixes to site articlesfast-element-v3Pertains to fast-element-v3Pertains to fast-element-v3status:plannedWork is plannedWork is planned
馃檵 Feature Request
Add migration guidance for the
deepMergearray replacement behavior introduced by #7559 in@microsoft/fast-html.馃 Expected Behavior
Consumers should be able to find a concise note explaining that observerMap-managed array properties are replaced during
deepMergeinstead of mutated in place. The guidance should recommend re-reading arrays from the owning object afterdeepMergerather than relying on previously captured references.The note should also clarify that
f-repeatbindings observe the new array reference automatically when the owning property is notified.馃槸 Current Behavior
The README and DESIGN docs mention that observerMap-managed arrays are replaced during
deepMerge, and the change file uses abreaking:prefix. However, consumers reading release notes or migration guidance may not realize that code holding a stale reference to an observerMap-managed array now reads disconnected data.Example:
The exported
deepMergehelper also has a broader compatibility surface for direct consumers that relied on in-place array mutation.馃拋 Possible Solution
Add a short migration subsection to the
@microsoft/fast-htmlREADME, package docs, or changelog location used for breaking/prerelease notes. Include:deepMerge;obj.arrafterdeepMergeinstead of caching the reference;f-repeatbindings, which observe the new reference automatically;deepMergehelper that relied on in-place array mutation.馃敠 Context
PR #7559 intentionally changed observerMap
deepMergearray behavior to avoid synchronous reentrant array notification work. This issue makes the migration impact explicit for consumers and future maintainers.Searched existing issues for overlapping deepMerge array replacement migration docs and did not find a duplicate.
馃捇 Examples
Before relying on a cached reference:
Preferred pattern: