Skip to content

web: vendor webmidi locally to fix editor/run page hang (amyboard + tulip web)#1064

Merged
bwhitman merged 2 commits into
mainfrom
claude/angry-cori-a9751c
Jun 30, 2026
Merged

web: vendor webmidi locally to fix editor/run page hang (amyboard + tulip web)#1064
bwhitman merged 2 commits into
mainfrom
claude/angry-cori-a9751c

Conversation

@bwhitman

@bwhitman bwhitman commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

Problem

Both web editors hang on load while their marketing/home pages are fine.

Root cause: each loads webmidi.js as a render-blocking <script src> pointing at cdn.jsdelivr.net/npm/webmidi@latest. When jsdelivr's @latest/ranged version resolution for that package stalls (observed: 8s+ timeouts, 0 bytes, every retry, for both @latest and @3 — while bootstrap@5.1.3 from the same CDN loads in ~0.4s), the synchronous script blocks the browser from rendering the rest of the page, so it appears to hang.

Affected:

  • AMYboard Web /editor/ (tulip/amyboardweb/static/editor/index.html)
  • Tulip Web /run/ (tulip/web/static/index.html)

Fix

Self-host webmidi v3.1.16 (the version @latest currently resolves to) and reference the local same-origin copy:

  • amyboardweb → static/vendor/webmidi.iife.js, matching the existing vendor/qwerty-hancock.min.js pattern (<base href="/">).
  • tulip/web → static/webmidi.iife.js, flat alongside tree.js/spss.js/mini-coi.js because build.sh's cp static/* is non-recursive (<base href="/run/">).
- <script src="https://cdn.jsdelivr.net/npm/webmidi@latest/dist/iife/webmidi.iife.js"></script>
+ <script src="vendor/webmidi.iife.js"></script>   # amyboardweb
+ <script src="webmidi.iife.js"></script>          # tulip/web

This removes the third-party render-blocking dependency and pins the version so a future @latest change can't stall or break either editor. The WebMidi global is consumed by spss.js exactly as before.

🤖 Generated with Claude Code

bwhitman and others added 2 commits June 30, 2026 06:02
The editor loaded webmidi.js as a render-blocking <script src> pointing at
cdn.jsdelivr.net/npm/webmidi@latest. When jsdelivr's @latest/ranged version
resolution for that package stalls, the synchronous script blocks the browser
from rendering the rest of /editor/, so the page hangs (the marketing site is
unaffected because it doesn't load webmidi).

Self-host webmidi v3.1.16 (the version @latest currently resolves to) under
static/vendor/, matching the existing vendor/qwerty-hancock.min.js pattern, and
reference the local copy. This removes the third-party render-blocking
dependency and pins the version so a future @latest change can't stall or break
the editor.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Tulip Web's /run/ page had the same render-blocking
cdn.jsdelivr.net/npm/webmidi@latest <script> that hangs the page when
jsdelivr's @latest resolution stalls. Self-host webmidi v3.1.16 alongside the
other flat static JS (tree.js, spss.js, mini-coi.js) — build.sh's `cp static/*`
is non-recursive, so it goes in static/ root rather than a vendor/ subdir — and
reference it via the same-origin <base href="/run/">.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@bwhitman bwhitman changed the title amyboardweb: vendor webmidi locally to fix editor page hang web: vendor webmidi locally to fix editor/run page hang (amyboard + tulip web) Jun 30, 2026
@bwhitman bwhitman merged commit ad8ad2d into main Jun 30, 2026
3 checks passed
@github-actions

Copy link
Copy Markdown

🔌 AMYboard PR preview

Editor + flasher: https://amyboard-pr-1064.vercel.app/editor/

This preview bundles this PR's firmware — its flasher only flashes this build (not the release). Rebuilt on every push; removed when the PR closes.

The hardware CI has been kicked off and should return within a few minutes, stand by!

@github-actions

Copy link
Copy Markdown

🌷 Tulip Web PR preview

Tulip Web: https://tulip-pr-1064.vercel.app/run/

Flash a Tulip to this build: on-device run tulip.upgrade(pr=1064).

Rebuilt on every push; removed when the PR closes.

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.

1 participant