Skip to content

chore(viewer): drop dead /u/ base-path fallback from default host#171

Merged
benvinegar merged 1 commit into
mainfrom
chore/drop-u-prefix-host-fallback
Jun 27, 2026
Merged

chore(viewer): drop dead /u/ base-path fallback from default host#171
benvinegar merged 1 commit into
mainfrom
chore/drop-u-prefix-host-fallback

Conversation

@benvinegar

Copy link
Copy Markdown
Member

What

createDefaultHost() in the embeddable engine derived its base path from:

window.__SIDESHOW_BASE_PATH__ ?? location.pathname.match(/^\/u\/[^/]+/)?.[0] ?? ""

The /u/:account URL-sniffing branch was specific to an old hosted-wrapper URL
shape. It's dead for every supported consumer:

  • Self-hosted runs at the root (empty base path) or sets
    window.__SIDESHOW_BASE_PATH__ explicitly — it never relied on the regex.
  • The cloud wrapper injects its own SideshowHost (and has moved to clean,
    GitHub-style URLs without a /u/ prefix), so it never hits the default host's
    fallback either.

This drops the dead regex branch so the default host derives its base path from
the global alone, and refreshes the now-stale /u/alice example in the comment
and the embed.d.ts type docs.

Behavior change

None for self-hosted — parity preserved. The global remains the supported
mechanism for a wrapper to set a base path.

🤖 Generated with Claude Code

createDefaultHost() derived its base path from
`window.__SIDESHOW_BASE_PATH__ ?? location.pathname.match(/^\/u\/[^/]+/)?.[0] ?? ""`.
The `/u/:account` URL-sniffing fallback was specific to an old hosted-wrapper URL
shape — self-hosted sideshow runs at the root (empty base) or sets the global
explicitly, and the current cloud wrapper injects its own host. So the regex
branch was dead for every supported consumer. Derive the base path from the
global alone, and refresh the now-stale `/u/alice` comment examples in host.ts
and the embed type declarations.

No behavior change for self-hosted (parity preserved).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@benvinegar benvinegar merged commit f0e0337 into main Jun 27, 2026
9 checks passed
@benvinegar benvinegar deleted the chore/drop-u-prefix-host-fallback branch June 27, 2026 13:43
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