Skip to content

fix(playground): remove broken UMD fallback and add favicon#367

Merged
anonvt merged 1 commit into
mainfrom
fix/playground-script-loading
Apr 15, 2026
Merged

fix(playground): remove broken UMD fallback and add favicon#367
anonvt merged 1 commit into
mainfrom
fix/playground-script-loading

Conversation

@anonvt
Copy link
Copy Markdown
Collaborator

@anonvt anonvt commented Apr 15, 2026

Summary

  • Remove the UMD (ts.js) fallback from the playground. The UMD build treats @topsort/sdk as an external dependency — in a browser without a bundler, TopsortClient is undefined and all events are silently dropped after detection. Only the IIFE bundle (which inlines the SDK) can work standalone.
  • Stop deploying ts.js to the playground since it's no longer referenced.
  • Add empty <link rel="icon" href="data:,"> to suppress the favicon 404.

Root cause

When the IIFE failed to load (e.g., from a stale browser cache of a previous 404), the playground fell back to the UMD build. The UMD loaded and ran — DOM observation, event detection, and the "No API token" warning all worked — but every API call failed silently because the SDK wasn't available, making it look like events weren't firing.

Test plan

  • pnpm run lint:ci passes
  • Deploy to GitHub Pages and verify IIFE loads (check devtools Network tab for ts.iife.js 200)
  • Verify favicon 404 is gone
  • Add a product element with a token and confirm impression fires

🤖 Generated with Claude Code

The playground fell back to the UMD build (ts.js) when the IIFE failed
to load. The UMD treats @topsort/sdk as an external dependency, so in a
browser without a bundler, TopsortClient is undefined and all events
are silently dropped after detection.

- Remove UMD fallback since it can never work standalone in a browser
- Stop deploying ts.js to the playground (unused)
- Add empty favicon to suppress 404

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@anonvt anonvt requested a review from a team as a code owner April 15, 2026 21:46
@anonvt anonvt requested a review from borumy-topsort April 15, 2026 21:46
@anonvt anonvt merged commit a614a22 into main Apr 15, 2026
4 checks passed
@anonvt anonvt deleted the fix/playground-script-loading branch April 15, 2026 21:52
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