Skip to content

Cleanup and remove old preview format using /url/preview#4117

Open
taranvohra wants to merge 4 commits intomainfrom
taran/remove-old-preview
Open

Cleanup and remove old preview format using /url/preview#4117
taranvohra wants to merge 4 commits intomainfrom
taran/remove-old-preview

Conversation

@taranvohra
Copy link
Member

@taranvohra taranvohra commented Mar 16, 2026

It is no longer needed

@changeset-bot
Copy link

changeset-bot bot commented Mar 16, 2026

⚠️ No Changeset found

Latest commit: bf66f05

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions
Copy link
Contributor

github-actions bot commented Mar 16, 2026

@argos-ci
Copy link

argos-ci bot commented Mar 16, 2026

The latest updates on your projects. Learn more about Argos notifications ↗︎

Build Status Details Updated (UTC)
customers-v2-cloudflare (Inspect) ⚠️ Changes detected (Review) 19 changed Mar 17, 2026, 4:48 PM
v2-cloudflare (Inspect) ⚠️ Changes detected (Review) 21 changed Mar 17, 2026, 4:54 PM

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR removes support for the legacy preview URL format (notably the https://preview/... host and /url/preview/... routes) and standardizes preview handling around GITBOOK_PREVIEW_BASE_URL (defaulting to https://sites.gitbook.com/preview/).

Changes:

  • Remove legacy “preview host” support and update preview detection/identifier extraction to rely on GITBOOK_PREVIEW_BASE_URL.
  • Update unit tests to use the new preview URL format and ensure the old format is treated as non-preview.
  • Remove obsolete E2E coverage for the deprecated /url/preview/... route format.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/gitbook/src/middleware.ts Removes legacy preview-host mention in route handling comments.
packages/gitbook/src/lib/preview.ts Updates preview URL detection/identifier parsing and preview cookie URL scoping.
packages/gitbook/src/lib/preview.test.ts Updates preview URL fixtures and assertions for new vs legacy formats.
packages/gitbook/src/lib/links.test.ts Adjusts preview linker test fixture to reflect new preview URL structure.
packages/gitbook/src/lib/images/getImageResizingContextId.test.ts Updates preview URL fixture used for context-id extraction.
packages/gitbook/e2e/internal.spec.ts Drops E2E cases for the deprecated /url/preview/... format (new “Site Previews” suite remains).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

3 participants