Skip to content

Commit

Permalink
Narrower scope for map1.4 import
Browse files Browse the repository at this point in the history
  • Loading branch information
alexvy86 committed Jan 31, 2025
1 parent 0c79283 commit 173a74a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 67 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,14 @@
"@fluidframework/core-interfaces": "workspace:~",
"@fluidframework/counter": "workspace:~",
"@fluidframework/datastore-definitions": "workspace:~",
"@fluidframework/map-1dot4": "npm:@fluidframework/map@^1.4.0",
"@fluidframework/runtime-definitions": "workspace:~",
"@fluidframework/telemetry-utils": "workspace:~",
"@fluidframework/test-runtime-utils": "workspace:~",
"@fluidframework/test-utils": "workspace:~",
"axios": "^1.7.7",
"cross-env": "^7.0.3",
"fluid-framework": "workspace:~",
"fluid-framework-legacy": "npm:fluid-framework@^1.4.0",
"mocha": "^10.2.0",
"mocha-multi-reporters": "^1.5.1",
"moment": "^2.21.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ import {
MessageType,
ISequencedDocumentMessage,
} from "@fluidframework/driver-definitions/internal";
import { SharedMap as SharedMap_1dot4 } from "@fluidframework/map-1dot4";
import { MockLogger } from "@fluidframework/telemetry-utils/internal";
import { timeoutPromise } from "@fluidframework/test-utils/internal";
import { AxiosResponse } from "axios";
import { ContainerSchema, type IFluidContainer } from "fluid-framework";
// eslint-disable-next-line import/no-internal-modules -- Need SharedMap to test it
import { SharedMap } from "fluid-framework/legacy";
import { SharedMap as SharedMapLegacy } from "fluid-framework-legacy";
import type { SinonSandbox } from "sinon";
import { createSandbox } from "sinon";

Expand Down Expand Up @@ -286,7 +286,7 @@ for (const testOpts of testMatrix) {

const schemaLegacy = {
initialObjects: {
map1: SharedMapLegacy,
map1: SharedMap_1dot4,
},
};

Expand Down Expand Up @@ -325,7 +325,7 @@ for (const testOpts of testMatrix) {
(resolve) => {
const confirmValueSet = (): void => {
if (
(containerLegacy.initialObjects.map1 as SharedMapLegacy).get("key") === "value"
(containerLegacy.initialObjects.map1 as SharedMap_1dot4).get("key") === "value"
) {
containerLegacy.off("saved", confirmValueSet);
resolve();
Expand All @@ -338,7 +338,7 @@ for (const testOpts of testMatrix) {
errorMsg: "valueSet timeout",
},
);
(containerLegacy.initialObjects.map1 as SharedMapLegacy).set("key", "value");
(containerLegacy.initialObjects.map1 as SharedMap_1dot4).set("key", "value");

// Await the value being saved, especially important if we dispose the legacy container.
await valueSetP;
Expand Down Expand Up @@ -393,7 +393,7 @@ for (const testOpts of testMatrix) {

const schemaLegacy = {
initialObjects: {
map1: SharedMapLegacy,
map1: SharedMap_1dot4,
},
};

Expand Down Expand Up @@ -451,7 +451,7 @@ for (const testOpts of testMatrix) {
});
}

const result = (containerLegacy.initialObjects.map1 as SharedMapLegacy).get<string>(
const result = (containerLegacy.initialObjects.map1 as SharedMap_1dot4).get<string>(
"key",
);
assert.strictEqual(result, "value", "Value not found in copied container");
Expand Down Expand Up @@ -581,7 +581,7 @@ for (const testOpts of testMatrix) {
});
}

const legacyMap = containerLegacy.initialObjects.map1 as SharedMapLegacy;
const legacyMap = containerLegacy.initialObjects.map1 as SharedMap_1dot4;

// Verify ops are processed by legacy AzureClient
assert.strictEqual(legacyMap.get("1"), 1);
Expand Down
62 changes: 3 additions & 59 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 173a74a

Please sign in to comment.