Cleanup and remove old preview format using /url/preview#4117
Cleanup and remove old preview format using /url/preview#4117taranvohra wants to merge 4 commits intomainfrom
/url/preview#4117Conversation
|
|
Summary of the deployments:
Test content |
|
The latest updates on your projects. Learn more about Argos notifications ↗︎
|
There was a problem hiding this comment.
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.
d599caf to
bf66f05
Compare
It is no longer needed