feat(odsp-driver): support point-in-time loading in factory core - #28007
Sonali Deshpande (sonalideshpandemsft) merged 8 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
Adds optional point-in-time (sequence-number-based) loading support directly to OdspDocumentServiceFactoryCore, so the standard OdspDocumentServiceFactory can be used for both normal and point-in-time loads without a separate point-in-time factory class.
Changes:
- Moves the point-in-time factory capability into
OdspDocumentServiceFactoryCorevia an optionalcreatePointInTimeDocumentServicefunction property. - Updates exports so
getOdspPointInTimeDocumentServiceFactoryandIPointInTimeDocumentServiceFactoryremain available from the public package surface, while removing the dedicated point-in-time factory implementation file. - Adds coverage to ensure the local ODSP factory explicitly does not expose point-in-time loading.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/drivers/odsp-driver/src/test/odspPointInTimeDocumentServiceFactory.spec.ts | Updates imports and adds a test asserting the local factory does not expose PIT loading. |
| packages/drivers/odsp-driver/src/pointInTimeDriver/odspPointInTimeDocumentServiceFactory.ts | Removes the dedicated PIT factory implementation (logic now lives in the core factory). |
| packages/drivers/odsp-driver/src/odspDocumentServiceFactoryCore.ts | Introduces IPointInTimeDocumentServiceFactory and implements optional PIT creation on the core factory. |
| packages/drivers/odsp-driver/src/odspDocumentServiceFactory.ts | Re-exports the PIT interface and preserves getOdspPointInTimeDocumentServiceFactory on the main factory module. |
| packages/drivers/odsp-driver/src/localOdspDriver/localOdspDocumentServiceFactory.ts | Explicitly overrides createPointInTimeDocumentService to undefined for the local factory. |
| packages/drivers/odsp-driver/src/index.ts | Updates public exports to surface PIT factory function/type from odspDocumentServiceFactory. |
| packages/drivers/odsp-driver/api-report/odsp-driver.legacy.beta.api.md | Updates API report to include the new optional PIT capability on the core factory. |
| packages/drivers/odsp-driver/api-report/odsp-driver.legacy.alpha.api.md | Updates API report to include the new optional PIT capability on the core factory. |
| .changeset/ready-peaches-juggle.md | Adds a changeset documenting the new PIT capability on the standard ODSP factory. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Hi! Thank you for opening this PR. Want me to review it? Based on the diff (569 lines, 10 files), I've queued these reviewers:
How this works
|
Joshua Smithrud (Josmithr)
left a comment
There was a problem hiding this comment.
Re-opened one existing comment, and left 1 new question. Otherwise, API and docs changes look good to me. Someone who knows this space better than I do should probably approve too before merging though 😋
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 028eb841-af27-4aab-90b2-0b5a15609063
|
🔗 Found some broken links! 💔 Run a link check locally to find them. See Checking for Broken Links for more information. linkcheck output |
Bundle size comparisonBase commit: Notable changes
Per-bundle deltas
|
1336342
into
microsoft:main
… cost Moving point-in-time loading into OdspDocumentServiceFactoryCore (#28007) added static imports of the point-in-time-only code paths (OdspPointInTimeDocumentService and the version manager, whose file-version fetcher is point-in-time-only), so all of it was eagerly bundled into odspDriver.js for every ODSP consumer regardless of whether they use point-in-time loading (~+9.9KB parsed / +2.8KB gzip regression). Convert both to dynamic import() (shared webpackChunkName "odspPointInTime") so the point-in-time code splits into a separate chunk fetched only when a consumer actually performs a point-in-time load, matching the existing lazy-load pattern in odsp-driver (createNewModule, odspDocumentStorageManager, odspDocumentService). createVersionManager becomes async as a result; its private-seam stubs in the factory spec are updated to resolve. No public API change (createPointInTimeDocumentService's signature is unchanged).
… cost Moving point-in-time loading into OdspDocumentServiceFactoryCore (#28007) added static imports of the point-in-time-only code paths (OdspPointInTimeDocumentService and the version manager, whose file-version fetcher is point-in-time-only), so all of it was eagerly bundled into odspDriver.js for every ODSP consumer regardless of whether they use point-in-time loading (~+9.9KB parsed / +2.8KB gzip regression). Convert both to dynamic import() (shared webpackChunkName "odspPointInTime") so the point-in-time code splits into a separate chunk fetched only when a consumer actually performs a point-in-time load, matching the existing lazy-load pattern in odsp-driver (createNewModule, odspDocumentStorageManager, odspDocumentService). createVersionManager becomes async as a result; its private-seam stubs in the factory spec are updated to resolve. No public API change (createPointInTimeDocumentService's signature is unchanged).
… cost (#28051) ## Description Moving point-in-time loading into `OdspDocumentServiceFactoryCore` ([#28007](#28007)) added static imports of the point-in-time-only code paths — `OdspPointInTimeDocumentService` and the version manager (whose file-version fetcher is point-in-time-only). Because every ODSP consumer imports the core factory, all of that code became eagerly bundled into `odspDriver.js` regardless of whether the consumer uses point-in-time loading (~+9.9KB parsed / +2.8KB gzip regression). This converts both to dynamic `import()` calls behind a shared `webpackChunkName: "odspPointInTime"`, so the point-in-time code splits into a single separate chunk that is only fetched when a consumer actually performs a point-in-time load. This keeps the unified single-factory API from #28007 while removing the eager size cost, and matches the existing lazy-load pattern already used in odsp-driver (`createNewModule`, `odspDocumentStorageManager`, `odspDocumentService`). `createVersionManager` becomes `async` as a result (it now awaits the dynamic import). This is an internal `private` method with a single already-async caller, so there is **no public API change** — `createPointInTimeDocumentService`'s signature is unchanged and no API report is affected. ## Testing - Full odsp-driver unit suite passes (304 passing), including the point-in-time factory lineage-guard and version-manager tests. - The private-seam stubs for `createVersionManager` in `odspPointInTimeDocumentServiceFactory.spec.ts` were updated to resolve (async). - Bundle-size impact is validated via the CI bundle-size report and the office-bohemia integration pipeline. (WIP)
… cost (#28051) ## Description Moving point-in-time loading into `OdspDocumentServiceFactoryCore` ([#28007](#28007)) added static imports of the point-in-time-only code paths — `OdspPointInTimeDocumentService` and the version manager (whose file-version fetcher is point-in-time-only). Because every ODSP consumer imports the core factory, all of that code became eagerly bundled into `odspDriver.js` regardless of whether the consumer uses point-in-time loading (~+9.9KB parsed / +2.8KB gzip regression). This converts both to dynamic `import()` calls behind a shared `webpackChunkName: "odspPointInTime"`, so the point-in-time code splits into a single separate chunk that is only fetched when a consumer actually performs a point-in-time load. This keeps the unified single-factory API from #28007 while removing the eager size cost, and matches the existing lazy-load pattern already used in odsp-driver (`createNewModule`, `odspDocumentStorageManager`, `odspDocumentService`). `createVersionManager` becomes `async` as a result (it now awaits the dynamic import). This is an internal `private` method with a single already-async caller, so there is **no public API change** — `createPointInTimeDocumentService`'s signature is unchanged and no API report is affected. ## Testing - Full odsp-driver unit suite passes (304 passing), including the point-in-time factory lineage-guard and version-manager tests. - The private-seam stubs for `createVersionManager` in `odspPointInTimeDocumentServiceFactory.spec.ts` were updated to resolve (async). - Bundle-size impact is validated via the CI bundle-size report and the office-bohemia integration pipeline. (WIP)
…28152) Cherry-picks the following ODSP point-in-time loading changes from `main` into `release/client/2.118`: - #28007 - #28051 - #28055 --------- Co-authored-by: Sonali Deshpande <sdeshpande@microsoft.com> Co-authored-by: lindsnguyen <lindsnguyen@microsoft.com> Copilot-Session: 028eb841-af27-4aab-90b2-0b5a15609063
Adds optional point-in-time loading support to
OdspDocumentServiceFactoryCore. The standardOdspDocumentServiceFactoryinherits this capability, whileLocalOdspDocumentServiceFactoryleaves it undefined.This removes the separate point-in-time factory implementation while preserving the existing factory function, interface, and package exports.
This change would make it easier for bohemia to consume point-in-time load since
OdspDocumentServiceFactorywill support point-in-time loading directly.