Optimize adjacent static parts+fields
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 35/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- babel, javascript
調査の方向性
リンクされている Tagged Templates gist と babel-plugin-transform-jsx-to-htm のエントリーポイントから始めます。リテラルフィールドとネストされた配列について示されている現在の出力と最適化後の出力を比較します。両方の例でプラグインが要求された最適化後の出力を生成すれば完了です。
索引モデルが issue の本文から書いたものです。
説明
I've been toying around with optimizing Tagged Templates by merging literal field values (strings, numbers and booleans) into their adjacent static part and collapsing the adjacent static parts into a single part:
// input:
<div class={"foo"}>hello</div>
<button id={1} />
// current output:
html`<div class=${"foo"}>hello</div>`
html `<button id=${1} />`
// optimized output:
html`<div class="foo">`
html`<button id=1 />`
It'd be really neat to get this behavior into babel-plugin-transform-jsx-to-htm, since additional assumptions could be made about nested Arrays:
const color = 'red';
// input:
<style jsx>{`
.foo { color: ${color}; }
`}</style>
// current output:
html`
<style jsx>${`
.foo { color: ${color}; }
`}</style>
`
// optimized output:
html`
<style jsx>
.foo { color: ${color}; }
</style>
`
Thoughts?
- 主要言語
- JavaScript
- スター
- 9k
- フォーク
- 181
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
developit/htm のほかの issue
-
Sarthak オープン
難易度 5/5 1週間以上 初心者へのやさしさ 1/100
-
Tugas オープン
難易度 5/5 1週間以上 初心者へのやさしさ 10/100
-
Tugas オープン
難易度 5/5 1週間以上 初心者へのやさしさ 1/100
-
難易度 5/5 1週間以上 初心者へのやさしさ 20/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 35/100
似ている issue
-
awaiting triage bug Causes friction Hop Gui P1 P2 Transforms
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
georgestephanis/p2026#40 ·
-
Enatega Customer and Rider app: Add-ons price is not visible to customer after order is placed. オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
Margaret-Petersen/food-delivery-app-clone-react-native#1981 ·