Plugins: single file plugin format (like JSX but for plugins)
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 25/100
- issue の種類
- 機能追加
- 明瞭さ
- 説明が足りない
- 活発さ
- 停滞
- 技術スタック
- javascript
- 領域
- compilers
調査の方向性
特定のファイルやテストは指定されていません。まず parser、generator、types plugin の API と、参照されている private-fields PR を確認し、単一ファイルの plugin 形式が実現可能かどうかを判断してください。完了とするには、合意された設計と実装範囲が必要ですが、この issue ではそれらが定義されていません。
索引モデルが issue の本文から書いたものです。
説明
Just another idea I had for making it easier to create new syntax (not necessarily for production or standardization but to test out ideas).
Currently, the only thing you can do now in transform plugin itself is modify existing AST/syntax.
export function customPlugin() {
return {
visitor: {
OptionalChaining() {}
}
}
In order to add new syntax, you need to modify the parser (we don't allow plugins on purpose but I kinda want to re-think that but in a way that doesn't ruin the ecosystem, which is I suppose why the parser is "bundled" now).
Currently you can pass overrides for the parser/generator if you want fork the parser or use recast/prettier to do codemods.
return {
parserOverride: parse,
generatorOverride(ast, options) {
return {
code: prettier.format(
generate(ast).code,
config
),
}
},
}
Even in a PR to babel (ex: tc39/proposal-private-fields-in-in
, https://github.com/babel/babel/pull/11372) you have to change a lot of different files (a good thing as it's independent), but maybe it's possible to keep it in one place? I know this wouldn't work if you are modifying different nodes, but just thinking out loud here.
So it would be interesting if we supported adding your own "types", "printer nodes" in the plugin itself?
export function customPlugin() {
return {
parser: { // @babel/parser
parserOverrideFunction() { // parse a?.b }
},
visitor, // same as usual
generator: { // @babel/generator
OptionalChaining() { // print a?.b }
},
types: { // for @babel/types
OptionalChaining: {
builder: ["operator", "left", "right"],
visitor: ["left", "right"],
aliases: ["Binary", "Expression"]
}
}
};
}
- 主要言語
- 言語のデータがありません
- スター
- 123
- フォーク
- 16
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
babel/notes のほかの issue
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
-
June 10th - Meetingオープンmeeting
難易度 5/5 1週間以上 初心者へのやさしさ 15/100
-
難易度 5/5 1週間以上 初心者へのやさしさ 20/100
-
🧠 Ideas/Issues dumpオープン
難易度 5/5 1週間以上 初心者へのやさしさ 15/100
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
似ている issue
-
backend:DirectX
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
llvm/llvm-project#227530 ·
メンテナーはふだん 1 日以内に返信
-
`enzymexla.linalg.lu` lowering fails for a tall matrix: the permutation is built with the pivot typeオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
EnzymeAD/Enzyme-JAX#3286 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
objectionary/phino#1600 ·
メンテナーはふだん 1 日以内に返信
-
compiler enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
tenstorrent/tt-lang#1141 ·
メンテナーはふだん 5 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信