Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion build-tools/lerna.json

This file was deleted.

2 changes: 1 addition & 1 deletion build-tools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"build:compile": "fluid-build --task compile",
"build:docs": "fluid-build --task build:docs",
"build:fast": "fluid-build --worker",
"changelog": "conventional-changelog -p conventionalcommits -i CHANGELOG.md -s -r 2 --commit-path . -t build-tools_v --context lerna.json",
"changelog": "conventional-changelog -p conventionalcommits -i CHANGELOG.md -s -r 2 --commit-path . -t build-tools_v",
"check:biome": "biome check .",
"check:format": "npm run check:biome",
"checks": "fluid-build --task checks",
Expand Down
2 changes: 1 addition & 1 deletion common/build/eslint-config-fluid/.prettierignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Generated by npm / Lerna
# Generated by npm
package-lock.json

# Dependencies
Expand Down
1 change: 0 additions & 1 deletion examples/data-objects/codemirror/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@
"@fluidframework/datastore": "workspace:~",
"@fluidframework/datastore-definitions": "workspace:~",
"@fluidframework/map": "workspace:~",
"@fluidframework/request-handler": "workspace:~",
"@fluidframework/runtime-definitions": "workspace:~",
"@fluidframework/runtime-utils": "workspace:~",
"@fluidframework/sequence": "workspace:~",
Expand Down
32 changes: 3 additions & 29 deletions examples/data-objects/codemirror/src/codeMirror.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,14 @@
*/

import { EventEmitter } from "@fluid-example/example-utils";
import {
IFluidHandle,
IFluidLoadable,
IRequest,
IResponse,
} from "@fluidframework/core-interfaces";
import {
FluidDataStoreRuntime,
FluidObjectHandle,
mixinRequestHandler,
} from "@fluidframework/datastore/legacy";
import { IFluidHandle, IFluidLoadable } from "@fluidframework/core-interfaces";
import { FluidDataStoreRuntime, FluidObjectHandle } from "@fluidframework/datastore/legacy";
import { IFluidDataStoreRuntime } from "@fluidframework/datastore-definitions/legacy";
import { ISharedMap, SharedMap } from "@fluidframework/map/legacy";
import {
IFluidDataStoreContext,
IFluidDataStoreFactory,
} from "@fluidframework/runtime-definitions/legacy";
import { create404Response } from "@fluidframework/runtime-utils/legacy";
// eslint-disable-next-line import/no-internal-modules -- #26904: `sequence` internals used in examples
import { reservedTileLabelsKey } from "@fluidframework/sequence/internal";
import { ReferenceType, SharedString } from "@fluidframework/sequence/legacy";
Expand Down Expand Up @@ -83,12 +73,6 @@ export class CodeMirrorComponent extends EventEmitter implements IFluidLoadable
this.root = (await this.runtime.getChannel("root")) as ISharedMap;
this._text = await this.root.get<IFluidHandle<SharedString>>("text")?.get();
}

public async request(req: IRequest): Promise<IResponse> {
return req.url === "" || req.url === "/" || req.url.startsWith("/?")
? { mimeType: "fluid/object", status: 200, value: this }
: create404Response(req);
}
}

