Library for building distributed, real-time collaborative web applications
Перейти к файлу
Tyler Butler 03c12336a8
build(client): Tag asserts (#13798)
Tagging asserts in preparation for a release.

Commands used:

```shell
npm run policy-check:asserts
```
2023-01-25 14:05:50 -08:00
.devcontainer
.github Main to next 2023-01-24 22:45:42 -06:00
.md-magic-templates tools: Update md-magic template infra, and update contribution guidelines template to match root README (#13580) 2023-01-13 11:32:56 -08:00
.vscode feat: Add initial Fluid Client Debugger prototype libraries (#13425) 2023-01-06 15:31:15 -08:00
api-report Patch InsecureTokenProvider's user parameter with missing field `name` (#13613) 2023-01-25 10:45:12 -08:00
azure Fix unit tests 2023-01-25 17:53:06 +00:00
build-tools Automation: Main Next Integrate 2023-01-25 11:28:38 -08:00
common Main to next 2023-01-24 22:45:42 -06:00
docs Remove note from all recipes affected by buffer to install package (#13110) 2023-01-13 16:35:53 -08:00
examples Automation: Main Next Integrate 2023-01-25 11:28:38 -08:00
experimental Automation: Main Next Integrate 2023-01-25 11:28:38 -08:00
packages build(client): Tag asserts (#13798) 2023-01-25 14:05:50 -08:00
server Upgrading node-rdkafka to 2.14.5 (#13785) 2023-01-25 09:51:16 -08:00
tools Main to next 2023-01-24 14:14:44 -06:00
.dockerignore
.editorconfig
.gitattributes
.gitignore
.gitmodules
.markdownlint.json
.npmpackagejsonlintrc.json
.npmrc
.nvmrc
.prettierignore
BREAKING.md Patch InsecureTokenProvider's user parameter with missing field `name` (#13613) 2023-01-25 10:45:12 -08:00
CODE_OF_CONDUCT.md
CONTRIBUTING.md
LICENSE
NOTICE.md
PACKAGES.md build: Remove @fluid-experimental/get-container package (#13781) 2023-01-25 01:11:08 +00:00
README.md tools(docs): Update md-magic config to include prettier-ignore directives in generated content blocks (#13627) 2023-01-13 16:05:48 -08:00
SECURITY.md
lerna-package-lock.json Automation: Main Next Integrate 2023-01-25 11:28:38 -08:00
lerna.json release(client): Bump 2.0.0-internal.2.3.0 => 2.0.0-internal.2.4.0 (minor) (#13632) 2023-01-17 16:29:40 -08:00
package-lock.json Automation: Main Next Integrate 2023-01-25 11:28:38 -08:00
package.json build(client): Upgrade build-tools dependency to 0.8.0 (#13790) 2023-01-25 10:49:24 -08:00

README.md

Fluid

The Fluid Framework is a library for building distributed, real-time collaborative web applications using JavaScript or TypeScript.

Getting started using the Fluid Framework

You may be here because you want to...

  • Learn more about the Fluid Framework
  • Build a Fluid object

Documentation and guides can be found at https://fluidframework.com/.

Hello World repo can be found at https://github.com/microsoft/FluidHelloWorld.

Core Examples repo can be found at https://github.com/microsoft/FluidExamples.

Have questions? Engage with other Fluid Framework users and developers in the [Discussions] section of our GitHub repo.

Code structure

The core code for both the Fluid client packages and the reference ordering service is contained within this repo.

The repo structure is somewhat unique because it contains five monorepos as well as several standalone packages. The monorepos are managed using Lerna and are versioned separately from one another, but internally all packages in a monorepo are versioned together. Outside the monorepos there are plenty of packages which are versioned independently.

These monorepos (which also serve as "release groups") do not necessary align with package namespaces, and also don't necessary correspond to a single directory of this repo.

Here's the list of Lerna managed release groups:

Here's a list of other sets of other packages (each package within these groups is versioned independently, forming its own release group):

  • "Common" Packages: miscellaneous packages in the ./common directory and published under the @fluidframework/ namespace. Most of these (but not all) have "common" in their package name. Packages which are used by multiple other groups of packages (such as built tools, linter configs and protocol definitions) live here.
  • "Tools" Packages: miscellaneous packages in the ./tools directory and published under a variety of namespaces. Logically about the same as "Common", but most of the names include "tools" instead of "common".
  • Auxiliary Microservice Packages (supporting Routerlicious)
    • ./server excluding routerlicious, gitrest and historian (Published in the @fluidframework/ namespace)
  • ./docs: The code and content for https://fluidframework.com.

Dependencies between packages in various layers of the system are enforced via a build step called layer-check. You can view the full list of packages and layers in PACKAGES.md.

Building

In order to build the Fluid Framework, ensure that you have installed Git and the version of Node.js noted in the .nvmrc file.

Note: we recommend using nvm (for Windows or MacOS/Linux) or fnm to install Node.js, in case you find yourself needing to install different versions of Node.js side-by-side.

Because of a transitive dependency on a native addon module, you'll also need to ensure that you have the prerequisites for node-gyp. Depending on your operating system, you'll have slightly different installation requirements (these are largely copied from node-gyp's documentation):

On Windows

The node installer should ask if you want to install "Tools for Native Modules." If you check the box for this nothing further should be needed. Otherwise, you can follow the steps listed here

On Unix

  1. Python v3.7, v3.8, v3.9, or v3.10
  2. make
  3. A C/C++ toolchain (like GCC)

On MacOS

If you've upgraded your Mac to Catalina or higher, you may need to follow these instructions.

  1. Python v3.7, v3.8, v3.9, or v3.10
  2. XCode Command Line Tools, which will install make, clang, and clang++
    • You can install these by running xcode-select --install from a command line.

Clone a copy of the repo and change to the repo root directory:

git clone https://github.com/microsoft/FluidFramework.git
cd FluidFramework

Run the following to build the client packages:

npm install
npm run build:fast

See also: Contributing

Other Build Requirements

  • Building server/Routerlicious
    • Refer to that package's README for additional requirements.
    • Note that these requirements do not affect all workflows (e.g. the one noted above), but will affect workflows that include the packages under server (e.g. fluid-build --symlink:full).

On Windows

  • Ensure that you have enabled running Powershell scripts by setting your environment's Execution Policy.

Testing

You can run all of our tests from the root of the repo, or you can run a scoped set of tests by running the test command from the package you're interested in.

Note: Some of the tests depend on test collateral that lives in a submodule here: https://github.com/microsoft/FluidFrameworkTestData. You may choose to fetch that collateral into your local repository, which is required to run all the tests - otherwise some will be skipped.

First install Git LFS from https://git-lfs.github.com/. Then, from the repo root:

git lfs install
git submodule init
git submodule update

Run the tests

npm run test

Include code coverage

npm run test:coverage

Mimic the official CI build

Our CI pipelines run on Linux machines, and the npm scripts all have the ci prefix. To replicate the test steps from the CI pipeline locally, run the following commands for the packages or Lerna monorepos:

Run Non-Windows Windows
PR npm run ci:test npm run test:report && npm run test:copyresults
Official npm run ci:test:coverage npm run test:coverage && npm run test:copyresults

Run tests from within VS Code

We've checked in VS Code configuration enabling F5 from a spec.ts file to run those tests if you set the debug configuration to "Debug Current Test".

Run it locally

Single browser window, two panes

This will use an in-memory implementation of the Fluid server to sync between the two panes in the browser window.

  • Choose an example under /examples
  • Navigate to the example's directory, e.g. /examples/data-objects/clicker
  • npm run start
  • Browse to http://localhost:8080 to interact with two copies of the example side-by-side

Multiple browser instances on the same device

This will run the local Fluid server implementation we call "Tinylicious", so you can sync between multiple browser instances.

First, start Tinylicious by running these commands from /server/tinylicious:

npm install
npm run build
npm run start

Then:

  • Navigate to the example of your choice (same as above)
  • npm run start:tinylicious
  • Browse to http://localhost:8080, copy the full URL you're redirected to, and open in a second window to collaborate

Contributing

There are many ways to contribute to Fluid.

Detailed instructions for working in the repo can be found in the Wiki.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

This project may contain Microsoft trademarks or logos for Microsoft projects, products, or services. Use of these trademarks or logos must follow Microsofts Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship.