theatre/packages/browser-bundles
Fülöp 3d10325873
Add tests for Theatre.js + popular setups in the ecosystem (#165)
This implements some basic infra for testing Theatre.js with popular setups such as npm/yarn/pnpm, webpack/vite/parcel, js/ts, etc.

So far, the only existing setup has been with create-react-app. Will add more in the future.

Co-authored-by: Fülöp <fulopkovacs@users.noreply.github.com>
Co-authored-by: Aria Minaei <aria.minaei@gmail.com>
2022-05-17 20:53:01 +02:00
..
devEnv Implemented @theatre/browser-bundles 2021-09-30 21:58:22 +02:00
src Implemented @theatre/browser-bundles 2021-09-30 21:58:22 +02:00
.gitignore Implemented @theatre/browser-bundles 2021-09-30 21:58:22 +02:00
LICENSE README: add theatre logo. Add/fix social links (#113) 2022-04-05 13:29:40 -04:00
package.json Add tests for Theatre.js + popular setups in the ecosystem (#165) 2022-05-17 20:53:01 +02:00
README.md Implemented @theatre/browser-bundles 2021-09-30 21:58:22 +02:00
test.html Implemented @theatre/browser-bundles 2021-09-30 21:58:22 +02:00
tsconfig.json Implemented @theatre/browser-bundles 2021-09-30 21:58:22 +02:00

Theatre.js browser bundles

A custom build of Theatre.js that you can use via a <script> tag rather than using a bundler.

How to use

There are currently two builds:

  • dist/core-and-studio.js
  • dist/core-only.min.js

As the names imply, one includes both @theatre/studio and @theatre/core, while the other is a minified version of @theatre/core.

Example:

<script src="path/to/core-and-studio.js"></script>
<script>
  // here, core is equal to `import * as core from '@theatre/core`
  const core = Theatre.core
  // here, studio is equal to `import studio from '@theatre/studio`.
  // Note this would be undefined if you're using `core-only.min.js`
  const studio = Theatre.studio

  // only call this if you're using the core-and-studio.js bundle
  studio.initialize()

  const project = core.getProject("My project")
  const sheet = project.sheet("...")
  // and so on...
</script>