Skip to content

Commit 36ebe10

Browse files
jikim-msftalexvy86
authored andcommitted
Promote IFluidDevtools to beta (microsoft#25695)
#### Description This PR promotes `IFluidDevtools` interface from `alpha` to `beta` for integration into partner repos. --------- Co-authored-by: Alex Villarreal <716334+alexvy86@users.noreply.github.com>
1 parent ea1ff59 commit 36ebe10

File tree

11 files changed

+114
-22
lines changed

11 files changed

+114
-22
lines changed

.changeset/few-plants-strive.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
"@fluidframework/devtools-core": minor
3+
"__section": feature
4+
---
5+
Promote core devtools APIs from alpha to beta
6+
7+
The primary devtools APIs may now be imported from `/beta`. This includes:
8+
9+
- **`initializeDevtools`** - Initialize the devtools singleton
10+
- **`tryGetFluidDevtools`** - Get the existing devtools instance if initialized
11+
- **`IFluidDevtools`** - Main devtools interface for registering containers
12+
- **`ContainerDevtoolsProps`** - Properties for registering containers with devtools
13+
14+
For example:
15+
16+
```typescript
17+
import {
18+
initializeDevtools,
19+
tryGetFluidDevtools,
20+
type IFluidDevtools,
21+
type ContainerDevtoolsProps
22+
} from "@fluidframework/devtools-core/beta";
23+
24+
// Initialize devtools
25+
const devtools = initializeDevtools();
26+
27+
// Register a container
28+
devtools.registerContainerDevtools({
29+
containerKey: "my-container",
30+
container: myContainer
31+
});
32+
```

packages/tools/devtools/devtools-core/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ For more information on the related support guarantees, see [API Support Levels]
3434

3535
To access the `public` ([SemVer](https://semver.org/)) APIs, import via `@fluidframework/devtools-core` like normal.
3636

37+
To access the `beta` APIs, import via `@fluidframework/devtools-core/beta`.
38+
3739
To access the `alpha` APIs, import via `@fluidframework/devtools-core/alpha`.
3840

3941
## API Documentation
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3+
"extends": "<projectFolder>/../../../../common/build/build-common/api-extractor-lint.entrypoint.json",
4+
"mainEntryPointFilePath": "<projectFolder>/dist/beta.d.ts"
5+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3+
"extends": "<projectFolder>/../../../../common/build/build-common/api-extractor-lint.entrypoint.json",
4+
"mainEntryPointFilePath": "<projectFolder>/lib/beta.d.ts"
5+
}

packages/tools/devtools/devtools-core/api-report/devtools-core.alpha.api.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,28 @@
44
55
```ts
66

7-
// @alpha
7+
// @beta @sealed @input
88
export interface ContainerDevtoolsProps extends HasContainerKey {
9-
container: IContainer;
10-
containerData?: Record<string, IFluidLoadable>;
9+
readonly container: IContainer;
10+
readonly containerData?: Record<string, IFluidLoadable>;
1111
}
1212

1313
// @beta
1414
export type ContainerKey = string;
1515

16-
// @alpha @input
16+
// @beta @sealed @input
1717
export interface ContainerRuntimeProps {
18-
label?: string;
18+
readonly label?: string;
1919
readonly runtime: IContainerRuntime;
2020
}
2121

2222
// @beta
2323
export function createDevtoolsLogger(baseLogger?: ITelemetryBaseLogger): IDevtoolsLogger;
2424

25-
// @alpha
25+
// @beta @sealed @input
2626
export interface FluidDevtoolsProps {
27-
initialContainers?: ContainerDevtoolsProps[];
28-
logger?: IDevtoolsLogger;
27+
readonly initialContainers?: ContainerDevtoolsProps[];
28+
readonly logger?: IDevtoolsLogger;
2929
}
3030

3131
// @beta @sealed @system
@@ -37,17 +37,17 @@ export interface HasContainerKey {
3737
export interface IDevtoolsLogger extends ITelemetryBaseLogger {
3838
}
3939

40-
// @alpha @sealed
40+
// @beta @sealed
4141
export interface IFluidDevtools extends IDisposable {
4242
closeContainerDevtools(containerKey: ContainerKey): void;
4343
registerContainerDevtools(props: ContainerDevtoolsProps): void;
4444
registerContainerRuntime(props: ContainerRuntimeProps): Promise<void>;
4545
}
4646

47-
// @alpha
47+
// @beta
4848
export function initializeDevtools(props?: FluidDevtoolsProps): IFluidDevtools;
4949

50-
// @alpha
50+
// @beta
5151
export function tryGetFluidDevtools(): IFluidDevtools | undefined;
5252

5353
```

packages/tools/devtools/devtools-core/api-report/devtools-core.beta.api.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,30 @@
44
55
```ts
66

7+
// @beta @sealed @input
8+
export interface ContainerDevtoolsProps extends HasContainerKey {
9+
readonly container: IContainer;
10+
readonly containerData?: Record<string, IFluidLoadable>;
11+
}
12+
713
// @beta
814
export type ContainerKey = string;
915

16+
// @beta @sealed @input
17+
export interface ContainerRuntimeProps {
18+
readonly label?: string;
19+
readonly runtime: IContainerRuntime;
20+
}
21+
1022
// @beta
1123
export function createDevtoolsLogger(baseLogger?: ITelemetryBaseLogger): IDevtoolsLogger;
1224

25+
// @beta @sealed @input
26+
export interface FluidDevtoolsProps {
27+
readonly initialContainers?: ContainerDevtoolsProps[];
28+
readonly logger?: IDevtoolsLogger;
29+
}
30+
1331
// @beta @sealed @system
1432
export interface HasContainerKey {
1533
readonly containerKey: ContainerKey;
@@ -19,4 +37,17 @@ export interface HasContainerKey {
1937
export interface IDevtoolsLogger extends ITelemetryBaseLogger {
2038
}
2139

40+
// @beta @sealed
41+
export interface IFluidDevtools extends IDisposable {
42+
closeContainerDevtools(containerKey: ContainerKey): void;
43+
registerContainerDevtools(props: ContainerDevtoolsProps): void;
44+
registerContainerRuntime(props: ContainerRuntimeProps): Promise<void>;
45+
}
46+
47+
// @beta
48+
export function initializeDevtools(props?: FluidDevtoolsProps): IFluidDevtools;
49+
50+
// @beta
51+
export function tryGetFluidDevtools(): IFluidDevtools | undefined;
52+
2253
```

packages/tools/devtools/devtools-core/package.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,16 @@
3333
"default": "./dist/index.js"
3434
}
3535
},
36+
"./beta": {
37+
"import": {
38+
"types": "./lib/beta.d.ts",
39+
"default": "./lib/index.js"
40+
},
41+
"require": {
42+
"types": "./dist/beta.d.ts",
43+
"default": "./dist/index.js"
44+
}
45+
},
3646
"./internal": {
3747
"import": {
3848
"types": "./lib/index.d.ts",
@@ -64,8 +74,10 @@
6474
"check:exports": "concurrently \"npm:check:exports:*\"",
6575
"check:exports:bundle-release-tags": "api-extractor run --config api-extractor/api-extractor-lint-bundle.json",
6676
"check:exports:cjs:alpha": "api-extractor run --config api-extractor/api-extractor-lint-alpha.cjs.json",
77+
"check:exports:cjs:beta": "api-extractor run --config api-extractor/api-extractor-lint-beta.cjs.json",
6778
"check:exports:cjs:public": "api-extractor run --config api-extractor/api-extractor-lint-public.cjs.json",
6879
"check:exports:esm:alpha": "api-extractor run --config api-extractor/api-extractor-lint-alpha.esm.json",
80+
"check:exports:esm:beta": "api-extractor run --config api-extractor/api-extractor-lint-beta.esm.json",
6981
"check:exports:esm:public": "api-extractor run --config api-extractor/api-extractor-lint-public.esm.json",
7082
"check:format": "npm run check:biome",
7183
"ci:build:docs": "api-extractor run",

packages/tools/devtools/devtools-core/src/ContainerDevtools.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,15 @@ import {
1818

1919
/**
2020
* Properties for registering a {@link @fluidframework/container-definitions#IContainer} with the Devtools.
21-
* @alpha
21+
* @beta
22+
* @input
23+
* @sealed
2224
*/
2325
export interface ContainerDevtoolsProps extends HasContainerKey {
2426
/**
2527
* The Container to register with the Devtools.
2628
*/
27-
container: IContainer;
29+
readonly container: IContainer;
2830

2931
/**
3032
* (optional) Distributed Data Structures (DDSs) associated with the
@@ -39,7 +41,7 @@ export interface ContainerDevtoolsProps extends HasContainerKey {
3941
*
4042
* @privateRemarks TODO: rename this to make it more clear that this data does not *belong* to the Container.
4143
*/
42-
containerData?: Record<string, IFluidLoadable>;
44+
readonly containerData?: Record<string, IFluidLoadable>;
4345

4446
// TODO: Add ability for customers to specify custom visualizer overrides
4547
}

packages/tools/devtools/devtools-core/src/ContainerRuntimeDevtools.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ import type { InboundHandlers } from "./messaging/index.js";
2323

2424
/**
2525
* Properties for registering a container runtime with the Devtools.
26-
* @alpha
26+
* @beta
27+
* @sealed
2728
* @input
2829
*/
2930
export interface ContainerRuntimeProps {
@@ -35,7 +36,7 @@ export interface ContainerRuntimeProps {
3536
/**
3637
* Optional label for the container runtime replacing the guid generated by {@link @fluidframework/container-runtime#IContainerRuntime.generateDocumentUniqueId}.
3738
*/
38-
label?: string;
39+
readonly label?: string;
3940
}
4041

4142
/**

packages/tools/devtools/devtools-core/src/FluidDevtools.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,9 @@ export function getContainerAlreadyRegisteredErrorText(containerKey: ContainerKe
7777

7878
/**
7979
* Properties for configuring the Devtools.
80-
* @alpha
80+
* @beta
81+
* @input
82+
* @sealed
8183
*/
8284
export interface FluidDevtoolsProps {
8385
/**
@@ -90,14 +92,14 @@ export interface FluidDevtoolsProps {
9092
* This is provided to the Devtools instance strictly to enable communicating supported / desired functionality with
9193
* external listeners.
9294
*/
93-
logger?: IDevtoolsLogger;
95+
readonly logger?: IDevtoolsLogger;
9496

9597
/**
9698
* (optional) List of Containers to initialize the devtools with.
9799
*
98100
* @remarks Additional Containers can be registered with the Devtools via {@link IFluidDevtools.registerContainerDevtools}.
99101
*/
100-
initialContainers?: ContainerDevtoolsProps[];
102+
readonly initialContainers?: ContainerDevtoolsProps[];
101103

102104
// TODO: Add ability for customers to specify custom data visualizer overrides
103105
}
@@ -517,15 +519,15 @@ export class FluidDevtools implements IFluidDevtools {
517519
*
518520
* It is automatically disposed on webpage unload, but it can be closed earlier by calling `dispose`
519521
* on the returned handle.
520-
* @alpha
522+
* @beta
521523
*/
522524
export function initializeDevtools(props?: FluidDevtoolsProps): IFluidDevtools {
523525
return FluidDevtools.initialize(props);
524526
}
525527

526528
/**
527529
* Gets the Devtools singleton if it has been {@link initializeDevtools | initialized}, otherwise returns `undefined`.
528-
* @alpha
530+
* @beta
529531
*/
530532
export function tryGetFluidDevtools(): IFluidDevtools | undefined {
531533
return FluidDevtools.tryGet();

0 commit comments

Comments
 (0)