You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/blog/2024-04-23-introducing-bitbybit-runner.md
+16Lines changed: 16 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,22 @@ description: "Containment has failed! Run your Bitbybit.dev scripts wherever you
8
8
9
9

10
10
11
+
:::info Update - January 2026
12
+
13
+
Since this post was originally published, **Bitbybit Runner has significantly evolved**. What started as a single Babylon.js-based runner has now expanded to support **multiple game engines**:
14
+
15
+
-**Babylon.js Runner** - The original implementation (full and lite variants)
16
+
-**Three.js Runner** - Support for the popular Three.js library (full and lite variants)
17
+
-**PlayCanvas Runner** - Integration with the PlayCanvas game engine (full and lite variants)
18
+
19
+
Each runner comes in two variants:
20
+
-**Full Runner** - Includes the game engine in the bundle for quick setup
21
+
-**Lite Runner** - Excludes the game engine, allowing you to load it separately for better flexibility and smaller bundle sizes
22
+
23
+
Learn more about using runners with different engines in our [comprehensive runner documentation](/learn/runners/intro).
24
+
25
+
:::
26
+
11
27
In the last couple of weeks, we've been discussing and experimenting with a new way to run and embed Bitbybit.dev scripts. The result of these experiments is a new tool called **BITBYBIT-RUNNER.JS**. You can now run your scripts on your own websites, blogs, webshops, or third-party coding sites!
Copy file name to clipboardExpand all lines: docs/blog/2024-11-08-updated-bitbybit-runners.md
+48-14Lines changed: 48 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,11 @@ Our **Bitbybit Runners** allow you to easily include Bitbybit.dev's powerful 3D
12
12
13
13
<!--truncate-->
14
14
15
-
Furthermore, we've developed new **Lite versions** of the runners for both ThreeJS and BabylonJS. These Lite versions allow you to load the respective game engines separately if you're already including them in your project, significantly reducing bundle sizes. Learn more about these exciting updates in this blog post.
15
+
:::info Update: January 6, 2026
16
+
This article has been updated to include information about our new **PlayCanvas Runner**! PlayCanvas is now the third officially supported game engine for Bitbybit Runners, joining BabylonJS and ThreeJS. All the concepts about Lite versions and runner architecture described below now apply to PlayCanvas as well. [Read the full PlayCanvas announcement here](/blog/playcanvas-support).
17
+
:::
18
+
19
+
Furthermore, we've developed new **Lite versions** of the runners for both ThreeJS and BabylonJS (and now PlayCanvas!). These Lite versions allow you to load the respective game engines separately if you're already including them in your project, significantly reducing bundle sizes. Learn more about these exciting updates in this blog post.
16
20
17
21
### Brief History of the Runner
18
22
@@ -23,21 +27,23 @@ About six months ago, we introduced the first version of the `bitbybit-runner`,
23
27
If you're unfamiliar with how the runner works or want a refresher, be sure to check out our original introduction article:
### New and Improved Runners: Enter ThreeJS! (And Later, PlayCanvas!)
27
31
28
32
Recently, we [announced official support for the ThreeJS game engine](/blog/threejs-support) via new NPM packages. Shortly after, we received requests from the community for a dedicated runner specifically for ThreeJS. Based on your valuable feedback, we are thrilled to announce the release of a **new Bitbybit Runner for ThreeJS**!
29
33
34
+
**Update 2026:** Following the same principles, we've now also released a [PlayCanvas Runner](/blog/playcanvas-support), bringing the total number of supported game engines to three!
35
+
30
36
This new runner follows the same core principles as the BabylonJS version but is specifically designed and optimized to work with ThreeJS. Like the original, it’s a single JavaScript file you can add to your website. The runner automatically loads all necessary resources, including web workers, CAD kernels, and other dependencies required to run your Bitbybit.dev scripts within a ThreeJS environment.
31
37
32
38
While developing the ThreeJS runner, we also realized that many projects already include ThreeJS (or BabylonJS) as a dependency in their existing build setups. To avoid the redundancy of loading the entire game engine again from the runner’s bundled JavaScript file, we addressed this with a new, more flexible solution.
33
39
34
40
### Introducing "Lite" Versions of the Runners
35
41
36
-
We’ve created **Lite versions** of our runners for both ThreeJS and BabylonJS. These versions allow you to load the respective game engines *separately* if they are already part of your project, thus reducing redundancy and improving load times.
42
+
We've created **Lite versions** of our runners for BabylonJS, ThreeJS, and PlayCanvas. These versions allow you to load the respective game engines *separately* if they are already part of your project, thus reducing redundancy and improving load times.
37
43
38
-
The Lite bundles are significantly smaller because they **do not include the game engine dependencies** themselves. Instead, they expect the game engine (ThreeJS or BabylonJS) to be available in the global scope (e.g., on the `window` object).
44
+
The Lite bundles are significantly smaller because they **do not include the game engine dependencies** themselves. Instead, they expect the game engine (BabylonJS, ThreeJS, or PlayCanvas) to be available in the global scope (e.g., on the `window` object).
39
45
40
-
If your project already loads ThreeJS or BabylonJS via a script tag, NPM import, or another method, using the Lite version of the corresponding Bitbybit Runner will prevent duplicate loading of the engine, making your website faster and more efficient.
46
+
If your project already loads one of these game engines via a script tag, NPM import, or another method, using the Lite version of the corresponding Bitbybit Runner will prevent duplicate loading of the engine, making your website faster and more efficient.
41
47
42
48
### ThreeJS Runners: Examples in Action
43
49
@@ -88,22 +94,42 @@ Here's a summary of the Bitbybit Runners now available:
88
94
* A lightweight version of the ThreeJS runner that **does not include** the ThreeJS engine.
89
95
* It expects the `window` object to contain these global ThreeJS dependencies before initialization: `THREE` (for ThreeJS itself) and `OrbitControls` (if you plan to use them via the runner's setup). Only then can this Lite runner initialize successfully.
90
96
* Use this if ThreeJS is already loaded in your project.
* A lightweight version of the PlayCanvas runner that **does not include** the PlayCanvas engine.
103
+
* It expects the `window` object to contain the `pc` (PlayCanvas) global before initialization.
104
+
* Use this if PlayCanvas is already loaded in your project.
91
105
92
-
### How BabylonJS Runners Differ from ThreeJS Runners
106
+
### How BabylonJS, ThreeJS, and PlayCanvas Runners Differ
93
107
94
-
Both sets of runners (BabylonJSand ThreeJS) can execute all of our open-source 3D modeling algorithms and interact with our CAD kernels (OCCT, JSCAD). The primary differences are related to the game engines themselves and their specific features:
108
+
All three runner families (BabylonJS, ThreeJS, and PlayCanvas) can execute all of our open-source 3D modeling algorithms and interact with our CAD kernels (OCCT, JSCAD, Manifold). The primary differences are related to the game engines themselves and their specific features:
95
109
96
110
***Visual Script Compatibility:** If you are looking to export and run scripts created with our visual programming editors (Rete, Blockly) on the Bitbybit.dev website, you will generally have more success and feature parity with the **BabylonJS runner**. Our visual editors are natively based on BabylonJS. Thus, if your scripts use specific BabylonJS features (like our built-in skyboxes, GUI elements, Havok physics integrations, specific BabylonJS materials, etc.), you should use a BabylonJS runner.
97
-
***Error Handling for Visual Scripts in ThreeJS Runner:** The ThreeJS runner will also attempt to run visual scripts exported from Bitbybit.dev. However, if it encounters BabylonJS-specific logic, it will throw an error as those features are not available in a ThreeJS context. That said, if you limit your visual coding to *only* contain 3D modeling-related features (CAD operations, basic geometry, etc.) without engine-specific rendering features, then your scripts *should* execute just fine with the ThreeJS runner.
98
-
***Direct JavaScript Coding:** If you are simply writing Bitbybit.dev logic directly in JavaScript (not exporting from visual editors), then either of these runners (BabylonJS or ThreeJS, full or Lite) will work well for you for the core CAD functionalities.
99
-
***Bundle Size:** You will notice that the bundle size of the full BabylonJS runner is larger than the full ThreeJS runner. This is something to consider when deciding which runner to use, especially if bundle size is a critical factor for your project. The Lite versions, of course, are much smaller for both.
100
-
101
-
No matter your preference, we love both of these incredible game engines, and we are excited to see what you will create with them using Bitbybit.dev!
111
+
***Error Handling for Visual Scripts in ThreeJS and PlayCanvas Runners:** The ThreeJS and PlayCanvas runners will also attempt to run visual scripts exported from Bitbybit.dev. However, if they encounter BabylonJS-specific logic, they will throw an error as those features are not available in their contexts. That said, if you limit your visual coding to *only* contain 3D modeling-related features (CAD operations, basic geometry, etc.) without engine-specific rendering features, then your scripts *should* execute just fine with any of the three runners.
112
+
***Direct JavaScript Coding:** If you are simply writing Bitbybit.dev logic directly in JavaScript (not exporting from visual editors), then any of these runners (BabylonJS, ThreeJS, or PlayCanvas, full or Lite) will work well for you for the core CAD functionalities.
113
+
***Bundle Size & Performance:**
114
+
* The BabylonJS runner is generally the largest due to its comprehensive feature set.
115
+
* The ThreeJS runner offers a good balance of features and size.
116
+
* The PlayCanvas runner is optimized for performance and smaller bundle sizes, making it ideal for mobile-first applications.
117
+
* The Lite versions are much smaller for all three engines.
118
+
***Engine-Specific Strengths:**
119
+
***BabylonJS:** Best for projects requiring physics (Havok), GUI elements, and maximum compatibility with visual scripts.
120
+
***ThreeJS:** Excellent for projects already using ThreeJS or needing its vast ecosystem.
121
+
***PlayCanvas:** Perfect for high-performance applications, mobile optimization, and game development.
122
+
123
+
No matter your preference, we love all three of these incredible game engines, and we are excited to see what you will create with them using Bitbybit.dev!
102
124
103
125
### Where to Find the Runners
104
126
105
127
We are serving the Bitbybit Runners from the **JSDelivr CDN**. You can include them in your website with the following script tags. Remember to replace `<version-number-of-bitbybit>` with the actual version you intend to use.
106
128
129
+
:::tip Self-Hosting for Production
130
+
For production applications requiring maximum reliability and control, consider [**self-hosting the runners and assets**](/learn/hosting-and-cdn) on your own infrastructure.
**Note:** You should replace `<version-number-of-bitbybit>` with an actual version number (e.g., `0.21.0`). You can find all the official versions of Bitbybit.dev here:
@@ -128,9 +162,9 @@ We are serving the Bitbybit Runners from the **JSDelivr CDN**. You can include t
128
162
129
163
It can be hard to guess how runners can be used in practice, which is why we provide you with actual, working examples. We create projects that fit within a single `index.html` file, which you can simply open in your browser directly from your file system. This approach doesn't even require you to run a local server on your computer. That’s the true power of the web!
130
164
131
-
➡️ **[Explore Example Use Cases of BabylonJS & ThreeJS Runners on GitHub](https://github.com/bitbybit-dev/app-examples/tree/main/runner)**
165
+
➡️ **[Explore Example Use Cases of BabylonJS, ThreeJS & PlayCanvas Runners on GitHub](https://github.com/bitbybit-dev/bitbybit/tree/master/examples/runner)**
132
166
133
-
This GitHub repository contains examples that use both the full and Lite runners. We also provide examples on how to initialize BabylonJSor ThreeJS scene objects *outside* the context of the runner. This approach allows Bitbybit Runners to work more harmoniously with third-party tools or existing projects that already manage their own game engine instances (e.g., integrating with A-Frame or a custom ThreeJS setup).
167
+
This GitHub repository contains examples that use both the full and Lite runners for all three game engines. We also provide examples on how to initialize BabylonJS, ThreeJS, or PlayCanvas scene objects *outside* the context of the runner. This approach allows Bitbybit Runners to work more harmoniously with third-party tools or existing projects that already manage their own game engine instances (e.g., integrating with A-Frame, custom ThreeJS setups, or PlayCanvas Editor projects).
134
168
135
169
Initiating scene objects *inside* the runner (letting the runner create the default scene) is also possible and is often simpler, though it offers less fine-grained control if you have a complex existing setup.
0 commit comments