Skip to content

docs: More correct error signalling on the examples page - #3297

Open
iwoplaza wants to merge 1 commit into
releasefrom
fix/more-correct-error-signaling
Open

iwoplaza wants to merge 1 commit into
releasefrom
fix/more-correct-error-signaling

Conversation

@iwoplaza

@iwoplaza iwoplaza commented Oct 30, 2026 •

Copy link
Copy Markdown
Collaborator

This lets the browser handle the error as if it was unhandled, yet we can still keep our code running.

@github-actions

Copy link
Copy Markdown

pkg.pr.new

No packages changed since release

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

  • Example error reporting — in apps/typegpu-docs/src/utils/examples/currentSnackbarAtom.ts, runWithCatchAtom now calls window.reportError(err) instead of console.log(err), so the browser treats the caught error as unhandled while the example keeps running.

This is a correct use of reportError: it is typed via WindowOrWorkerGlobalScope in the DOM lib (the docs tsconfig already includes DOM), it is invoked only from browser event handlers, and its Baseline-2023 support (Chrome 95+, Firefox 100+, Safari 16.4+) is fine for a WebGPU docs site. No blocking concerns.

ℹ️ Same pattern still uses console.error in ExampleView

apps/typegpu-docs/src/components/ExampleView.tsx:75,78 catch example-load failures and call console.error directly. If the intent is consistent "unhandled" error signalling across the examples page, those two sites are candidates for the same treatment. Non-blocking and outside this diff.

Pullfrog  | View workflow run | Using deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

@github-actions

Copy link
Copy Markdown

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.97, 1.92, 4.25, 6.44, 7.42, 12.64, 22.58, 23.49]
  line [1.01, 1.95, 4.29, 5.86, 7.98, 12.66, 25.21, 26.78]
  line [0.96, 2.02, 4.03, 6.18, 7.84, 11.12, 23.92, 25.59]
Loading
---
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.28, 0.57, 0.69, 0.80, 1.12, 1.21, 1.41, 1.59]
  line [0.29, 0.48, 0.67, 0.90, 1.17, 1.23, 1.43, 1.60]
  line [0.29, 0.52, 0.76, 0.85, 1.20, 1.19, 1.45, 1.57]
Loading
---
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.97, 2.13, 4.17, 7.71, 12.37, 25.59, 55.83, 111.64]
  line [0.91, 2.15, 3.91, 6.97, 11.82, 25.87, 57.11, 112.23]
  line [0.85, 2.13, 3.79, 6.93, 12.43, 25.35, 57.78, 109.58]
Loading

@github-actions

Copy link
Copy Markdown

Bundle size comparison (import * as ... in PR vs import * as ... in target):

🟢 Decreased ➖ Unchanged 🔴 Increased ❔ Unknown
0 355 0 0

No notable changes.

If you wish to run a comparison for other, slower bundlers, run the 'Tree-shake test' from the GitHub Actions menu.

@aleksanderkatan

Copy link
Copy Markdown
Member

Why do we want to treat the error like it was unhandled? I think it was handled pretty well: we caught it, logged it and displayed it in the snackbar.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants