godotjs / godotjs/javascript

Global pollution

オープン
#187 コメント 3 件 リアクション 7 件 担当者 0 名 GitHub で見る
enhancement
主要言語
C++
スター
1.1k
フォーク
80
PR マージ指標
30日以内にマージされた PR はありません

説明

I personally don't really like global pollution, you could take advantage of the javascript module system to export godot methods, utilities and classes without needing to register the ``godot`` namespace into the global. If you are wondering how this would work, it is quite simple, the first thing needed would be a d.ts documentation file for intellisense to work. And then we can consume the godot api using import syntax:

```js
import { Node2D, print } from "godot";

export class Main extends Node2D {
_ready() {
print("Hi from Javascript Main class");
}
}
```

This is literally the only thing I dislike about this api, the godot api is simply thrown into the global scope.

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

現在のグローバルな godot namespace がどのように公開されているかを確認し、続いて提案されている d.ts ドキュメントファイルと JavaScript モジュールシステムのエントリーポイントを調査してください。Node2D と print の例で意図された import 構文を確認し、Godot API を保持したままグローバル登録を削除することを Definition of Done としてください。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
javascript, typescript
領域
api, developer-experience
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。