Warn once when compiled writer falls back under CSP / no-eval - #2771
Warn once when compiled writer falls back under CSP / no-eval#2771pullfrog[bot] wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot could not run the full agentic suite for this review because it was automatically requested on a bot-authored pull request. Request a review from Copilot under Reviewers to retry with the full agentic suite. Improved support for bot-authored pull requests is coming soon.
Reduces repetitive log output when eval is disallowed by warning only once before falling back to the default writer path.
Changes:
- Added a module-level guard (
didWarnAboutEvalFallback) to ensure the fallback warning is emitted once. - Wrapped the existing
logger.warncall in a one-time check withingetCompiledWriter.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
pkg.pr.new packages benchmark commit |
Bundle size comparison (
|
| 🟢 Decreased | ➖ Unchanged | 🔴 Increased (max 0.01%) | ❔ Unknown |
|---|---|---|---|
| 0 | 301 | 21 | 0 |
import { ... } in PR vs import * as ... in PR (is the library tree-Shakeable?):
| Test | tsdown |
|---|---|
| tgpu_init.ts | 259.55 kB ( |
| tgpu_initFromDevice.ts | 259.02 kB ( |
| tgpu_resolve.ts | 164.93 kB ( |
| tgpu_resolveWithContext.ts | 164.87 kB ( |
| tgpu_bindGroupLayout.ts | 69.27 kB ( |
| tgpu_mutableAccessor.ts | 66.27 kB ( |
| tgpu_accessor.ts | 66.26 kB ( |
| tgpu_privateVar.ts | 65.61 kB ( |
| tgpu_workgroupVar.ts | 65.60 kB ( |
| tgpu_const.ts | 64.85 kB ( |
| tgpu_fn.ts | 38.45 kB ( |
| tgpu_fragmentFn.ts | 38.45 kB ( |
| tgpu_vertexFn.ts | 38.27 kB ( |
| tgpu_computeFn.ts | 37.97 kB ( |
| tgpu_vertexLayout.ts | 27.08 kB ( |
| tgpu_comptime.ts | 14.77 kB ( |
| tgpu_unroll.ts | 1.66 kB ( |
| tgpu_slot.ts | 1.54 kB ( |
| tgpu_lazy.ts | 1.19 kB ( |
If you wish to run a comparison for other, slower bundlers, run the 'Tree-shake test' from the GitHub Actions menu.
Resolution Time Benchmark---
config:
themeVariables:
xyChart:
plotColorPalette: "#E63946, #3B82F6, #059669"
---
xychart
title "Random Branching (🔴 PR | 🔵 main | 🟢 release)"
x-axis "max depth" [1, 2, 3, 4, 5, 6, 7, 8]
y-axis "time (ms)"
line [0.94, 1.95, 3.96, 6.34, 7.01, 13.24, 21.07, 24.84]
line [0.94, 1.85, 4.12, 6.58, 7.42, 12.39, 21.66, 25.26]
line [0.98, 1.97, 4.23, 6.68, 8.13, 11.52, 21.01, 25.30]
---
config:
themeVariables:
xyChart:
plotColorPalette: "#E63946, #3B82F6, #059669"
---
xychart
title "Linear Recursion (🔴 PR | 🔵 main | 🟢 release)"
x-axis "max depth" [1, 2, 3, 4, 5, 6, 7, 8]
y-axis "time (ms)"
line [0.30, 0.52, 0.71, 0.79, 1.08, 1.13, 1.40, 1.50]
line [0.29, 0.49, 0.66, 0.78, 1.06, 1.13, 1.37, 1.51]
line [0.31, 0.51, 0.70, 0.86, 1.13, 1.23, 1.48, 1.59]
---
config:
themeVariables:
xyChart:
plotColorPalette: "#E63946, #3B82F6, #059669"
---
xychart
title "Full Tree (🔴 PR | 🔵 main | 🟢 release)"
x-axis "max depth" [1, 2, 3, 4, 5, 6, 7, 8]
y-axis "time (ms)"
line [0.88, 2.18, 4.46, 6.81, 12.45, 26.37, 53.13, 109.35]
line [0.73, 2.09, 3.95, 6.53, 12.05, 26.69, 52.86, 109.39]
line [0.96, 2.04, 4.18, 6.78, 13.13, 26.69, 55.67, 114.32]
|
Closes #2758.
The
getCompiledWriterfunction inpackages/typegpu/src/data/compiledIO.tswarns on every call whenEVAL_ALLOWED_IN_ENVisfalse(CSP/no-eval environments). For apps that hit this path repeatedly, this floods the console.Add a module-level
didWarnAboutEvalFallbackflag so the warning is emitted only once per page/process. The fallback behavior itself is unchanged.DeepSeek Pro(free via Pullfrog for OSS) (Kimi K2not used — the program covers this model; add its provider key to run your pick) | 𝕏