chore(viewer): drop dead /u/ base-path fallback from default host#171
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
createDefaultHost()in the embeddable engine derived its base path from:The
/u/:accountURL-sniffing branch was specific to an old hosted-wrapper URLshape. It's dead for every supported consumer:
window.__SIDESHOW_BASE_PATH__explicitly — it never relied on the regex.SideshowHost(and has moved to clean,GitHub-style URLs without a
/u/prefix), so it never hits the default host'sfallback 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/aliceexample in the commentand the
embed.d.tstype 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