ECMAScript
ECMAScript copied to clipboard
Javascript module plans
Note These are plans about this project todo but not found enough time to make it happen yet.
-
[ ] Remove
godot
form global scope, make it as an esmodule.import { Vector2, Node, clamp } from 'godot';
-
[ ] Improved TypeScript support
- [ ] Better signal/slot support
- [ ] Remove extral signal value bindings, implements in TS declerations
- [ ] Type checking and code completion for signals, callbacks and paramters
- [ ] Add godot importer to compile TypeScript files with tsc/esbuild
- [ ] We want writing TypeScript files and attach them to nodes in editor
- [ ] Better signal/slot support
-
[ ] Improved debugger for QuickJS
-
[ ] Standard ESModule/CommonJS implementation
- [x] Rename
jsx
tomjs
for esmodule - [ ] Add interface to native API for module code loading so that would be possible to
- Load script from remote like deno
- Load TypeScript and run it (after custom compile process)
- Script content encryption
- [x] Rename
-
[ ] Add operators as methods like
op_add
op_divide
to builtin math types for compatibility with more backends -
[ ] Samples for complicated projects
- [ ] Out of box configuration of webpack/esbuild etc
- [ ] Out of box remote debugger/profiler configurations for VSCode to make it easier for mobile game development
- [ ] Hot reload implementation for faster development
- [ ] Remote update version ~~without ship new version on App Store/Google Play/Steam~~
-
[ ] Port to godot 4.x
- [ ] Port QuickJS binding to godot 4.0
- [ ] Add GDExtension support to make everyone can just download and using it
-
[ ] Some demo projects
- [ ] For performance tests
- [ ] For best practics
- [ ] For make good use of TypeScript/JavaScript/NPM
-
Documentations
- [ ] I can writing documentations in Chinese
- [ ] It world be great if anyone can help translate them
About backends and improvements to current workflow
- [ ] Add V8 backend
- [ ] Professional debugger/inspector/profiler/memory tools support
- [ ] Enable JIT as default and using jitless mode on iOS
- [ ] Add NodeJS backend (Editor/PC Only)
- [ ] Using full NodeJS API (and millions of libraries) to extend editor or make games on PC
Also, there are some errors in the godot.d.ts (lines 4686 and 47134, I think), it would be nice to fix them, along with #126.
Also, there are some errors in the godot.d.ts (lines 4686 and 47134, I think), it would be nice to fix them, along with #126.
I've fixed the first issue with #135. @Geequlim could you take a look?
Can you estimate the effort to add wasm support? Or describe how you would do it?
Can you estimate the effort to add wasm support? Or describe how you would do it?
WASM is supported by V8 directly. For QuickJS backen we can using wasm3
For note Latest stable V8 build is ready at https://github.com/Geequlim/v8-builder
Puerts seems integrated nodejs for unity and unreal engine on both desktop and mobile platforms with https://github.com/puerts/backend-nodejs
Do you prefer v8 or quickjs + wasm3?
For different usage choose different backend. QuickJS is smaller so it is suitable for most game projects.
v8 is large but fast with jit and much more stable with better toolchains including debugger/profiler etc.
We'd better develop games with v8 and publish with your choice.
The principle of the backend to choose is based on your project. If performance more important using V8 or if size is more important choose QuickJS.
Note:
- V8 is not supported on Web and quickjs is better for better load time.
- On iOS jit is not allowed so performance of V8 is not that obviously so maybe QuickJS is better choice.
- For editor and developers tools we'd better choose nodejs so we can benefit from the npm ecosystem to make life easier.
Heya, @vignetteapp would love to help you out with the GDExtensions work item and (potentially) the CommonJS/ESM implementation, is there any progress in the 4.1 branch so far?
The master branch has had active work by @nmerget