Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import fluidPackage from container-definitions #9653

Merged
merged 14 commits into from
Mar 31, 2022
Merged
38 changes: 38 additions & 0 deletions BREAKING.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ There are a few steps you can take to write a good change note and avoid needing
## 0.59 Breaking changes
- [Removing Commit from TreeEntry and commits from SnapShotTree](#Removing-Commit-from-TreeEntry-and-commits-from-SnapShotTree)
- [raiseContainerWarning removed from IContainerContext](#raiseContainerWarning-removed-from-IContainerContext)
- [Remove `@fluidframework/core-interface#fluidPackage.ts`](#Remove-fluidframeworkcore-interfacefluidPackagets)
- [getAbsoluteUrl() argument type changed](#getAbsoluteUrl-argument-type-changed)

### Removing Commit from TreeEntry and commits from SnapShotTree
Cleaning up properties that are not being used in the codebase: `TreeEntry.Commit` and `ISnapshotTree.commits`.
Expand All @@ -29,6 +31,42 @@ These should not be used and there is no replacement provided.
### raiseContainerWarning removed from IContainerContext
`raiseContainerWarning` property will be removed from `IContainerContext` interface and `ContainerContext` class. Please refer to [raiseContainerWarning property](#Remove-raisecontainerwarning-property) for more details.

### Remove `@fluidframework/core-interface#fluidPackage.ts`
All the interfaces and const from `fluidPackage.ts` were moved to `@fluidframework/container-definitions` in previous release. Please refer to: [Moved `@fluidframework/core-interface#fluidPackage.ts` to `@fluidframework/container-definition#fluidPackage.ts`](#Moved-fluidframeworkcore-interfacefluidPackagets-to-fluidframeworkcontainer-definitionfluidPackagets). It is now removed from `@fluidframework/core-interface#fluidPackage.ts`. Import the following interfaces and const from `@fluidframework/container-definitions`:
- `IFluidPackageEnvironment`
- `IFluidPackage`
- `isFluidPackage`
- `IFluidCodeDetailsConfig`
- `IFluidCodeDetailsConfig`
- `IFluidCodeDetails`
- `IFluidCodeDetailsComparer`
- `IProvideFluidCodeDetailsComparer`
- `IFluidCodeDetailsComparer`

### `getAbsoluteUrl()` argument type changed
The `packageInfoSource` argument in `getAbsoluteUrl()` on `@fluidframework/odsp-driver`, `@fluidframework/iframe-driver`, and `@fluidframework/driver-definitions` is typed to `IContainerPackageInfo` interface only.

```diff
- getAbsoluteUrl(
- resolvedUrl: IResolvedUrl,
- relativeUrl: string,
- packageInfoSource?: IFluidCodeDetails | IContainerPackageInfo,
- ): Promise<string>;

+ interface IContainerPackageInfo {
+ /**
+ * Container package name.
+ */
+ name: string;
+ }

+ getAbsoluteUrl(
+ resolvedUrl: IResolvedUrl,
+ relativeUrl: string,
+ packageInfoSource?: IContainerPackageInfo,
+ ): Promise<string>;
```

# 0.58

## 0.58 Upcoming changes
Expand Down
4 changes: 2 additions & 2 deletions api-report/container-loader.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ import { IDeltaManager } from '@fluidframework/container-definitions';
import { IDocumentMessage } from '@fluidframework/protocol-definitions';
import { IDocumentServiceFactory } from '@fluidframework/driver-definitions';
import { IDocumentStorageService } from '@fluidframework/driver-definitions';
import { IFluidCodeDetails } from '@fluidframework/core-interfaces';
import { IFluidCodeDetails } from '@fluidframework/container-definitions';
import { IFluidModule } from '@fluidframework/container-definitions';
import { IFluidResolvedUrl } from '@fluidframework/driver-definitions';
import { IFluidRouter } from '@fluidframework/core-interfaces';
import { IHostLoader } from '@fluidframework/container-definitions';
import { ILoader } from '@fluidframework/container-definitions';
import { ILoaderOptions as ILoaderOptions_2 } from '@fluidframework/container-definitions';
import { IProvideFluidCodeDetailsComparer } from '@fluidframework/core-interfaces';
import { IProvideFluidCodeDetailsComparer } from '@fluidframework/container-definitions';
import { IProxyLoaderFactory } from '@fluidframework/container-definitions';
import { IQuorumClients } from '@fluidframework/protocol-definitions';
import { IRequest } from '@fluidframework/core-interfaces';
Expand Down
7 changes: 3 additions & 4 deletions api-report/iframe-driver.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import { IDocumentMessage } from '@fluidframework/protocol-definitions';
import { IDocumentService } from '@fluidframework/driver-definitions';
import { IDocumentServiceFactory } from '@fluidframework/driver-definitions';
import { IDocumentStorageService } from '@fluidframework/driver-definitions';
import { IFluidCodeDetails } from '@fluidframework/core-interfaces';
import { IRequest } from '@fluidframework/core-interfaces';
import { IResolvedUrl } from '@fluidframework/driver-definitions';
import { ISequencedDocumentMessage } from '@fluidframework/protocol-definitions';
Expand Down Expand Up @@ -140,7 +139,7 @@ export class InnerUrlResolver implements IUrlResolver {
// (undocumented)
static create(outerPort: MessagePort): Promise<InnerUrlResolver>;
// (undocumented)
getAbsoluteUrl(resolvedUrl: IResolvedUrl, relativeUrl: string, packageInfoSource?: IContainerPackageInfo | IFluidCodeDetails): Promise<string>;
getAbsoluteUrl(resolvedUrl: IResolvedUrl, relativeUrl: string, packageInfoSource?: IContainerPackageInfo): Promise<string>;
// (undocumented)
resolve(request: IRequest): Promise<IResolvedUrl | undefined>;
}
Expand All @@ -162,7 +161,7 @@ export interface IUrlResolverProxy {
// (undocumented)
connected(): Promise<void>;
// (undocumented)
getAbsoluteUrl(resolvedUrlFn: () => Promise<IResolvedUrl>, relativeUrl: string, packageInfoFn: () => Promise<IContainerPackageInfo | IFluidCodeDetails | undefined>): Promise<string>;
getAbsoluteUrl(resolvedUrlFn: () => Promise<IResolvedUrl>, relativeUrl: string, packageInfoFn: () => Promise<IContainerPackageInfo | undefined>): Promise<string>;
// (undocumented)
resolve(request: IRequest): Promise<() => Promise<IResolvedUrl | undefined>>;
}
Expand All @@ -178,7 +177,7 @@ export class OuterUrlResolver {
// (undocumented)
createProxy(): IUrlResolverProxy;
// (undocumented)
getAbsoluteUrl(resolvedUrlFn: () => Promise<IResolvedUrl>, relativeUrl: string, packageInfoFn: () => Promise<IContainerPackageInfo | IFluidCodeDetails | undefined>): Promise<string>;
getAbsoluteUrl(resolvedUrlFn: () => Promise<IResolvedUrl>, relativeUrl: string, packageInfoFn: () => Promise<IContainerPackageInfo | undefined>): Promise<string>;
// (undocumented)
resolve(request: IRequest): Promise<() => Promise<IResolvedUrl | undefined>>;
}
Expand Down
5 changes: 2 additions & 3 deletions api-report/odsp-driver.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import { IContainerPackageInfo } from '@fluidframework/driver-definitions';
import { IdentityType } from '@fluidframework/odsp-driver-definitions';
import { IDocumentService } from '@fluidframework/driver-definitions';
import { IDocumentServiceFactory } from '@fluidframework/driver-definitions';
import { IFluidCodeDetails } from '@fluidframework/core-interfaces';
import type { io } from 'socket.io-client';
import { IOdspResolvedUrl } from '@fluidframework/odsp-driver-definitions';
import { IOdspUrlParts } from '@fluidframework/odsp-driver-definitions';
Expand Down Expand Up @@ -112,7 +111,7 @@ export class OdspDocumentServiceFactoryWithCodeSplit extends OdspDocumentService
export class OdspDriverUrlResolver implements IUrlResolver {
constructor();
// (undocumented)
getAbsoluteUrl(resolvedUrl: IResolvedUrl, relativeUrl: string, packageInfoSource?: IContainerPackageInfo | IFluidCodeDetails): Promise<string>;
getAbsoluteUrl(resolvedUrl: IResolvedUrl, relativeUrl: string, packageInfoSource?: IContainerPackageInfo): Promise<string>;
// (undocumented)
resolve(request: IRequest): Promise<IOdspResolvedUrl>;
}
Expand All @@ -123,7 +122,7 @@ export class OdspDriverUrlResolverForShareLink implements IUrlResolver {
appendDataStorePath(requestUrl: URL, pathToAppend: string): string | undefined;
static createDocumentUrl(baseUrl: string, driverInfo: OdspFluidDataStoreLocator): string;
static createNavParam(locator: OdspFluidDataStoreLocator): string;
getAbsoluteUrl(resolvedUrl: IResolvedUrl, dataStorePath: string, packageInfoSource?: IContainerPackageInfo | IFluidCodeDetails): Promise<string>;
getAbsoluteUrl(resolvedUrl: IResolvedUrl, dataStorePath: string, packageInfoSource?: IContainerPackageInfo): Promise<string>;
resolve(request: IRequest): Promise<IOdspResolvedUrl>;
}

Expand Down
4 changes: 2 additions & 2 deletions api-report/test-utils.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { IContainerContext } from '@fluidframework/container-definitions';
import { IContainerRuntime } from '@fluidframework/container-runtime-definitions';
import { IContainerRuntimeOptions } from '@fluidframework/container-runtime';
import { IDocumentServiceFactory } from '@fluidframework/driver-definitions';
import { IFluidCodeDetails } from '@fluidframework/core-interfaces';
import { IFluidCodeDetails } from '@fluidframework/container-definitions';
import { IFluidDataStoreChannel } from '@fluidframework/runtime-definitions';
import { IFluidDataStoreContext } from '@fluidframework/runtime-definitions';
import { IFluidDataStoreFactory } from '@fluidframework/runtime-definitions';
Expand All @@ -24,7 +24,7 @@ import { IFluidModule } from '@fluidframework/container-definitions';
import { IHostLoader } from '@fluidframework/container-definitions';
import { ILoaderOptions } from '@fluidframework/container-definitions';
import { ILoaderProps } from '@fluidframework/container-loader';
import { IProvideFluidCodeDetailsComparer } from '@fluidframework/core-interfaces';
import { IProvideFluidCodeDetailsComparer } from '@fluidframework/container-definitions';
import { IProvideFluidDataStoreFactory } from '@fluidframework/runtime-definitions';
import { IProvideFluidDataStoreRegistry } from '@fluidframework/runtime-definitions';
import { IProvideRuntimeFactory } from '@fluidframework/container-definitions';
Expand Down
6 changes: 3 additions & 3 deletions api-report/web-code-loader.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@

import { ICodeAllowList } from '@fluidframework/container-definitions';
import { ICodeLoader } from '@fluidframework/container-definitions';
import { IFluidCodeDetails } from '@fluidframework/core-interfaces';
import { IFluidCodeDetails } from '@fluidframework/container-definitions';
import { IFluidCodeResolver } from '@fluidframework/container-definitions';
import { IFluidModule } from '@fluidframework/container-definitions';
import { IFluidPackage } from '@fluidframework/core-interfaces';
import { IFluidPackageEnvironment } from '@fluidframework/core-interfaces';
import { IFluidPackage } from '@fluidframework/container-definitions';
import { IFluidPackageEnvironment } from '@fluidframework/container-definitions';
import { IResolvedFluidCodeDetails } from '@fluidframework/container-definitions';

// @public
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@ import { IDocumentStorageService } from '@fluidframework/driver-definitions';
import { IErrorEvent } from '@fluidframework/common-definitions';
import { IEvent } from '@fluidframework/common-definitions';
import { IEventProvider } from '@fluidframework/common-definitions';
import { IFluidCodeDetails as IFluidCodeDetails_2 } from '@fluidframework/core-interfaces';
import { IFluidObject } from '@fluidframework/core-interfaces';
import { IFluidPackage as IFluidPackage_2 } from '@fluidframework/core-interfaces';
import { IFluidPackageEnvironment as IFluidPackageEnvironment_2 } from '@fluidframework/core-interfaces';
import { IFluidResolvedUrl } from '@fluidframework/driver-definitions';
import { IFluidRouter } from '@fluidframework/core-interfaces';
import { IProvideFluidCodeDetailsComparer as IProvideFluidCodeDetailsComparer_2 } from '@fluidframework/core-interfaces';
Expand Down Expand Up @@ -96,13 +93,13 @@ export interface ICodeAllowList {
}

// @public
export interface ICodeDetailsLoader extends Partial<IProvideFluidCodeDetailsComparer_2> {
load(source: IFluidCodeDetails_2): Promise<IFluidModuleWithDetails>;
export interface ICodeDetailsLoader extends Partial<IProvideFluidCodeDetailsComparer> {
load(source: IFluidCodeDetails): Promise<IFluidModuleWithDetails>;
}

// @public @deprecated
export interface ICodeLoader extends Partial<IProvideFluidCodeDetailsComparer_2> {
load(source: IFluidCodeDetails_2): Promise<IFluidModule>;
export interface ICodeLoader extends Partial<IProvideFluidCodeDetailsComparer> {
load(source: IFluidCodeDetails): Promise<IFluidModule>;
}

// @public
Expand Down Expand Up @@ -140,11 +137,11 @@ export interface IContainer extends IEventProvider<IContainerEvents>, IFluidRout
// @alpha
forceReadonly?(readonly: boolean): any;
getAbsoluteUrl(relativeUrl: string): Promise<string | undefined>;
getLoadedCodeDetails(): IFluidCodeDetails_2 | undefined;
getLoadedCodeDetails(): IFluidCodeDetails | undefined;
getQuorum(): IQuorumClients;
getSpecifiedCodeDetails(): IFluidCodeDetails_2 | undefined;
getSpecifiedCodeDetails(): IFluidCodeDetails | undefined;
readonly isDirty: boolean;
proposeCodeDetails(codeDetails: IFluidCodeDetails_2): Promise<boolean>;
proposeCodeDetails(codeDetails: IFluidCodeDetails): Promise<boolean>;
readonly readOnlyInfo: ReadOnlyInfo;
request(request: IRequest): Promise<IResponse>;
resolvedUrl: IResolvedUrl | undefined;
Expand Down Expand Up @@ -178,7 +175,7 @@ export interface IContainerContext extends IDisposable {
// (undocumented)
getLoadedFromVersion(): IVersion | undefined;
// @deprecated (undocumented)
getSpecifiedCodeDetails?(): IFluidCodeDetails_2 | undefined;
getSpecifiedCodeDetails?(): IFluidCodeDetails | undefined;
// (undocumented)
readonly loader: ILoader;
// (undocumented)
Expand Down Expand Up @@ -209,9 +206,9 @@ export interface IContainerEvents extends IEvent {
// (undocumented)
(event: "connected", listener: (clientId: string) => void): any;
// (undocumented)
(event: "codeDetailsProposed", listener: (codeDetails: IFluidCodeDetails_2, proposal: ISequencedProposal) => void): any;
(event: "codeDetailsProposed", listener: (codeDetails: IFluidCodeDetails, proposal: ISequencedProposal) => void): any;
// (undocumented)
(event: "contextChanged", listener: (codeDetails: IFluidCodeDetails_2) => void): any;
(event: "contextChanged", listener: (codeDetails: IFluidCodeDetails) => void): any;
// (undocumented)
(event: "disconnected" | "attached", listener: () => void): any;
// (undocumented)
Expand Down Expand Up @@ -322,16 +319,16 @@ export interface IErrorBase extends Partial<Error> {
}

// @public
export interface IFluidBrowserPackage extends IFluidPackage_2 {
export interface IFluidBrowserPackage extends IFluidPackage {
// (undocumented)
fluid: {
browser: IFluidBrowserPackageEnvironment;
[environment: string]: IFluidPackageEnvironment_2;
[environment: string]: IFluidPackageEnvironment;
};
}

// @public
export interface IFluidBrowserPackageEnvironment extends IFluidPackageEnvironment_2 {
export interface IFluidBrowserPackageEnvironment extends IFluidPackageEnvironment {
umd: {
files: string[];
library: string;
Expand Down Expand Up @@ -361,7 +358,7 @@ export interface IFluidCodeDetailsConfig {

// @public
export interface IFluidCodeResolver {
resolveCodeDetails(details: IFluidCodeDetails_2): Promise<IResolvedFluidCodeDetails>;
resolveCodeDetails(details: IFluidCodeDetails): Promise<IResolvedFluidCodeDetails>;
}

// @public (undocumented)
Expand All @@ -372,7 +369,7 @@ export interface IFluidModule {

// @public
export interface IFluidModuleWithDetails {
details: IFluidCodeDetails_2;
details: IFluidCodeDetails;
module: IFluidModule;
}

Expand Down Expand Up @@ -414,7 +411,7 @@ export interface IGenericError extends IErrorBase {

// @public
export interface IHostLoader extends ILoader {
createDetachedContainer(codeDetails: IFluidCodeDetails_2): Promise<IContainer>;
createDetachedContainer(codeDetails: IFluidCodeDetails): Promise<IContainer>;
rehydrateDetachedContainerFromSnapshot(snapshot: string): Promise<IContainer>;
}

Expand Down Expand Up @@ -495,8 +492,8 @@ export interface IProxyLoaderFactory {
}

// @public
export interface IResolvedFluidCodeDetails extends IFluidCodeDetails_2 {
readonly resolvedPackage: Readonly<IFluidPackage_2>;
export interface IResolvedFluidCodeDetails extends IFluidCodeDetails {
readonly resolvedPackage: Readonly<IFluidPackage>;
readonly resolvedPackageCacheId: string | undefined;
}

Expand Down
2 changes: 1 addition & 1 deletion common/lib/container-definitions/src/browserPackage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Licensed under the MIT License.
*/

import { IFluidPackage, isFluidPackage, IFluidPackageEnvironment } from "@fluidframework/core-interfaces";
import { IFluidPackage, isFluidPackage, IFluidPackageEnvironment } from "./fluidPackage";

/**
* A specific Fluid package environment for browsers
Expand Down
8 changes: 5 additions & 3 deletions common/lib/container-definitions/src/loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ import {
IRequest,
IResponse,
IFluidRouter,
IFluidCodeDetails,
IFluidPackage,
IProvideFluidCodeDetailsComparer,
} from "@fluidframework/core-interfaces";
import {
IClientDetails,
Expand All @@ -25,6 +22,11 @@ import { IDeltaManager, ReadOnlyInfo } from "./deltas";
import { ICriticalContainerError, ContainerWarning } from "./error";
import { IFluidModule } from "./fluidModule";
import { AttachState } from "./runtime";
import {
IFluidCodeDetails,
IFluidPackage,
IProvideFluidCodeDetailsComparer,
} from "./fluidPackage";

/**
* Code loading interface
Expand Down
2 changes: 1 addition & 1 deletion common/lib/container-definitions/src/runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import { ITelemetryBaseLogger, IDisposable } from "@fluidframework/common-definitions";
import {
FluidObject,
IFluidCodeDetails,
IFluidObject,
IRequest,
IResponse,
Expand All @@ -27,6 +26,7 @@ import { IAudience } from "./audience";
import { IDeltaManager } from "./deltas";
import { ICriticalContainerError } from "./error";
import { ILoader, ILoaderOptions } from "./loader";
import { IFluidCodeDetails } from "./fluidPackage";

/**
* The attachment state of some Fluid data (e.g. a container or data store), denoting whether it is uploaded to the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import { IDisposable } from '@fluidframework/common-definitions';
import { IDocumentMessage } from '@fluidframework/protocol-definitions';
import { IErrorEvent } from '@fluidframework/common-definitions';
import { IEventProvider } from '@fluidframework/common-definitions';
import { IFluidCodeDetails } from '@fluidframework/core-interfaces';
import { INack } from '@fluidframework/protocol-definitions';
import { IRequest } from '@fluidframework/core-interfaces';
import { ISequencedDocumentMessage } from '@fluidframework/protocol-definitions';
Expand Down Expand Up @@ -263,7 +262,7 @@ export interface IThrottlingWarning extends IDriverErrorBase {
// @public (undocumented)
export interface IUrlResolver {
// (undocumented)
getAbsoluteUrl(resolvedUrl: IResolvedUrl, relativeUrl: string, packageInfoSource?: IFluidCodeDetails | IContainerPackageInfo): Promise<string>;
getAbsoluteUrl(resolvedUrl: IResolvedUrl, relativeUrl: string, packageInfoSource?: IContainerPackageInfo): Promise<string>;
sonalivdeshpande marked this conversation as resolved.
Show resolved Hide resolved
// (undocumented)
resolve(request: IRequest): Promise<IResolvedUrl | undefined>;
}
Expand Down
Loading