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

Implement raw javascript language #32

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

gschwind
Copy link
Contributor

Hello,

This patch suite add GodotJavaScript script language. JS scripts work the same as TS scripts and they share the same javascript environment, but they do not need to be compiled using "tsc", i.e. they are loaded in-place as they are.

The code are mostly shared by both ScriptLanguage, created classes are written to override names and file extensions.

Best regards

@gschwind gschwind force-pushed the pr-implement-raw-javascript-language branch from 463fd48 to 6353d7e Compare January 14, 2025 18:39
@ialex32x
Copy link
Collaborator

ialex32x commented Jan 16, 2025

Hi, I’m not sure whether these changes are good for the design goal without side effects.

  • Technically, typescript does not really exist at runtime, everything is javascript. The original implementation can directly load/run javascripts without further changes. The only limitation is you must create the javascript file in the external code editor if it’s a typescript project.
  • It’s strongly not recommended to mix typescript and javascript in a typescript project if a javascript module is used as a script class, it may break the static type checkings. (for ordinary javascript files, they could still be used as libs in a typescript project)
  • Simplicity and flexibility consideration: Introducing multiple ScriptLanguage instances brings additional costs, including the instances themself, separated script lists and corresponding locks.

I prefer to temporarily suspend this PR, and deliberate over it again after GodotJS (the expected features/implementation) is more complete.

@gschwind
Copy link
Contributor Author

gschwind commented Jan 16, 2025

I'm fine with your opinion, I will maintain the patch series because I will use it, and you can merge it in the future if you want. if you have suggestion for improvement or change let me know.

Best regards

@gschwind gschwind force-pushed the pr-implement-raw-javascript-language branch from 6353d7e to e3bd382 Compare January 16, 2025 19:48
@gschwind gschwind force-pushed the pr-implement-raw-javascript-language branch from e3bd382 to cb945fa Compare January 19, 2025 11:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants