Skip to content

(client-utils): make layer compat policy window names explicit - #28067

Open
Navin Agarwal (agarwal-navin) wants to merge 1 commit into
microsoft:mainfrom
agarwal-navin:layerCompatPolicyNaming
Open

(client-utils): make layer compat policy window names explicit#28067
Navin Agarwal (agarwal-navin) wants to merge 1 commit into
microsoft:mainfrom
agarwal-navin:layerCompatPolicyNaming

Conversation

@agarwal-navin

Copy link
Copy Markdown
Contributor

Description

LayerCompatibilityPolicyWindowMonths defines the support window for each layer boundary, but its members were named by adjacent-layer pair alone — DriverLoader, LoaderDriver, RuntimeLoader, LoaderRuntime, and so on. Which layer is the newer one and which is the older one was conveyed only by word order, and DriverLoader / LoaderDriver differ solely in that ordering. At a call site like generation - LayerCompatibilityPolicyWindowMonths.DriverLoader, the intended direction is easy to misread.

Each member now names both sides explicitly:

Before After Window
DriverLoader NewDriverOldLoader 12 months
LoaderDriver NewLoaderOldDriver 12 months
RuntimeLoader NewRuntimeOldLoader 12 months
LoaderRuntime NewLoaderOldRuntime 3 months
RuntimeDataStore NewRuntimeOldDataStore 3 months
DataStoreRuntime NewDataStoreOldRuntime 3 months

The values are unchanged, so every call site resolves to the same number and there is no behavior change. All 16 references are updated across the Loader, Runtime and DataStore layer-compat state files, plus the three Driver ones added by #27516 (local-driver, odsp-driver, routerlicious-driver), along with the doc comments that name the constant.

Variable_LayerCompatibilityPolicyWindowMonths is added to typeValidation.broken in @fluid-internal/client-utils because the exported shape of the object changed. LayerCompatibilityPolicyWindowMonths is @internal and appears in no API report, so there is no customer-facing API change and no changeset.

Follow-up to review feedback on #27516 (comment).

Reviewer Guidance

The review process is outlined in the pull request guidelines.

This is a pure rename — no values, logic, or documentation changed. The one judgment call worth a look is casing: NewDriverOldLoader (PascalCase) keeps continuity with the previous DriverLoader style, though some const-object "enums" in the repo (e.g. FluidErrorTypes) use camelCase instead.

The members of LayerCompatibilityPolicyWindowMonths were named by
adjacent-layer pair alone, so which layer is the newer one and which is
the older one was conveyed only by word order. DriverLoader and
LoaderDriver differ solely in that ordering, and at a call site such as
`generation - LayerCompatibilityPolicyWindowMonths.DriverLoader` the
intended direction is not obvious.

Each member now names both sides explicitly:

  DriverLoader     -> NewDriverOldLoader
  LoaderDriver     -> NewLoaderOldDriver
  RuntimeLoader    -> NewRuntimeOldLoader
  LoaderRuntime    -> NewLoaderOldRuntime
  RuntimeDataStore -> NewRuntimeOldDataStore
  DataStoreRuntime -> NewDataStoreOldRuntime

The values are unchanged, so every call site resolves to the same number
and there is no behavior change. A typeValidation broken entry is added
for Variable_LayerCompatibilityPolicyWindowMonths because the exported
shape of the object changed.

Follow-up to review feedback on microsoft#27516.
Copilot AI lite review requested due to automatic review settings August 25, 2026 18:09
@github-actions github-actions Bot added area: tools area: runtime Runtime related issues area: loader Loader related issues area: driver Driver related issues area: repo Repo related work area: website area: odsp-driver base: main PRs targeted against main branch labels Aug 25, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Hi! Thank you for opening this PR. Want me to review it?

Based on the diff (79 lines, 9 files), I've queued these reviewers:

  • Correctness — logic errors, race conditions, lifecycle issues
  • Security — vulnerabilities, secret exposure, injection
  • API Compatibility — breaking changes, release tags, type design
  • Performance — algorithmic regressions, memory leaks
  • Testing — coverage gaps, hollow tests

