The Swim frontend runtime provides foundation frameworks for building massively real-time streaming applications. The runtime provides applications with:
- Modern Foundation: Dependency-free, 100% TypeScript foundation framework for Node.js and browser apps.
- Shared States: Multiplexed streaming API client for continuously synchronizing real-time shared states with backend Web Agents.
npm install @swim/runtime
<!-- Development -->
<script src="https://cdn.swimos.org/js/4.x/swim-runtime.js"></script>
<!-- Production -->
<script src="https://cdn.swimos.org/js/4.x/swim-runtime.min.js"></script>
Install build dependencies:
npm install
The Swim TypeScript stack is compiled using a custom build script. Before building the stack, first bootstrap the build script.
npm run bootstrap
Use npx swim-build
to execute build commands:
npx swim-build help # prints build script usage instructions
npx swim-build pkgs # lists buildable packages
The default swim-build
command will compile, lint, api-extract, and bundle
TypeScript sources. To compile all libraries, of all packages, run:
npx swim-build
To compile a subset of packages, include a --pkgs
(-p
) option followed
by a comma-separated list of package names. For example, to build the core
package, run:
npx swim-build -p core
The test
subcommand reruns unit tests. For example, to compile and test
the core
package and its dependencies, run:
npx swim-build test -p core -r
The watch
subcommand automatically rebuilds packages when dependent files
change. For example, to continuously build the host
package, run:
npx swim-build watch -p host
The doc
subcommand generates API documentation:
npx swim-build doc -p runtime
Take a look at the Contributing Guide to learn about our submission process, coding standards, and more.