Get rid of externs requirement for pure CLJS builds
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 42/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- clojure, javascript
- 領域
- build-system, database
調査の方向性
datascript.query の getter-fn から始め、プロパティ名の不整合がないか aget の使用箇所を調べてください。次に、JS の build 関連コードと externs についての README.md のガイダンスを確認してください。純粋な CLJS の build と JavaScript を対象とする build を比較します。純粋な CLJS の build で externs が不要になり、既存の JS の build が引き続き機能すれば完了です。
索引モデルが issue の本文から書いたものです。
説明
There is a very long open issue that datascript requires externs even for pure CLJS compilation. This should never be neccessary for builds where all code is part of the build. Given that shadow-cljs doesn't add externs by default this creates problems. It even has become part of the entry README.md since I assume this is a common issue.
I had a suspicion what the problem is and used AI to confirm. It did, but I do not know enough about this codebase to know if its suggested fixes would actually work. So, here goes the problem.
The code is running into the Inconsistent Property Names problem. Meaning that some places use foo.e and other use foo["e"]. Or more likely the CLJS variants of (.-e foo) and (aget e "foo") (or unchecked-get or any other string based property access). I can see several uses of aget in the codebase, most notably the getter-fn in datascript.query. Given that the set of property names is known it can just use direct getters and not mix in string lookups.
There is also another situation where code contains forced goog/exportSymbol code that is also never necessary for pure CLJS builds and should only be present for the JS targetted builds, not part of the raw sources the CLJS builds will use. But that is a different unrelated issue. Just leads to a lingering datascript global that is also causing problems in ESM builds.
I'd advise moving all the JS build related bits into their own files and doing that build with externs. That would leave the JS build functioning as is, while likely fixing all the CLJS related build issues.
I have no interest in pursuing this myself any further, but given that AI can most definitely fix this, I thought I would bring it up just in case there is any interest in "fixing" the current situation.
- 主要言語
- Clojure
- スター
- 5.8k
- フォーク
- 318
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
tonsky/datascript のほかの issue
-
難易度 5/5 1週間以上 初心者へのやさしさ 10/100
tonsky/datascript#489 ·
-
Stack overflow when transacting :db.type/tupleAttrs with a :db.type/ref attr through :db.fn/callオープン
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
tonsky/datascript#483 · コメント 2 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
tonsky/datascript#470 · コメント 1 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
tonsky/datascript#441 · コメント 1 件 · リアクション 3 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
tonsky/datascript#434 · コメント 2 件 ·
tonsky/datascript の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
clojure-emacs/cider-nrepl#1053 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
bhauman/clojure-mcp-light#34 ·
-
Podman documentation is out of date対応中かも @troyvit が 5 日前に担当しました。 オープン.Needs Triage Priority:P3 Type:New Feature
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
metabase/metabase#83625 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bug: MCP server rejects request bodies over 100kb (express.json default) with PayloadTooLargeErrorオープンIOP MCP needs triage
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信