Infrastructure
This project adds TypeScript/JavaScript Support for Godot 4.x by leveraging the high-performance capabilities of V8 to bring the delightful development experience of TypeScript into Godot.
[!NOTE] The core functionality is implemented and essentially usable but still under testing.
import
function)STEP 1: Download or clone the repo into the modules
directory of your Godot engine source:
cd YourGodotEngineSource/modules
git clone https://github.com/ialex32x/GodotJS.git
STEP 2: Put v8
headers and libraries into GodotJS
, or directly download the prebuilt v8
from GodotJS-Dependencies:
# download the archive of prebuilt v8
curl https://github.com/ialex32x/GodotJS-Dependencies/releases/download/v8_r11/v8_r11.zip --output your/download/path/v8.zip
# extract the zip file into your `GodotJS` directory,
# NOTE: no white space after the switch `-o`
7z x -o"YourGodotEngineSource/modules/GodotJS" your/download/path/v8.zip
[!NOTE] Don't forget to put the headers/libraries of
v8
into the same directory structure used in prebuiltv8
if you decide to compile it by yourself.
The module directroy structure looks like this:
┗━ godot
┗━ modules
┣━ ...
┣━ gltf
┣━ GodotJS
┃ ┣━ bridge-quickjs
┃ ┣━ bridge-v8
┃ ┣━ ...
┃ ┣━ lws
┃ ┗━ v8
┃ ┣━ include
┃ ┣━ linux.x86_64.release
┃ ┣━ macos.arm64.release
┃ ┣━ windows_x86_64_release
┃ ┗━ ...
┣━ gridmap
┣━ ...
The currently used version of v8
is 12.4.254.20
.
STEP 3: Compile and launch Godot Editor
. Then, install TypeScript/JavaScript presets into a Godot project.
[!NOTE] Since the prebuilt
v8
library is built with thewindows-latest
github runner which uses VS2022, encounteringUnresolved external symbol
errors during linkage withv8_monolith.lib
orlibucrt.lib
may be addressed by updating to the latest version of theMSVC v143
toolchain,Windows Universal CRT SDK
andVisual Studio 2022
itself. See GodotJS-Dependencies README for the version of MSVC C++ Compiler used in different prebuilt library packages.
A prebuilt version of Godot Editor
can be downloaded from GodotJS-Build.
Because the GodotJS-Build workflow is currently run manually, it may not be built from the latest commit of GodotJS
.
For more information on how to use GodotJS
in a project, check out GodotJSExample for examples written in typescript.
And, don't forget to run npm install
and npx tsc
before opening the example project.
ndk_platform=android-24
)