Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

[RFC] Option-driven tree-shaking toggles

オープン
#74 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
25/100
issue の種類
機能追加
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
typescript, vite
領域
build-system

調査の方向性

まず、既存のSaus plugin integration、toggle handling、Vite build pathを確認します。issueではファイルやテストが指定されていないため、最初にbuild-time togglesがどこで登録・処理されるかを特定します。完了時には、plugin optionで、対応するtoggle-marked codeの削除を制御できるようにします。namespaced toggle IDsも対象に含めます。

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

説明

proposal roadmap

The Problem

There's no simple way to include code in client/server bundle only when a specific plugin/framework option has a specific value at build time.

Example

In any Vite-compiled module:

// @toggle foo
callSomeFunction(...args)

The foo toggle should be registered with Saus at build time:

export function MySausPlugin(options) {
  return {
    name: 'my-saus-plugin',
    saus({ toggles }) {
      // The `foo` option of my plugin decides if "foo" toggle is removed.
      if (options.foo) {
        toggles.use("foo")
      }
    }
  }
}

In the above example, if the foo option of MySausPlugin is falsy, the callSomeFunction line is removed at build time.

Ideally, plugins would use namespaces in their toggle IDs:

// @toggle my-saus-plugin.foo
callSomeFunction(...args)
主要言語
TypeScript
スター
38
フォーク
1
PR マージ指標
30日以内にマージされた PR はありません

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

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

alloc/saus のほかの issue

alloc/saus の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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