ECMAScript icon indicating copy to clipboard operation
ECMAScript copied to clipboard

Godot 4 Tracker

Open fire opened this issue 3 years ago • 22 comments

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

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

I got stuck. Need some help.

fire avatar Aug 08 '22 10:08 fire

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 avatar Aug 08 '22 12:08 Geequlim

I got stuck. Need some help.

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

Geequlim avatar Aug 08 '22 13:08 Geequlim

@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.

fire avatar Aug 13 '22 20:08 fire

@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.

Geequlim avatar Aug 14 '22 05:08 Geequlim

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

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

fire avatar Aug 20 '22 14:08 fire

@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.

Geequlim avatar Aug 21 '22 06:08 Geequlim

Let me know if you have godot 4 questions.

fire avatar Aug 21 '22 18:08 fire

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.

Geequlim avatar Aug 22 '22 09:08 Geequlim

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

fire avatar Aug 22 '22 09:08 fire

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

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

Geequlim avatar Aug 22 '22 15:08 Geequlim

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

fire avatar Sep 01 '22 01:09 fire

@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

Geequlim avatar Sep 01 '22 05:09 Geequlim

Can you repeat the tasks that are open for g4?

fire avatar Sep 01 '22 22:09 fire

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

Geequlim avatar Sep 02 '22 03:09 Geequlim

The cicd actions is still failing.

fire avatar Sep 06 '22 11:09 fire

CICD scripts is not fixed for godot 4 yet

Geequlim avatar Sep 06 '22 14:09 Geequlim

The javascript rename was merged.

fire avatar Sep 08 '22 05:09 fire

There are things left to do for porting to godot 4.0

  • [x] Call godot api from Javascript
    • [x] Bind Object types
      • [x] Signal and slots support
    • [x] Bind buitin types with codegen tools
    • [ ] Mannually methods binding of buitin types which are ignored by codegen tools
    • [ ] Implements @GlobalScope functions
  • [x] Call javascript from godot
    • [x] Implements JavaScript and JavaScriptInstance for godot
    • [ ] Implements importer for TypeScript

Geequlim avatar Sep 09 '22 06:09 Geequlim

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

fire avatar Sep 09 '22 17:09 fire

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

Geequlim avatar Sep 11 '22 04:09 Geequlim

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

fire avatar Sep 11 '22 15:09 fire

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

https://github.com/Geequlim/ECMAScriptDemos

Geequlim avatar Sep 11 '22 18:09 Geequlim

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

Geequlim avatar Sep 23 '22 15:09 Geequlim

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

fire avatar Sep 23 '22 18:09 fire

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

fire avatar Sep 24 '22 04:09 fire

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

Geequlim avatar Sep 24 '22 04:09 Geequlim

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

Geequlim avatar Sep 24 '22 04:09 Geequlim

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.

Mantissa-23 avatar Jan 08 '23 03:01 Mantissa-23

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

CristianPi avatar Jan 13 '23 00:01 CristianPi

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

fire avatar Apr 23 '23 15:04 fire