How this works

  • Adjust the reviewer set by ticking/unticking boxes above. Reviewer toggles alone don't trigger anything.

  • Tick Start review below to dispatch the review fleet.

  • After review finishes, tick Start review again to request another run — it auto-resets after each dispatch.

  • This comment updates as new commits land; your reviewer selections are preserved.

  • Start review

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@agarwal-navin Navin Agarwal (agarwal-navin) changed the title chore(client-utils): make layer compat policy window names explicit (client-utils): make layer compat policy window names explicit Aug 25, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Bundle size comparison

Base commit: e4c4feace03bbb55fba6cb125a8b9ce5b9eca400
Head commit: 2f5d9a570250359f74b06844b7442427db24c6b0

Notable changes

No bundles changed by ≥ 500 bytes parsed.

Per-bundle deltas

@fluid-example/bundle-size-tests

  • fluidFrameworkAllAlpha.js: parsed 790593 → 790651 (+58), gzip 217166 → 217241 (+75)
  • azureClient.js: parsed 633339 → 633334 (-5), gzip 169746 → 169818 (+72)
  • odspClient.js: parsed 604608 → 604717 (+109), gzip 162547 → 162684 (+137)
  • aqueduct.js: parsed 537215 → 537228 (+13), gzip 144316 → 144360 (+44)
  • fluidFramework.js: parsed 409151 → 409184 (+33), gzip 115982 → 116007 (+25)
  • sharedTree.js: parsed 398530 → 398556 (+26), gzip 113400 → 113420 (+20)
  • containerRuntime.js: parsed 314014 → 313992 (-22), gzip 86160 → 86155 (-5)
  • sharedString.js: parsed 175205 → 175212 (+7), gzip 49660 → 49666 (+6)
  • experimentalSharedTree.js: parsed 161812 → 161812 (0), gzip 46711 → 46711 (0)
  • matrix.js: parsed 159584 → 159591 (+7), gzip 45903 → 45910 (+7)
  • loader.js: parsed 147289 → 147305 (+16), gzip 40028 → 40037 (+9)
  • odspDriver.js: parsed 105655 → 105713 (+58), gzip 32926 → 32991 (+65)
  • directory.js: parsed 65635 → 65642 (+7), gzip 18481 → 18490 (+9)
  • 578.js: parsed 58686 → 58686 (0), gzip 17657 → 17657 (0)
  • odspPrefetchSnapshot.js: parsed 45884 → 45865 (-19), gzip 15335 → 15351 (+16)
  • map.js: parsed 45786 → 45793 (+7), gzip 14109 → 14116 (+7)
  • 252.js: parsed 44362 → 44362 (0), gzip 13735 → 13735 (0)
  • summarizerDelayLoadedModule.js: parsed 31287 → 31287 (0), gzip 7929 → 7929 (0)
  • socketModule.js: parsed 26992 → 26962 (-30), gzip 8019 → 8052 (+33)
  • createNewModule.js: parsed 12464 → 12464 (0), gzip 4792 → 4805 (+13)
  • summaryModule.js: parsed 3888 → 3888 (0), gzip 1874 → 1874 (0)
  • connectionState.js: parsed 909 → 909 (0), gzip 500 → 500 (0)
  • sharedTreeAttributes.js: parsed 845 → 852 (+7), gzip 493 → 503 (+10)
  • debugAssert.js: parsed 429 → 429 (0), gzip 299 → 299 (0)
  • FluidFramework-HashFallback.js: parsed 419 → 419 (0), gzip 313 → 313 (0)

@markfields Mark Fields (markfields) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

* "Variable_LayerCompatibilityPolicyWindowMonths": {"backCompat": false}
*/
// @ts-expect-error compatibility expected to be broken
declare type current_as_old_for_Variable_LayerCompatibilityPolicyWindowMonths = requireAssignableTo<TypeOnly<typeof current.LayerCompatibilityPolicyWindowMonths>, TypeOnly<typeof old.LayerCompatibilityPolicyWindowMonths>>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we have type tests for internal exports?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: driver Driver related issues area: loader Loader related issues area: odsp-driver area: repo Repo related work area: runtime Runtime related issues area: tools area: website base: main PRs targeted against main branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants