Skip to content

Commit

Permalink
Merge branch 'main' into deprecate-IRootDataObjectFactory
Browse files Browse the repository at this point in the history
  • Loading branch information
kian-thompson committed Dec 1, 2023
2 parents 3313b09 + 784f8b6 commit 6870b18
Show file tree
Hide file tree
Showing 1,410 changed files with 29,041 additions and 16,366 deletions.
8 changes: 8 additions & 0 deletions .changeset/smol-kittens-blep.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"@fluidframework/telemetry-utils": minor
---

Deprecate logIfFalse

This functionality was not intended for export and will be removed in a future release.
No replacement API is offered, as the logic is trivial to reproduce as needed.
14 changes: 14 additions & 0 deletions .changeset/soft-taxis-thank.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
"@fluidframework/sequence": minor
"@fluid-experimental/sequence-deprecated": minor
---

Deprecate API `previousInterval` and `nextInterval` from `IntervalCollection`, these functionalities are moved to the `EndpointIndex`. Users are advised to independently attach the index to the collection and utilize the API accordingly, for instance:

```typescript
const endpointIndex = createEndpointIndex(sharedString);
collection.attachIndex(endpointIndex);

const result1 = endpointIndex.previousInterval(pos);
const result2 = endpointIndex.nextInterval(pos);
```
13 changes: 13 additions & 0 deletions azure/packages/azure-client/api-extractor-lint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
"extends": "../../../common/build/build-common/api-extractor-lint.json",
"messages": {
"extractorMessageReporting": {
// TODO: remove once base config has this enabled as an error
"ae-incompatible-release-tags": {
"logLevel": "error",
"addToApiReportFile": false
}
}
}
}
29 changes: 14 additions & 15 deletions azure/packages/azure-client/api-report/azure-client.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,12 @@ import { IUser } from '@fluidframework/protocol-definitions';
import { ScopeType } from '@fluidframework/protocol-definitions';
import { ServiceAudience } from '@fluidframework/fluid-static';

// @public @deprecated
// @internal @deprecated
export class AzureAudience extends ServiceAudience<AzureMember> implements IAzureAudience {
// @internal
protected createServiceMember(audienceMember: IClient): AzureMember;
}