/**
Expand All @@ -103,17 +87,7 @@ export class SmdeFactory implements IFluidDataStoreFactory {
}

public async instantiateDataStore(context: IFluidDataStoreContext, existing: boolean) {
// request mixin in
const runtimeClass = mixinRequestHandler(
async (request: IRequest, runtimeArg: FluidDataStoreRuntime) => {
// The provideEntryPoint callback below always returns CodeMirrorComponent, so this cast is safe
const dataObject = (await runtimeArg.entryPoint.get()) as CodeMirrorComponent;
return dataObject.request?.(request);
},
FluidDataStoreRuntime,
);

return new runtimeClass(
return new FluidDataStoreRuntime(
context,
new Map(
[SharedMap.getFactory(), SharedString.getFactory()].map((factory) => [
Expand Down
1 change: 0 additions & 1 deletion examples/data-objects/prosemirror/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@
"@fluidframework/datastore-definitions": "workspace:~",
"@fluidframework/map": "workspace:~",
"@fluidframework/merge-tree": "workspace:~",
"@fluidframework/request-handler": "workspace:~",
"@fluidframework/runtime-definitions": "workspace:~",
"@fluidframework/runtime-utils": "workspace:~",
"@fluidframework/sequence": "workspace:~",
Expand Down
32 changes: 3 additions & 29 deletions examples/data-objects/prosemirror/src/prosemirror.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,14 @@
/* eslint-disable @typescript-eslint/no-non-null-assertion */

import { EventEmitter } from "@fluid-example/example-utils";
import {
IFluidHandle,
IFluidLoadable,
IRequest,
IResponse,
} from "@fluidframework/core-interfaces";
import {
FluidDataStoreRuntime,
FluidObjectHandle,
mixinRequestHandler,
} from "@fluidframework/datastore/legacy";
import { IFluidHandle, IFluidLoadable } from "@fluidframework/core-interfaces";
import { FluidDataStoreRuntime, FluidObjectHandle } from "@fluidframework/datastore/legacy";
import { IFluidDataStoreRuntime } from "@fluidframework/datastore-definitions/legacy";
import { ISharedMap, SharedMap } from "@fluidframework/map/legacy";
import {
IFluidDataStoreContext,
IFluidDataStoreFactory,
} from "@fluidframework/runtime-definitions/legacy";
import { create404Response } from "@fluidframework/runtime-utils/legacy";
// eslint-disable-next-line import/no-internal-modules -- #26904: `sequence` internals used in examples
import { reservedRangeLabelsKey } from "@fluidframework/sequence/internal";
import { ReferenceType, SharedString } from "@fluidframework/sequence/legacy";
Expand Down Expand Up @@ -120,12 +110,6 @@ export class ProseMirror
// eslint-disable-next-line @typescript-eslint/dot-notation
window["easyComponent"] = this;
}

public async request(req: IRequest): Promise<IResponse> {
return req.url === "" || req.url === "/" || req.url.startsWith("/?")
? { mimeType: "fluid/object", status: 200, value: this }
: create404Response(req);
}
}

