Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Javascript module plans #132

Closed
4 of 31 tasks
Geequlim opened this issue Aug 8, 2022 · 10 comments
Closed
4 of 31 tasks

Javascript module plans #132

Geequlim opened this issue Aug 8, 2022 · 10 comments
Assignees
Labels
enhancement New feature or request

Comments

@Geequlim
Copy link
Collaborator

Geequlim commented Aug 8, 2022

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. #212

    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
  • Improved debugger for QuickJS

  • Standard ESModule/CommonJS implementation

    • Rename jsx to mjs 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
  • 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
@Geequlim Geequlim self-assigned this Aug 8, 2022
@Geequlim Geequlim changed the title Flags Plans Aug 10, 2022
@Geequlim Geequlim assigned Geequlim and unassigned Geequlim Aug 10, 2022
@mageowl
Copy link

mageowl commented Aug 10, 2022

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.

@poohcom1
Copy link
Contributor

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?

@fire
Copy link
Collaborator

fire commented Aug 24, 2022

Can you estimate the effort to add wasm support? Or describe how you would do it?

@Geequlim
Copy link
Collaborator Author

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

@Geequlim
Copy link
Collaborator Author

Geequlim commented Sep 24, 2022

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

@fire
Copy link
Collaborator

fire commented Sep 24, 2022

Do you prefer v8 or quickjs + wasm3?

@Geequlim
Copy link
Collaborator Author

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:

  1. V8 is not supported on Web and quickjs is better for better load time.
  2. On iOS jit is not allowed so performance of V8 is not that obviously so maybe QuickJS is better choice.
  3. For editor and developers tools we'd better choose nodejs so we can benefit from the npm ecosystem to make life easier.

@fire fire changed the title Plans Javascript module plans Jun 17, 2023
@sr229
Copy link

sr229 commented Oct 8, 2023

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?

@fire
Copy link
Collaborator

fire commented Oct 8, 2023

The master branch has had active work by @nmerget

@nmerget
Copy link
Collaborator

nmerget commented Sep 27, 2024

I created a roadmap to track progress

@nmerget nmerget closed this as completed Sep 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

6 participants