### Install and Run Tablebench Source: https://github.com/microsoft/fluidframework/blob/main/examples/benchmarks/tablebench/README.md Steps to install dependencies, build the project, and run the tablebench application locally. This is the primary method for getting the example running. ```bash pnpm install pnpm run build:fast --nolint pnpm start ``` -------------------------------- ### Install and Run Example Source: https://github.com/microsoft/fluidframework/blob/main/examples/service-clients/azure-client/external-controller/README.md Steps to install dependencies, build the project, and run the example locally or against SharePoint. ```bash corepack enable pnpm install pnpm run build:fast --nolint pnpm start ``` ```bash pnpm run build:fast --nolint @fluid-example/app-integration-external-controller ``` ```bash pnpm start:spo pnpm start:spo-df ``` -------------------------------- ### Install Dependencies and Build Client Packages Source: https://github.com/microsoft/fluidframework/blob/main/README.md Installs all project dependencies using pnpm and then builds the client packages. This is the standard procedure to get the project ready for development after cloning and setup. ```shell pnpm install npm run build ``` -------------------------------- ### Start SharePoint Example (DogFood) Source: https://github.com/microsoft/fluidframework/blob/main/examples/utils/webpack-fluid-loader/README.md Run this command to start a SharePoint example when your OneDrive is on the DogFood server. Ensure the required environment variables are set. ```sh npm run start:spo-df ``` -------------------------------- ### Start SharePoint Example (Production) Source: https://github.com/microsoft/fluidframework/blob/main/examples/utils/webpack-fluid-loader/README.md Run this command to start a SharePoint example when your OneDrive is not on the DogFood server. Ensure the required environment variables are set. ```sh npm run start:spo ``` -------------------------------- ### Start Example with Tinylicious Source: https://github.com/microsoft/fluidframework/blob/main/README.md Run a Fluid Framework example and connect it to the locally running Tinylicious server for collaboration across multiple browser instances. ```shell npm run start:tinylicious ``` -------------------------------- ### Start Azure Local Service Source: https://github.com/microsoft/fluidframework/blob/main/azure/packages/azure-local-service/README.md Install dependencies and start the Azure local service. ```bash npm i npm run start ``` -------------------------------- ### Install and Start Tinylicious Server Source: https://github.com/microsoft/fluidframework/blob/main/README.md Set up and run the Tinylicious local Fluid server implementation. This involves installing dependencies and starting the server from its package directory. ```shell pnpm install ``` ```shell pnpm run build pnpm run start ``` -------------------------------- ### Run External Data Example App Source: https://github.com/microsoft/fluidframework/blob/main/examples/external-data/README.md Instructions to install dependencies, build, and run the external data integration example locally. Also includes steps for running against SharePoint. ```bash pnpm install pnpm run build:fast --nolint pnpm start ``` ```bash pnpm start:spo pnpm start:spo-df ``` -------------------------------- ### Start Stickiness Example Source: https://github.com/microsoft/fluidframework/blob/main/docs/docs/data-structures/sequences.md Shows an interval that expands to include text inserted at its start. ```plaintext aXbYc ^^ ``` -------------------------------- ### Run a Specific Fluid Object Example Source: https://github.com/microsoft/fluidframework/wiki/Client Starts a Fluid object package, such as the 'Clicker' example, using pnpm. This command is used to run examples locally for testing. ```bash pnpm -r --filter @fluid-example/clicker start ``` -------------------------------- ### Install Dependencies and Start Local Routerlicious Service Source: https://github.com/microsoft/fluidframework/blob/main/server/routerlicious/README.md Commands to set up a local development environment for Routerlicious, including installing pnpm, dependencies, building, and starting the service. This method supports volume mounting for a faster development loop. ```bash npm install -g pnpm pnpm install npm run build npm start ``` -------------------------------- ### Start Local Fluid Server (In-Memory) Source: https://github.com/microsoft/fluidframework/blob/main/README.md Run an example with an in-memory Fluid server implementation for local testing and synchronization between browser panes. ```shell npm run start ``` -------------------------------- ### Install Dependencies and Build Source: https://github.com/microsoft/fluidframework/blob/main/server/historian/README.md Install global pnpm, then install project dependencies and build the project within the container or development environment. ```bash npm install -g pnpm ``` ```bash pnpm i ``` ```bash npm run build ``` -------------------------------- ### Start Tinylicious Server Source: https://github.com/microsoft/fluidframework/wiki/Server Starts the Tinylicious development server. This command assumes the package has been installed globally. ```bash tinylicious ``` -------------------------------- ### Start Docker Containers for Fluid Reference Server Source: https://github.com/microsoft/fluidframework/blob/main/server/README.md This command starts the Docker containers for the Fluid reference server using docker-compose. Ensure Docker is installed and configured with sufficient RAM. ```bash "start:docker": "docker-compose -f server/docker-compose.yml up" ``` -------------------------------- ### Install Fetch Tool Source: https://github.com/microsoft/fluidframework/blob/main/packages/tools/fetch-tool/README.md Install the fetch-tool package as a development dependency. ```bash npm i @fluid-tools/fetch-tool -D ``` -------------------------------- ### Simple Example Usage Source: https://github.com/microsoft/fluidframework/wiki/TSDoc-Guidelines Use the @example tag to provide code samples demonstrating API usage. Multiple examples should be in separate @example blocks. The first line can serve as a title. ```typescript /** * Calculates and returns the square root of the provided value. * * @example * ```typescript * squareRoot(4); // Returns 2 * ``` */ export function squareRoot(value: number): number { ... ``` -------------------------------- ### checkInstall() Source: https://github.com/microsoft/fluidframework/blob/main/build-tools/packages/build-infrastructure/docs/interfaces/IWorkspace.md Checks if the item managed by the workspace is installed. If not installed, the `install` method can be used. ```APIDOC ## checkInstall() ### Description Returns `true` if the item is installed. If this returns `false`, then the `install` function can be called to install. ### Method `checkInstall(): Promise` ### Returns - `Promise` - A promise that resolves to `true` if the item is installed, `false` otherwise. ### Defined in [packages/build-infrastructure/src/types.ts:120](https://github.com/microsoft/FluidFramework/blob/main/build-tools/packages/build-infrastructure/src/types.ts#L120) ``` -------------------------------- ### Install @fluidframework/odsp-doclib-utils Source: https://github.com/microsoft/fluidframework/blob/main/packages/utils/odsp-doclib-utils/README.md Install the package using npm. ```bash npm i @fluidframework/odsp-doclib-utils ``` -------------------------------- ### install Source: https://github.com/microsoft/fluidframework/blob/main/build-tools/packages/build-infrastructure/docs/interfaces/IPackage.md Installs the package. Optionally updates the lockfile. ```APIDOC ## install(updateLockfile) ### Description Installs the item. ### Parameters #### Path Parameters - **updateLockfile** (boolean) - Description: If true, the lockfile will be updated. Otherwise, the lockfile will not be updated. This may cause the installation to fail. ### Returns `Promise` ``` -------------------------------- ### checkInstall Source: https://github.com/microsoft/fluidframework/blob/main/build-tools/packages/build-infrastructure/docs/interfaces/Installable.md Checks if the installable item is currently installed. Returns a promise that resolves to true if installed, and false otherwise. If false, the `install` method can be used. ```APIDOC ## checkInstall() ### Description Returns `true` if the item is installed. If this returns `false`, then the `install` function can be called to install. ### Method ```ts checkInstall(): Promise ``` ### Returns `Promise` ``` -------------------------------- ### Install @fluidframework/azure-service-utils Source: https://github.com/microsoft/fluidframework/blob/main/azure/packages/azure-service-utils/README.md Install the package using npm. ```bash npm i @fluidframework/azure-service-utils ``` -------------------------------- ### Install Datastore Package Source: https://github.com/microsoft/fluidframework/blob/main/packages/runtime/datastore/README.md Install the @fluidframework/datastore package using npm. ```bash npm i @fluidframework/datastore ``` -------------------------------- ### Install Tinylicious Client Source: https://github.com/microsoft/fluidframework/blob/main/packages/service-clients/tinylicious-client/README.md Install the @fluidframework/tinylicious-client package using npm. ```bash npm i @fluidframework/tinylicious-client ``` -------------------------------- ### Run Fetch Tool Example Source: https://github.com/microsoft/fluidframework/blob/main/packages/tools/fetch-tool/README.md Example command to run the fetch-tool to save snapshot data and messages to a specified directory. Ensure you are in the 'fetch-tool' directory and have built the project. ```bash node lib/fluidFetch.js --saveDir example 'get-versions-fetch-url' ``` -------------------------------- ### Run Example Against Azure Source: https://github.com/microsoft/fluidframework/blob/main/examples/service-clients/azure-client/external-controller/README.md Instructions to run the example using the Azure Fluid Relay service instead of the default Tinylicious. ```bash npm run start:azure ``` -------------------------------- ### Basic TypeScript Example Source: https://github.com/microsoft/fluidframework/blob/main/tools/api-markdown-documenter/src/test/snapshots/markdown/simple-suite-test/deep-config/test-suite-a/index.md A simple TypeScript code snippet used as an example. No specific setup or imports are shown. ```typescript const foo = bar; ``` -------------------------------- ### Install Dependencies Source: https://github.com/microsoft/fluidframework/blob/main/docs/docs/start/quick-start.mdx Navigate to the cloned project directory and install the necessary dependencies using npm. ```bash cd FluidHelloWorld npm install ``` -------------------------------- ### Get merge status for main and next branches Source: https://github.com/microsoft/fluidframework/blob/main/build-tools/packages/build-cli/docs/merge.md Example of how to get merge status information for the default main and next branches. ```bash $ flub merge info ``` -------------------------------- ### Start Local Development Server (with Search) Source: https://github.com/microsoft/fluidframework/blob/main/docs/README.md Starts a local development server that includes Typesense search functionality. Requires appropriate .env file configuration. ```shell pnpm run start ``` -------------------------------- ### Build Project Configuration Example Source: https://github.com/microsoft/fluidframework/blob/main/build-tools/packages/build-infrastructure/README.md Configures three workspaces with different release group archetypes: multiple release groups, a single release group with multiple packages, and a single release group with a single package. Each release group specifies included packages, an optional root package, and an optional ADO pipeline URL. ```javascript buildProject: { workspaces: { // This is the name of the workspace which is how it's referenced in the API. All workspaces in a build project must // have a unique name. "client": { // This workspace is rooted at the root of the Git repo. directory: ".", releaseGroups: { // This key is the name of the release group. All release groups in a build project must have a unique name. client: { // The include property can contain package names OR package scopes. If // a scope is provided, all packages with that scope will be a part of // the release group. include: [ // Include all the Fluid Framework scopes and packages except for // @fluid-example. "@fluidframework", "@fluid-experimental", "@fluid-internal", "@fluid-private", "@fluid-tools", // This private package is part of the client release group "@types/jest-environment-puppeteer" "fluid-framework", ], // A release group can have an OPTIONAL root package. This package // is typically private and is similar to the root package for a workspace. // This release group root package may be useful to store scripts or other // configuration that only applies on the release group, rootPackageName: "client-release-group-root", // A release group may have an ADO pipeline URL associated with it. This // URL is used to provide direct links to the pipeline when running releases. adoPipelineUrl: "https://dev.azure.com/fluidframework/internal/_build?definitionId=12", }, examples: { // This release group contains only the @fluid-example packages. include: ["@fluid-example"], // Release group root packages are optional but can be useful to store scripts that are tuned to // apply to only that release group. rootPackageName: "examples-release-group-root", }, // If any packages in the workspace don't match a release group, loading the // build project config will throw an error. }, }, "build-tools": { // This workspace is rooted in the build-tools folder. This folder must contain // a workspace config. The specific config depends on the package manager being used. directory: "./build-tools", releaseGroups: { // Release groups can have the same name as workspaces, but all release group names // must be unique regardless of the workspace they belong to. "build-tools": { include: [ // Include all Fluid Framework scopes. Only packages contained in the workspace // will be included, so it is safe to use the same scopes in multiple release // group definitions as long as they're in different workspaces. "@fluidframework", "@fluid-example", "@fluid-experimental", "@fluid-internal", "@fluid-private", "@fluid-tools", ], rootPackageName: "build-tools-release-group-root", adoPipelineUrl: "https://dev.azure.com/fluidframework/internal/_build?definitionId=14", }, }, }, }, } ``` -------------------------------- ### Install and Build Fluid Framework Source: https://github.com/microsoft/fluidframework/wiki/Client Installs all project dependencies and then builds the entire Fluid Framework codebase. Run these commands from the root FluidFramework directory. ```bash pnpm install pnpm build:fast ``` -------------------------------- ### Full Stickiness Example Source: https://github.com/microsoft/fluidframework/blob/main/docs/docs/data-structures/sequences.md Demonstrates an interval that expands to include text inserted at both its start and end. ```plaintext aXbYc ^^^ ``` -------------------------------- ### Example of specifying a reporter path Source: https://github.com/microsoft/fluidframework/blob/main/packages/test/mocha-test-setup/README.md When providing a path to a reporter file, it's generally safest to specify it starting with the package name. This example shows how to use the `--reporter` flag with a package path. ```console mocha --require @fluid-internal/mocha-test-setup --reporter @fluid-tools/benchmark/dist/mocha/Reporter.js ``` -------------------------------- ### install() Source: https://github.com/microsoft/fluidframework/blob/main/build-tools/packages/build-infrastructure/docs/interfaces/IWorkspace.md Installs the item associated with the workspace. Optionally updates the lockfile. ```APIDOC ## install() ### Description Installs the item. If `updateLockfile` is true, the lockfile will be updated. Otherwise, the lockfile will not be updated, which may cause the installation to fail. ### Method `install(updateLockfile: boolean): Promise` ### Parameters #### Path Parameters - **updateLockfile** (boolean) - Required. If true, the lockfile will be updated. Otherwise, the lockfile will not be updated. ### Returns - `Promise` - A promise that resolves to `true` if the installation was successful, `false` otherwise. ### Defined in [packages/build-infrastructure/src/types.ts:128](https://github.com/microsoft/FluidFramework/blob/main/build-tools/packages/build-infrastructure/src/types.ts#L128) ``` -------------------------------- ### Generate Production Bundle for Benchmarking Source: https://github.com/microsoft/fluidframework/blob/main/examples/benchmarks/bubblebench/ot/README.md Run this command to create a production-ready bundle for accurate performance measurements. Ensure you are in the project directory. ```bash npm run start -- --env.production ``` -------------------------------- ### IPackageManager installCommand Method Source: https://github.com/microsoft/fluidframework/blob/main/build-tools/packages/build-infrastructure/docs/interfaces/IPackageManager.md Generates the command string for installing dependencies. The command will not include the package manager name itself. Use this method to get the appropriate install command based on whether the lockfile needs to be updated. ```typescript installCommand(updateLockfile): string ``` -------------------------------- ### Fetch Latest Commits Source: https://github.com/microsoft/fluidframework/wiki/Repo-Basics Get the latest changes from the official repository's main branch before starting your work. ```bash git checkout main git pull ``` -------------------------------- ### Fluid Runner Export File Command (Global Install) Source: https://github.com/microsoft/fluidframework/blob/main/packages/tools/fluid-runner/README.md Example command to export a file using fluid-runner when the package is installed globally. It specifies the code loader, input file, output file, and telemetry file. ```bash node fluid-runner exportFile --codeLoader=compiledBundle.js --inputFile=inputFileName.fluid --outputFile=result.txt --telemetryFile=telemetryFile.txt ``` -------------------------------- ### Create and Navigate to Certs Directory Source: https://github.com/microsoft/fluidframework/blob/main/server/routerlicious/packages/services-ordering-rdkafka/README.md Creates a directory named 'certs' and navigates into it. This is the first step in setting up SSL certificates. ```bash $ mkdir certs $ cd certs ``` -------------------------------- ### Example Fluid Repo Layout Configuration Source: https://github.com/microsoft/fluidframework/blob/main/build-tools/packages/build-infrastructure/docs/README.md This example demonstrates a complex repository layout with multiple workspaces and release groups, showcasing various configuration options like package inclusions and ADO pipeline URLs. ```javascript repoLayout: { workspaces: { // This is the name of the workspace which is how it's referenced in the API. All workspaces in a Fluid repo must // have a unique name. "client": { // This workspace is rooted at the root of the Git repo. directory: ".", releaseGroups: { // This key is the name of the release group. All release groups in a Fluid repo must have a unique name. client: { // The include property can contain package names OR package scopes. If // a scope is provided, all packages with that scope will be a part of // the release group. include: [ // Include all the Fluid Framework scopes and packages except for // @fluid-example. "@fluidframework", "@fluid-experimental", "@fluid-internal", "@fluid-private", "@fluid-tools", // This private package is part of the client release group "@types/jest-environment-puppeteer" "fluid-framework", ], // A release group can have an OPTIONAL root package. This package // is typically private and is similar to the root package for a workspace. // This release group root package may be useful to store scripts or other // configuration that only applies on the release group, rootPackageName: "client-release-group-root", // A release group may have an ADO pipeline URL associated with it. This // URL is used to provide direct links to the pipeline when running releases. adoPipelineUrl: "https://dev.azure.com/fluidframework/internal/_build?definitionId=12", }, examples: { // This release group contains only the @fluid-example packages. include: ["@fluid-example"], // Release group root packages are optional but can be useful to store scripts that are tuned to // apply to only that release group. rootPackageName: "examples-release-group-root", }, // If any packages in the workspace don't match a release group, loading the // repo layout config will throw an error. }, }, "build-tools": { // This workspace is rooted in the build-tools folder. This folder must contain // a workspace config. The specific config depends on the package manager being used. directory: "./build-tools", releaseGroups: { // Release groups can have the same name as workspaces, but all release group names // must be unique regardless of the workspace they belong to. "build-tools": { include: [ // Include all Fluid Framework scopes. Only packages contained in the workspace // will be included, so it is safe to use the same scopes in multiple release // group definitions as long as they're in different workspaces. "@fluidframework", "@fluid-example", "@fluid-experimental", "@fluid-internal", "@fluid-private", "@fluid-tools", ], rootPackageName: "build-tools-release-group-root", adoPipelineUrl: "https://dev.azure.com/fluidframework/internal/_build?definitionId=14", }, }, }, }, } ``` -------------------------------- ### Force Reauthentication for SharePoint Source: https://github.com/microsoft/fluidframework/blob/main/examples/utils/webpack-fluid-loader/README.md Append this flag to the start command to force a reauthentication for SharePoint examples. This is useful when cached tokens are outdated or incorrect. ```sh npm run start:spo-df -- --env forceReauth ``` -------------------------------- ### Install Dependencies and Build Source: https://github.com/microsoft/fluidframework/blob/main/server/gitrest/CLAUDE.md Commands to install project dependencies, build all packages, or build without linting for faster compilation. ```shell pnpm install pnpm run build pnpm run build:compile ``` -------------------------------- ### Install Documentation Dependencies Source: https://github.com/microsoft/fluidframework/wiki/Checking-for-broken-links-in-the-documentation Install the necessary Node.js packages for building and checking the documentation using pnpm. ```bash pnpm i ``` -------------------------------- ### Package Manager Interface Source: https://github.com/microsoft/fluidframework/blob/main/build-tools/packages/build-infrastructure/api-report/build-infrastructure.api.md Defines the interface for package managers, including methods for getting install commands and properties like lockfile name. ```typescript // @public export interface IPackageManager { getInstallCommandWithArgs(updateLockfile: boolean): string[]; readonly lockfileName: string; readonly name: PackageManagerName; } ``` -------------------------------- ### Markdown Magic: Library Readme Header Transform Source: https://github.com/microsoft/fluidframework/blob/main/tools/markdown-magic/README.md Example of using the LIBRARY_README_HEADER transform to generate a standard header for a library package README. This includes installation and import instructions. ```markdown ``` -------------------------------- ### install Source: https://github.com/microsoft/fluidframework/blob/main/build-tools/packages/build-infrastructure/docs/interfaces/Installable.md Installs the item. Optionally updates the lockfile if the `updateLockfile` parameter is set to true. ```APIDOC ## install(updateLockfile) ### Description Installs the item. ### Method ```ts install(updateLockfile: boolean): Promise ``` ### Parameters #### Path Parameters - **updateLockfile** (boolean) - Required - If true, the lockfile will be updated. Otherwise, the lockfile will not be updated. This may cause the installation to fail. ### Returns `Promise` ``` -------------------------------- ### Abstract Interval Stickiness Examples Source: https://github.com/microsoft/fluidframework/blob/main/packages/dds/sequence/README.md Illustrates different types of interval stickiness (none, start, end, full) using a simple string 'abc' and inserted characters 'X' and 'Y'. ```typescript abc ^ ``` ```typescript aXbYc ^ ``` ```typescript aXbYc ^^ ``` ```typescript aXbYc ^^ ``` ```typescript aXbYc ^^^ ``` -------------------------------- ### Example Output of Fetch Tool Source: https://github.com/microsoft/fluidframework/blob/main/packages/test/snapshots/README.md Illustrates the directory structure and file output from the fetch-tool when retrieving document snapshots and operations. ```bash C:\snapshots>dir 07/26/2021 05:28 PM . 07/26/2021 05:28 PM .. 07/26/2021 05:28 PM 0-bB8gBAAAHAAAA 07/26/2021 05:28 PM 1-bBwAAAAAHAAAA 07/26/2021 05:28 PM 680 info.json 07/26/2021 05:28 PM 641,806 messages.json 2 File(s) 642,486 bytes 4 Dir(s) 243,849,199,616 bytes free ``` -------------------------------- ### Install Compat Versions Source: https://github.com/microsoft/fluidframework/blob/main/packages/test/test-version-utils/compat-workspaces/README.md Run this command from `packages/test/test-version-utils` after a Fluid Framework version bump to update compatibility versions. ```bash pnpm run update-compat-versions ``` -------------------------------- ### Remove and Insert Item Example Source: https://github.com/microsoft/fluidframework/blob/main/packages/dds/tree/docs/user-facing/array-merge-semantics.md Demonstrates moving an item to the start of an array by removing it and then unshifting it. This pattern is common in plain JavaScript arrays but requires specific move operations in SharedTree arrays. ```typescript const C = array.pop(); // Remove C -> [A, B] array.unshift(C); // Insert C at the start -> [C, A, B] ``` -------------------------------- ### Remove connected property from IContainer Source: https://github.com/microsoft/fluidframework/wiki/Communicating-breaking-changes Example of a breaking change note illustrating the removal of the 'connected' property from IContainer. This snippet shows the final state after deprecation, guiding users to the replacement API. ```markdown ## 2.0.0 Breaking changes - [Removed connected property from IContainer](#Remove-connected-property-from-IContainer) ### Removed connected property from IContainer The `connected` field is removed from `IContainer` in the `@fluidframework/container-definitions` package. It was deprecated in 1.0.0 and it is now in removed in 2.0.0. Please use `IContainer.connectionState` instead (see example below). Note: `ConnectionState` can be imported from the fluid-framework package. ```diff - if (container.connected) { + if (container.connectionState === ConnectionState.Connected) { console.log("Container is connected"); } ``` ``` -------------------------------- ### Install and Run Fluid Version Tools CLI Source: https://github.com/microsoft/fluidframework/blob/main/build-tools/packages/version-tools/README.md Install the version-tools package globally and run the 'fluv' command. This snippet shows basic CLI usage and help commands. ```sh npm install -g @fluid-tools/version-tools $ fluv COMMAND ``` ```sh $ fluv (--version|-V) @fluid-tools/version-tools/0.0.0 ``` ```sh $ fluv --help [COMMAND] ``` -------------------------------- ### Deprecate connected property from IContainer Source: https://github.com/microsoft/fluidframework/wiki/Communicating-breaking-changes Example of an upcoming change note demonstrating the deprecation of the 'connected' property from IContainer and its replacement with 'connectionState'. This snippet shows how to signal a future removal and guide users to migrate. ```markdown ## 1.0.0 Upcoming changes - [Deprecate connected property from IContainer](#Deprecate-connected-property-from-IContainer) ### Deprecate connected property from IContainer The `connected` field has been deprecated from `IContainer` the `@fluidframework/container-definitions`. The property will be removed in a future release. Please migrate all usage to `IContainer.connectionState` (see example below). Note: `ConnectionState` can be imported from the fluid-framework package. ```diff - if (container.connected) { + if (container.connectionState === ConnectionState.Connected) { console.log("Container is connected"); } ``` ``` -------------------------------- ### Full Schema Migration Example with Staged Types Source: https://github.com/microsoft/fluidframework/blob/main/RELEASE_NOTES/2.53.0.md Demonstrates a complete schema migration process using `SchemaFactoryAlpha`, including initial schema setup, staged type introduction, client synchronization, and schema upgrade. ```typescript // Schema A: only number allowed const schemaA = SchemaFactoryAlpha.optional([SchemaFactoryAlpha.number]); // Schema B: number or string (string is staged) const schemaB = SchemaFactoryAlpha.optional([ SchemaFactoryAlpha.number, SchemaFactoryAlpha.staged(SchemaFactoryAlpha.string), ]); // Schema C: number or string, both fully allowed const schemaC = SchemaFactoryAlpha.optional([ SchemaFactoryAlpha.number, SchemaFactoryAlpha.string, ]); // Initialize with schema A. const configA = new TreeViewConfiguration({ schema: schemaA, }); const viewA = treeA.viewWith(configA); viewA.initialize(5); // Since we are running all the different versions of the app in the same process making changes synchronously, // an explicit flush is needed to make them available to each other. synchronizeTrees(); assert.deepEqual(viewA.root, 5); // View the same document with a second tree using schema B. const configB = new TreeViewConfiguration({ schema: schemaB, }); const viewB = treeB.viewWith(configB); // B cannot write strings to the root. assert.throws(() => (viewB.root = "test")); // View the same document with a third tree using schema C. const configC = new TreeViewConfiguration({ schema: schemaC, }); const viewC = treeC.viewWith(configC); // Upgrade to schema C viewC.upgradeSchema(); // Use the newly enabled schema. viewC.root = "test"; synchronizeTrees(); // View A is now incompatible with the stored schema: assert.equal(viewA.compatibility.canView, false); // View B can still read the document, and now sees the string root which relies on the staged schema. assert.deepEqual(viewB.root, "test"); ``` -------------------------------- ### NPM Scripts for Fluid Framework Testing Source: https://github.com/microsoft/fluidframework/blob/main/docs/docs/testing/testing.mdx Example npm scripts for managing and running Fluid Framework tests. Includes commands to start Tinylicious, run Mocha tests, execute tests against Azure, and run tests against Tinylicious with server startup and testing orchestration. ```json "scripts": { ... "start:tinylicious": "tinylicious > tinylicious.log 2>&1", "test:mocha": "mocha", "test:azure": "cross-env process.env.FLUID_CLIENT='\"azure\"' && npm run test:mocha", "test:tinylicious": "start-server-and-test start:tinylicious 7070 test:mocha", ... } ``` -------------------------------- ### Start Tinylicious Server (Local Build) Source: https://github.com/microsoft/fluidframework/wiki/Server Starts the Tinylicious server after it has been built locally. This command is run from the './server/tinylicious' directory. ```bash npm start ``` -------------------------------- ### Installable Interface Source: https://github.com/microsoft/fluidframework/blob/main/build-tools/packages/build-infrastructure/api-report/build-infrastructure.api.md Interface for components that can be installed, providing methods to check installation status and perform installation. ```typescript // @public export interface Installable { checkInstall(): Promise; install(updateLockfile: boolean): Promise; } ``` -------------------------------- ### Check Installation Status Source: https://github.com/microsoft/fluidframework/blob/main/build-tools/packages/build-infrastructure/docs/interfaces/Installable.md Use this method to determine if an installable item is already installed. If it returns false, the install method can be used. ```typescript checkInstall(): Promise ```