Opt-out for the module-load eval probe (strict CSP reports a violation on import)
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 70/100
- issue の種類
- 機能追加
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- javascript, typescript
調査の方向性
packages/typegpu/src/data/compiledIO.ts から始めてください。モジュール読み込み時の EVAL_ALLOWED_IN_ENV プローブはここにあります。issue に示された 3 つの opt-out 設計を読み、typegpu が root/init オプションをすでにどう扱っているかを確認して、合うものを選びます。完了の条件は: script-src 'self' の下で typegpu を import しても securitypolicyviolation の報告が発生せず、eval が利用できない場合は既存の警告付きで plain writer が引き続き使われることです。
索引モデルが issue の本文から書いたものです。
説明
Problem
packages/typegpu/src/data/compiledIO.ts probes for eval support when the module loads:
export const EVAL_ALLOWED_IN_ENV: boolean = (() => {
try {
new Function('return true');
return true;
} catch {
return false;
}
})();
Under a strict Content Security Policy without 'unsafe-eval', the try/catch keeps this from breaking anything: typegpu falls back to the plain writer, and since #2758/#2771 it warns once. But the browser still files a securitypolicyviolation (script-src, eval) the moment typegpu is imported, before any buffer is written.
Hosts that embed apps in sandboxed iframes with a strict CSP (MCP Apps / ChatGPT apps, browser extensions, enterprise pages with CSP reporting) treat any such report as a policy failure. An app that never wants compiled writers can't avoid the report today short of patching the package.
Request
An opt-out that skips the probe, so the plain writer is used without ever calling new Function. Any of these would work for us:
- a global flag read before the probe, like zod's
globalThis.__zod_globalConfig = { jitless: true }; - a lazy probe that runs only the first time a compiled writer is actually requested, plus a root or
initoption to disable compiled writers; - a build-time define (
TYPEGPU_NO_EVAL) that tree-shakes the probe.
Repro
- Serve a page with
Content-Security-Policy: script-src 'self'. - Add
document.addEventListener('securitypolicyviolation', e => console.log(e.violatedDirective, e.blockedURI)). - Import
typegpu. Onescript-src/evalviolation is logged at import, with no GPU work done.
Seen on typegpu 0.12.8. We currently carry a patch-package-style patch that hard-codes the plain writer and would drop it as soon as an opt-out exists. Thanks for TypeGPU!
- 主要言語
- TypeScript
- スター
- 3.3k
- フォーク
- 141
- 平均マージ
- 3日 8時間
- マージ済み PR(30日)
- 72
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
software-mansion/TypeGPU のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
software-mansion/TypeGPU#3219 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
texture.write(VideoFrame) uses the padded coded size instead of the visible size対応中かも @RaphaelFakhri が 9 日前に担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
software-mansion/TypeGPU#3213 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
software-mansion/TypeGPU#3008 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
software-mansion/TypeGPU#2948 · コメント 2 件 ·
メンテナーはふだん 2 日以内に返信
-
docs: Fix camera orientation in "Monocular Light Injection" example再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
software-mansion/TypeGPU#2890 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
software-mansion/TypeGPU の issue をすべて見る
似ている issue
-
b:minor bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
software-mansion/argent#1698 ·
メンテナーはふだん 1 日以内に返信
-
e2e-failure ready-to-code
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
redhat-developer/rhdh-plugin-export-overlays#4624 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
better-auth/better-auth#12132 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
automation missing-model model-sync provider:tinfoil
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
anomalyco/models.dev#12053 ·
メンテナーはふだん 1 日以内に返信
-
o8 next debug build aborts on Glass to Dark appearance switch (nil identifier messaged before check)オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
hurttlocker/o8#5112 ·