// @public
// @internal
export class AzureClient {
constructor(properties: AzureClientProps);
copyContainer<TContainerSchema extends ContainerSchema>(id: string, containerSchema: TContainerSchema, version?: AzureContainerVersion): Promise<{
Expand All @@ -44,7 +43,7 @@ export class AzureClient {
getContainerVersions(id: string, options?: AzureGetVersionsOptions): Promise<AzureContainerVersion[]>;
}

// @public
// @internal
export interface AzureClientProps {
readonly configProvider?: IConfigProviderBase;
readonly connection: AzureRemoteConnectionConfig | AzureLocalConnectionConfig;
Expand All @@ -53,28 +52,28 @@ export interface AzureClientProps {
readonly summaryCompression?: boolean | ICompressionStorageConfig;
}

// @public
// @internal
export interface AzureConnectionConfig {
endpoint: string;
tokenProvider: ITokenProvider;
type: AzureConnectionConfigType;
}

// @public
// @internal
export type AzureConnectionConfigType = "local" | "remote";

// @public
// @internal
export interface AzureContainerServices {
audience: IAzureAudience;
}

// @public
// @internal
export interface AzureContainerVersion {
date?: string;
id: string;
}

// @public @deprecated
// @internal @deprecated
export class AzureFunctionTokenProvider implements ITokenProvider {
constructor(azFunctionUrl: string, user?: Pick<AzureMember<any>, "userId" | "userName" | "additionalDetails"> | undefined);
// (undocumented)
Expand All @@ -83,35 +82,35 @@ export class AzureFunctionTokenProvider implements ITokenProvider {
fetchStorageToken(tenantId: string, documentId: string): Promise<ITokenResponse>;
}

// @public
// @internal
export interface AzureGetVersionsOptions {
maxCount: number;
}

// @public
// @internal
export interface AzureLocalConnectionConfig extends AzureConnectionConfig {
type: "local";
}

// @public
// @internal
export interface AzureMember<T = any> extends IMember {
additionalDetails?: T;
userName: string;
}

// @public
// @internal
export interface AzureRemoteConnectionConfig extends AzureConnectionConfig {
tenantId: string;
type: "remote";
}

// @public
// @internal
export interface AzureUser<T = any> extends IUser {
additionalDetails?: T;
name: string;
}

// @public
// @internal
export type IAzureAudience = IServiceAudience<AzureMember>;

export { ITelemetryBaseEvent }
Expand Down
3 changes: 2 additions & 1 deletion azure/packages/azure-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,13 @@
"build:docs": "fluid-build . --task api",
"build:esnext": "tsc-multi --config ../../../common/build/build-common/tsc-multi.esm.json",
"build:test": "tsc-multi --config ./tsc-multi.test.json",
"check:release-tags": "api-extractor run --local --config ./api-extractor-lint.json",
"ci:build:docs": "api-extractor run",
"clean": "rimraf --glob dist lib \"**/*.tsbuildinfo\" \"**/*.build.log\" _api-extractor-temp nyc",
"eslint": "eslint --format stylish src",
"eslint:fix": "eslint --format stylish src --fix --fix-type problem,suggestion,layout",
"format": "npm run prettier:fix",
"lint": "npm run prettier && npm run eslint",
"lint": "npm run prettier && npm run check:release-tags && npm run eslint",
"lint:fix": "npm run prettier:fix && npm run eslint:fix",
"postpack": "tar -cf ./azure-client.test-files.tar ./dist/test",
"prettier": "prettier --check . --cache --ignore-path ../../../.prettierignore",
Expand Down
5 changes: 1 addition & 4 deletions azure/packages/azure-client/src/AzureAudience.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@ import { type AzureMember, type AzureUser, type IAzureAudience } from "./interfa
* Azure-specific {@link @fluidframework/fluid-static#ServiceAudience} implementation.
*
* @remarks Operates in terms of {@link AzureMember}s.
*
* @public
* @deprecated This class will be removed. use {@link IAzureAudience} instead
* @internal
*/
export class AzureAudience extends ServiceAudience<AzureMember> implements IAzureAudience {
/**
Expand All @@ -23,8 +22,6 @@ export class AzureAudience extends ServiceAudience<AzureMember> implements IAzur
*
* @param audienceMember - Audience member for which the `ServiceAudience` will be generated.
* Note: its {@link @fluidframework/protocol-definitions#IClient.user} is required to be an {@link AzureUser}.
*
* @internal
*/
protected createServiceMember(audienceMember: IClient): AzureMember {
return createAzureAudienceMember(audienceMember);
Expand Down
20 changes: 16 additions & 4 deletions azure/packages/azure-client/src/AzureClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ import { type IClient, SummaryType } from "@fluidframework/protocol-definitions"
import { RouterliciousDocumentServiceFactory } from "@fluidframework/routerlicious-driver";

import { type IConfigProviderBase } from "@fluidframework/telemetry-utils";
import { type FluidObject } from "@fluidframework/core-interfaces";
import { assert } from "@fluidframework/core-utils";
import { createAzureAudienceMember } from "./AzureAudience";
import { AzureUrlResolver, createAzureCreateNewRequest } from "./AzureUrlResolver";
import {
Expand All @@ -51,8 +53,7 @@ const MAX_VERSION_COUNT = 5;
/**
* AzureClient provides the ability to have a Fluid object backed by the Azure Fluid Relay or,
* when running with local tenantId, have it be backed by a local Azure Fluid Relay instance.
*
* @public
* @internal
*/
export class AzureClient {
private readonly documentServiceFactory: IDocumentServiceFactory;
Expand Down Expand Up @@ -188,7 +189,7 @@ export class AzureClient {
);
url.searchParams.append("containerId", encodeURIComponent(id));
const container = await loader.resolve({ url: url.href });
const rootDataObject = (await container.getEntryPoint()) as IRootDataObject;
const rootDataObject = await this.getContainerEntryPoint(container);
const fluidContainer = createFluidContainer<TContainerSchema>({
container,
rootDataObject,
Expand Down Expand Up @@ -281,7 +282,7 @@ export class AzureClient {
getTenantId(connection),
);

const rootDataObject = (await container.getEntryPoint()) as IRootDataObject;
const rootDataObject = await this.getContainerEntryPoint(container);

/**
* See {@link FluidContainer.attach}
Expand All @@ -303,5 +304,16 @@ export class AzureClient {
fluidContainer.attach = attach;
return fluidContainer;
}

private async getContainerEntryPoint(container: IContainer): Promise<IRootDataObject> {
const rootDataObject: FluidObject<IRootDataObject> | undefined =
await container.getEntryPoint();
assert(rootDataObject !== undefined, "entryPoint must exist");
// ! This "if" is needed for back-compat (older instances of IRootDataObject may not have the IRootDataObject property)
if (rootDataObject.IRootDataObject === undefined) {
return rootDataObject as IRootDataObject;
}
return rootDataObject.IRootDataObject;
}
// #endregion
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ import { type AzureMember } from "./interfaces";
* @deprecated 1.2.0, This API will be removed in 2.0.0
* No replacement since it is not expected anyone will use this token provider as is
* See https://github.com/microsoft/FluidFramework/issues/13693 for context
*
* @public
* @internal
*/
export class AzureFunctionTokenProvider implements ITokenProvider {
/**
Expand Down
5 changes: 3 additions & 2 deletions azure/packages/azure-client/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,11 @@ export type {
AzureRemoteConnectionConfig,
AzureUser,
IAzureAudience,
ITelemetryBaseEvent,
ITelemetryBaseLogger,
} from "./interfaces";

export type { ITokenProvider, ITokenResponse } from "@fluidframework/routerlicious-driver";
export type { ITokenClaims, IUser } from "@fluidframework/protocol-definitions";
export { ScopeType } from "@fluidframework/protocol-definitions";

// Re-export so developers can build loggers without pulling in core-interfaces
export type { ITelemetryBaseEvent, ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
36 changes: 11 additions & 25 deletions azure/packages/azure-client/src/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,9 @@ import { type ITokenProvider } from "@fluidframework/routerlicious-driver";
import { type IConfigProviderBase } from "@fluidframework/telemetry-utils";
import { type ICompressionStorageConfig } from "@fluidframework/driver-utils";

// Re-export so developers can build loggers without pulling in core-interfaces
export type { ITelemetryBaseEvent, ITelemetryBaseLogger } from "@fluidframework/core-interfaces";

/**
* Props for initializing a new AzureClient instance
*
* @public
* @internal
*/
export interface AzureClientProps {
/**
Expand All @@ -37,8 +33,7 @@ export interface AzureClientProps {

/**
* Container version metadata.
*
* @public
* @internal
*/
export interface AzureContainerVersion {
/**
Expand All @@ -55,8 +50,7 @@ export interface AzureContainerVersion {

/**
* Options for "Get Container Versions" API.
*
* @public
* @internal
*/
export interface AzureGetVersionsOptions {
/**
Expand All @@ -71,15 +65,13 @@ export interface AzureGetVersionsOptions {
* - "local" for local connections to a Fluid relay instance running on the localhost
*
* - "remote" for client connections to the Azure Fluid Relay service
*
* @public
* @internal
*/
export type AzureConnectionConfigType = "local" | "remote";

/**
* Parameters for establishing a connection with the Azure Fluid Relay.
*
* @public
* @internal
*/
export interface AzureConnectionConfig {
/**
Expand All @@ -98,8 +90,7 @@ export interface AzureConnectionConfig {

/**
* Parameters for establishing a remote connection with the Azure Fluid Relay.
*
* @public
* @internal
*/
export interface AzureRemoteConnectionConfig extends AzureConnectionConfig {
/**
Expand All @@ -114,8 +105,7 @@ export interface AzureRemoteConnectionConfig extends AzureConnectionConfig {

/**
* Parameters for establishing a local connection with a local instance of the Azure Fluid Relay.
*
* @public
* @internal
*/
export interface AzureLocalConnectionConfig extends AzureConnectionConfig {
/**
Expand All @@ -134,8 +124,7 @@ export interface AzureLocalConnectionConfig extends AzureConnectionConfig {
*
* Any functionality regarding how the data is handled within the FluidContainer itself, i.e. which data objects
* or DDSes to use, will not be included here but rather on the FluidContainer class itself.
*
* @public
* @internal
*/
export interface AzureContainerServices {
/**
Expand All @@ -152,8 +141,7 @@ export interface AzureContainerServices {
* @typeParam T - See {@link AzureUser.additionalDetails}.
* Note: must be JSON-serializable.
* Passing a non-serializable object (e.g. a `class`) will result in undefined behavior.
*
* @public
* @internal
*/
// TODO: this should be updated to use something other than `any` (unknown)
// eslint-disable-next-line @typescript-eslint/no-explicit-any
Expand All @@ -177,8 +165,7 @@ export interface AzureUser<T = any> extends IUser {
* @typeParam T - See {@link AzureMember.additionalDetails}.
* Note: must be JSON-serializable.
* Passing a non-serializable object (e.g. a `class`) will result in undefined behavior.
*
* @public
* @internal
*/
// TODO: this should be updated to use something other than `any` (unknown)
// eslint-disable-next-line @typescript-eslint/no-explicit-any
Expand All @@ -196,7 +183,6 @@ export interface AzureMember<T = any> extends IMember {

/**
* Audience object for Azure Fluid Relay containers
*
* @public
* @internal
*/
export type IAzureAudience = IServiceAudience<AzureMember>;
13 changes: 13 additions & 0 deletions azure/packages/azure-local-service/api-extractor-lint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
"extends": "../../../common/build/build-common/api-extractor-lint.json",
"messages": {
"extractorMessageReporting": {
// TODO: remove once base config has this enabled as an error
"ae-incompatible-release-tags": {
"logLevel": "error",
"addToApiReportFile": false
}
}
}
}
3 changes: 2 additions & 1 deletion azure/packages/azure-local-service/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,13 @@
"build": "fluid-build . --task build",
"build:compile": "fluid-build . --task compile",
"build:docs": "api-extractor run --local",
"check:release-tags": "api-extractor run --local --config ./api-extractor-lint.json",
"ci:build:docs": "api-extractor run",
"clean": "rimraf --glob dist lib \"**/*.tsbuildinfo\" \"**/*.build.log\" _api-extractor-temp",
"eslint": "eslint --format stylish src",
"eslint:fix": "eslint --format stylish src --fix --fix-type problem,suggestion,layout",
"format": "npm run prettier:fix",
"lint": "npm run prettier && npm run eslint",
"lint": "npm run prettier && npm run check:release-tags && npm run eslint",
"lint:fix": "npm run prettier:fix && npm run eslint:fix",
"prettier": "prettier --check . --cache --ignore-path ../../../.prettierignore",
"prettier:fix": "prettier --write . --cache --ignore-path ../../../.prettierignore",
Expand Down
Loading

0 comments on commit 6870b18

Please sign in to comment.