godotjs / javascript

Javascript binding for godotengine
https://godotjs.github.io/
MIT License
963 stars 84 forks source link

Godot 4 Tracker #131

Closed fire closed 1 year ago

fire commented 2 years ago

Here's my current work on porting to godot 4.

https://github.com/fire/ECMAScript/tree/next

I got stuck. Need some help.

Geequlim commented 2 years ago

I have more plans for this project including embedding V8 backend, using NodeJS in the editor, etc. Sadly I haven't been able to find enough time yet to implement them.

I'd like to see how much real world godot users are accepting of JavaScript.

Geequlim commented 2 years ago

I got stuck. Need some help.

You can tell me the problem you're having and I'll be happy to help.

fire commented 2 years ago

@Geequlim Can I call you on discord? Want to see if I can send you the code and a description of the current issues so you can assist.

Geequlim commented 2 years ago

@fire I don't using dicord that much. And I don't have the confidence to understand or express myself correctly with English.

Can you describe your problem here? There is a big time difference between us and I will try to help you as much as possible when I am avaliable.

fire commented 2 years ago

https://github.com/fire/ECMAScript/tree/next doesn't compile.

Don't know how to reduce the complexity so I can finish porting it.

Geequlim commented 2 years ago

@fire I have pulled your code down and made some changes. Since I haven't modified the godot source code for too long, the main problem at the moment is that all of my IDEs are broken.

fire commented 2 years ago

Let me know if you have godot 4 questions.

Geequlim commented 2 years ago

Downgraded QtCreator to 4.x and it finally worked. @fire Did you build the code on the Windows platform? QuickJS doesn't support MSVC yet, so it is recommended that you try to build with mingw.

We create binding code for built-in types through xml documents. I noticed the errors from generated code is caused as the argument is changed to param in 4.0, so change it to param should fix that. https://github.com/fire/ECMAScript/blob/next/generate_builtin_api.py#L382

For PackedByteArray we'd better ignore all the methods make errors for now.

fire commented 2 years ago

I uses mingw llvm. Did you post your changes anywhere?

Geequlim commented 2 years ago

I uses mingw llvm. Did you post your changes anywhere?

@fire https://github.com/Geequlim/ECMAScript/tree/gd4

fire commented 2 years ago

What does FileNotFoundError: [Errno 2] No such file or directory: '/home/runner/work/ECMAScript/ECMAScript/doc/classes/Quaternion.xml': mean?

Geequlim commented 2 years ago

@fire The buitin math type binding code is generated from xml doc files in build script. I think I have fixed these compile errors in branch gd4

fire commented 2 years ago

Can you repeat the tasks that are open for g4?

Geequlim commented 2 years ago

The gd4 branch is for godot 4 I have fixed the compile errors.

fire commented 2 years ago

The cicd actions is still failing.

Geequlim commented 2 years ago

CICD scripts is not fixed for godot 4 yet

fire commented 2 years ago

The javascript rename was merged.

Geequlim commented 2 years ago

There are things left to do for porting to godot 4.0

fire commented 2 years ago

Can you describe how to do this? Implements JavaScript and JavaScriptInstance for godot

Geequlim commented 2 years ago

That should be same with 3.x. We need to fix the code to fit the 4.0 workflow

fire commented 2 years ago

Do you have a test project so I can check what works and doesn't work?

Geequlim commented 2 years ago

Here are demos for godot 3.x you can reference.

https://github.com/Geequlim/ECMAScriptDemos

Geequlim commented 1 year ago

The script workflow for godot 4.0 is implemented in gd4 branch now. We can play javascript in godot editor now.

fire commented 1 year ago

Would you be interested if I fixed the cicd? Is there anything I should know?

fire commented 1 year ago

I was able to get javascript to build, what's a hello world script?

https://github.com/V-Sekai/javascript

Changes:

  1. restore custom_modules=custom_modules by hacking the path. Please restore.
  2. might have msvc support
Geequlim commented 1 year ago

You can create a script for a node in the editor as same as GDScript with script create dialog

Geequlim commented 1 year ago

Would you be interested if I fixed the cicd? Is there anything I should know?

Still not found enough time to finish port all the things. These are something missing for the binding side thought. Contributions welcomed

Mantissa-23 commented 1 year ago

Is there anything I can do to help out here? Not 100% clear on what the state of things are after reading through the thread.

CristianPi commented 1 year ago

@Geequlim i have errors in the build, probably because of the refactor on the GDScript side (fresh from godot github)

fire commented 1 year ago

https://github.com/Geequlim/ECMAScript/tree/gd4 has a recent merge for Godot Engine 4.0 support.

I am going to close this in favour of new bug reports!

Thanks

Geequlim commented 1 year ago

Built-in methods which need bind manually in @GlobScope and GDScript is not fully checked yet.