/**
Expand All @@ -140,17 +124,7 @@ export class ProseMirrorFactory implements IFluidDataStoreFactory {
}

public async instantiateDataStore(context: IFluidDataStoreContext, existing: boolean) {
// request mixin in
const runtimeClass = mixinRequestHandler(
async (request: IRequest, runtimeArg: FluidDataStoreRuntime) => {
// The provideEntryPoint callback below always returns ProseMirror, so this cast is safe
const dataObject = (await runtimeArg.entryPoint.get()) as ProseMirror;
return dataObject.request?.(request);
},
FluidDataStoreRuntime,
);

return new runtimeClass(
return new FluidDataStoreRuntime(
context,
new Map(
[SharedMap.getFactory(), SharedString.getFactory()].map((factory) => [
Expand Down
1 change: 0 additions & 1 deletion lerna.json

This file was deleted.

20 changes: 0 additions & 20 deletions packages/dds/map/src/directory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,6 @@ interface IDirectoryMessageHandler {

/**
* Operation indicating a value should be set for a key.
* @legacy
* @alpha
*/
export interface IDirectorySetOperation {
/**
Expand All @@ -113,8 +111,6 @@ export interface IDirectorySetOperation {

/**
* Operation indicating a key should be deleted from the directory.
* @legacy
* @alpha
*/
export interface IDirectoryDeleteOperation {
/**
Expand All @@ -135,15 +131,11 @@ export interface IDirectoryDeleteOperation {

/**
* An operation on a specific key within a directory.
* @legacy
* @alpha
*/
export type IDirectoryKeyOperation = IDirectorySetOperation | IDirectoryDeleteOperation;

/**
* Operation indicating the directory should be cleared.
* @legacy
* @alpha
*/
export interface IDirectoryClearOperation {
/**
Expand All @@ -159,15 +151,11 @@ export interface IDirectoryClearOperation {

/**
* An operation on one or more of the keys within a directory.
* @legacy
* @alpha
*/
export type IDirectoryStorageOperation = IDirectoryKeyOperation | IDirectoryClearOperation;

/**
* Operation indicating a subdirectory should be created.
* @legacy
* @alpha
*/
export interface IDirectoryCreateSubDirectoryOperation {
/**
Expand All @@ -188,8 +176,6 @@ export interface IDirectoryCreateSubDirectoryOperation {

/**
* Operation indicating a subdirectory should be deleted.
* @legacy
* @alpha
*/
export interface IDirectoryDeleteSubDirectoryOperation {
/**
Expand All @@ -210,17 +196,13 @@ export interface IDirectoryDeleteSubDirectoryOperation {

/**
* An operation on the subdirectories within a directory.
* @legacy
* @alpha
*/
export type IDirectorySubDirectoryOperation =
| IDirectoryCreateSubDirectoryOperation
| IDirectoryDeleteSubDirectoryOperation;

/**
* Any operation on a directory.
* @legacy
* @alpha
*/
export type IDirectoryOperation = IDirectoryStorageOperation | IDirectorySubDirectoryOperation;

Expand Down Expand Up @@ -424,8 +406,6 @@ class DirectoryCreationTracker {
* ```
*
* @sealed
* @legacy
* @alpha
*/
export class SharedDirectory
extends SharedObject<ISharedDirectoryEvents>
Expand Down
3 changes: 2 additions & 1 deletion packages/dds/map/src/directoryFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ import { pkgVersion } from "./packageVersion.js";

/**
* {@link @fluidframework/datastore-definitions#IChannelFactory} for {@link ISharedDirectory}.
*
* @privateRemarks
* TODO: AB#35245: Deprecate and stop exporting this class.
* @sealed
* @legacy
* @alpha
Expand Down
10 changes: 7 additions & 3 deletions packages/dds/map/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,15 @@ export type {
ISharedMapEvents,
IValueChanged,
} from "./interfaces.js";
export { MapFactory, SharedMap } from "./mapFactory.js";
export { DirectoryFactory, SharedDirectory } from "./directoryFactory.js";
export { SharedMap } from "./mapFactory.js";
export { SharedDirectory } from "./directoryFactory.js";

// Legacy exports that should be deprecated and removed as part of AB#8004 or AB#35245
export type { ISerializableValue } from "./internalInterfaces.js";
export { MapFactory } from "./mapFactory.js";
export { DirectoryFactory } from "./directoryFactory.js";
export type {
ICreateInfo,
IDirectoryNewStorageFormat,
IDirectoryDataObject,
} from "./directory.js";
export type { ISerializableValue } from "./internalInterfaces.js";
2 changes: 0 additions & 2 deletions packages/dds/map/src/internalInterfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,6 @@ export interface ISerializableValue {

/**
* Serialized {@link ISerializableValue} counterpart.
* @legacy
* @alpha
*/
export interface ISerializedValue {
/**
Expand Down
4 changes: 0 additions & 4 deletions packages/dds/map/src/localValues.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ import type { ISerializableValue, ISerializedValue } from "./internalInterfaces.

/**
* A local value to be stored in a container type Distributed Data Store (DDS).
* @legacy
* @alpha
*/
export interface ILocalValue {
/**
Expand Down Expand Up @@ -100,8 +98,6 @@ export class PlainLocalValue implements ILocalValue {
/**
* Enables a container type {@link https://fluidframework.com/docs/build/dds/ | DDS} to produce and store local
* values with minimal awareness of how those objects are stored, serialized, and deserialized.
* @legacy
* @alpha
*/
export class LocalValueMaker {
/**
Expand Down
3 changes: 2 additions & 1 deletion packages/dds/map/src/mapFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ import { pkgVersion } from "./packageVersion.js";

/**
* {@link @fluidframework/datastore-definitions#IChannelFactory} for {@link ISharedMap}.
*
* @privateRemarks
* TODO: AB#35245: Deprecate and stop exporting this class.
* @sealed
* @legacy
* @alpha
Expand Down
35 changes: 34 additions & 1 deletion packages/dds/merge-tree/src/test/client.rollback.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { MergeTreeDeltaType, ReferenceType } from "../ops.js";
import { TextSegment } from "../textSegment.js";

import { TestClient } from "./testClient.js";
import { TestClientLogger } from "./testClientLogger.js";
import { createClientsAtInitialState, TestClientLogger } from "./testClientLogger.js";
import { validatePartialLengths } from "./testUtils.js";

describe("client.rollback", () => {
Expand Down Expand Up @@ -611,4 +611,37 @@ describe("client.rollback", () => {

logger.validate({ baseText: "124abc5" });
});

/*
* op | client A | op | client B
* L:0:A0@0 | _____ | |
* | AAAAA | |
* | _____ | L:0:B0@0 | _____
* | AAAAA | | BBBBB
* | _____ | L:0:B0@2 | __________
* | AAAAA | | BBRRRRRBBB
* | _____ | L:0:B1@2,7 | __~~~~~___
* | AAAAA | | BB BBB
* 1:0:A0@0 | AAAAA | 1:0:A0@0 | __AAAAA~~~~~___
* | | | BB BBB
* 2:0:B0@0 | BBBBBAAAAA | 2:0:B0@0 | BBAAAAA~~~~~BBB
*/
it.skip("Conflicting insert with winner split by rollback", () => {
const clients = createClientsAtInitialState({ initialState: "" }, "A", "B");
const logger = new TestClientLogger(clients.all);
let seq = 0;
const ops = [
clients.A.makeOpMessage(clients.A.insertTextLocal(0, "AAAAA"), ++seq),
clients.B.makeOpMessage(clients.B.insertTextLocal(0, "BBBBB"), ++seq),
];
const rollbackOp = clients.B.insertTextLocal(2, "RRRRR");
clients.B.rollback(rollbackOp, clients.B.peekPendingSegmentGroups());

for (const op of ops) {
for (const c of clients.all) {
c.applyMsg(op);
}
}
logger.validate({ baseText: "BBBBBAAAAA" });
});
});
15 changes: 10 additions & 5 deletions packages/dds/tree/src/simple-tree/core/treeNodeKernel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,15 +155,20 @@ export class TreeNodeKernel {
changedFields,
});

let n: UnhydratedFlexTreeNode | undefined = innerNode;
while (n !== undefined) {
const treeNode = unhydratedFlexTreeNodeToTreeNodeInternal.get(n);
let unhydratedNode: UnhydratedFlexTreeNode | undefined = innerNode;
while (unhydratedNode !== undefined) {
const treeNode = unhydratedFlexTreeNodeToTreeNodeInternal.get(unhydratedNode);
if (treeNode !== undefined) {
const kernel = getKernel(treeNode);
kernel.#unhydratedEvents.value.emit("subtreeChangedAfterBatch");
}
// This cast is safe because the parent (if it exists) of an unhydrated flex node is always another unhydrated flex node.
n = n.parentField.parent.parent as UnhydratedFlexTreeNode | undefined;
const parentNode: FlexTreeNode | undefined =
unhydratedNode.parentField.parent.parent;
assert(
parentNode === undefined || parentNode instanceof UnhydratedFlexTreeNode,
"Unhydrated node's parent should be an unhydrated node",
);
unhydratedNode = parentNode;
}
}),
};
Expand Down
Loading
Loading