Commit Graph

2388 Commits

Author SHA1 Message Date
Nicolas Dorseuil 3bd9976524 Revert "super hacky solution to PPR cache body"
This reverts commit 4c36cf9abd.
2026-09-07 11:43:52 +02:00
Nicolas Dorseuil 4c36cf9abd super hacky solution to PPR cache body 2026-09-07 11:41:10 +02:00
Nicolas Dorseuil c1530706d0 Refactor PPR layout functions to use 'header' context and enhance type definitions for site context 2026-09-07 11:40:54 +02:00
Nicolas Dorseuil d4fa433d92 Split the PPR layout context between site and revision scopes
`SitePPRLayout` resolved a full site context, which fetches the published
site (site-scoped token) and the space with its revision. Only the site
part is needed to render the shell, and the shell is re-rendered on every
request.

Split `GitBookSiteContext` into a `GitBookSiteScopeContext` holding
everything derived from the published site, and the space context it is
merged with. The PPR layout now resolves only the site scope, under the
header scope so it shares its site fetch, and delegates the announcement,
header, table of contents, footer, admin toolbar and the page/tag icons to
cached components that resolve the revision under their own scope.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-07 11:40:54 +02:00
Nicolas Dorseuil a2170a352a Add PPR token exchange functionality: implement endpoint for exchanging revalidation tokens for scoped content API tokens, enhancing caching and claims management across components. 2026-09-07 11:39:51 +02:00
Nicolas Dorseuil e05abafddb Fix PPR test module mocks leaking into the rest of the suite
`mock.module` replaces a module for the whole bun test process, so mocking
`@/lib/context` and `jwt-decode` wholesale in the PPR route params test broke
every later test file that imported them. Spread the real context module and
sign a real JWT instead.

Also restore the `x-gitbook-route-site` debug header, commented out by mistake.
2026-09-07 11:39:51 +02:00
Nicolas Dorseuil 7e0e76e58a Implement GitBook-secret signature for PPR headers: enforce signature requirement and update related handling in middleware, tests, and proxy scripts. 2026-09-07 11:39:51 +02:00
Nicolas Dorseuil 42ab12a387 Enhance PPR route parameters: add basePath handling for variant consistency in getPPRHeaderRouteParams 2026-09-07 11:39:51 +02:00
Nicolas Dorseuil 2251b36673 Refactor getPPRDefaults function: streamline error handling and validation for decoded PPR defaults 2026-09-07 11:39:51 +02:00
Nicolas Dorseuil 8ef76487c2 Refactor PPR route parameter handling: simplify getPPRTableOfContentsRouteParams by removing unnecessary cache path variation 2026-09-07 11:39:51 +02:00
Nicolas Dorseuil e401c4d4c7 Apply oxfmt import ordering after rebase
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-07 11:39:51 +02:00
Nicolas Dorseuil fb971aefcc Refactor PPR cache handling: implement scoped cache tags for components to ensure independent revalidation and improve data fetching efficiency 2026-09-07 11:39:51 +02:00
Nicolas Dorseuil b6770d959a Prefix cache tags with ppr: for PPR route rendering to ensure cache entries are partitioned from static ones 2026-09-07 11:39:51 +02:00
Nicolas Dorseuil 8d881d88f6 Remove redundant cache tagging in PPRTableOfContents, PPRPageBody, and cachedGenerateSitePageMetadata functions 2026-09-07 11:39:51 +02:00
Nicolas Dorseuil 351c4ffa28 Fix proxy host header handling in forward function to prevent 404 errors 2026-09-07 11:39:51 +02:00
Nicolas Dorseuil bd608e6beb Add PPR development proxy and update documentation for local testing 2026-09-07 11:39:51 +02:00
Nicolas Dorseuil 825e245703 Refactor navigation components: implement client-side selection handling and improve context management 2026-09-07 11:39:50 +02:00
Nicolas Dorseuil 828ce66cd9 Refactor getPPRHeaderRouteParams and getPPRTableOfContentsRouteParams: enhance caching logic and add API token handling 2026-09-07 11:38:07 +02:00
Nicolas Dorseuil 8e1fdedf83 Remove NotFound component: delete unused page not found file 2026-09-07 11:38:07 +02:00
Nicolas Dorseuil 4a88202274 Refactor getPPRHeaderRouteParams: destructure revision from site URL data 2026-09-07 11:38:07 +02:00
Nicolas Dorseuil d077e1a6b6 remove revalidationId from site data 2026-09-07 11:38:07 +02:00
Nicolas Dorseuil 7605d03d8c Refactor PPR components: remove unused files, add default site parameters, and enhance route handling 2026-09-07 11:38:07 +02:00
Nicolas Dorseuil 80026d2724 Refactor PPR components: remove deprecated files, enhance site context handling, and streamline API token management 2026-09-07 11:38:07 +02:00
Nicolas Dorseuil b86ee531d4 Refactor PPR components: remove old files, add new layout and page components, and update utility functions for visitor tokens 2026-09-07 11:38:07 +02:00
Nicolas Dorseuil d939d4c1fd Implement PPR route enhancements with revision and revalidation IDs, refactor headers handling, and add new layout and page components 2026-09-07 11:38:07 +02:00
Nicolas Dorseuil 0cc9a03add fix attempt 2026-09-07 11:38:07 +02:00
Nicolas Dorseuil 3805bac462 Fix invocation of cachedGenerateSitePageMetadata in generateMetadata function 2026-09-07 11:38:07 +02:00
Nicolas Dorseuil 23b438404c Refactor caching functions for site page metadata and viewport in PPR components 2026-09-07 11:38:07 +02:00
Nicolas Dorseuil 40d14b02d8 linting 2026-09-07 11:38:07 +02:00
Nicolas Dorseuil ef0b6f020a Implement caching for site page metadata and viewport generation 2026-09-07 11:38:07 +02:00
Nicolas Dorseuil d6c0d2dbcd comment 2026-09-07 11:38:07 +02:00
Nicolas Dorseuil 125872769f Refactor PPR tokens and enhance route parameter handling in utils 2026-09-07 11:38:07 +02:00
Nicolas Dorseuil a04513f887 Implement PPR routing with token-based headers and restructure related components 2026-09-07 11:38:07 +02:00
Nicolas Dorseuil 7adbb5068f Enhance caching strategy in PPR components with remote cache and tagging 2026-09-07 11:38:07 +02:00
Nicolas Dorseuil 2b146dbc6a Add dynamic export for force-static rendering in page component 2026-09-07 11:38:07 +02:00
Nicolas Dorseuil ea9420817f wip 2026-09-07 11:38:07 +02:00
Tomek 1f250d1fa8 Add site structure e2e tests for external links (#4584) 2026-09-07 09:31:50 +02:00
Brett Jephson 46b3a18b25 Fix nested select css (#4583)
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-04 16:20:52 +01:00
Nolann B. 2ff77e15b5 Attribute a markdown request from the page actions menu (#4581) 2026-09-04 12:17:00 +02:00
Tomek d7c867aa63 Fix MCP/Markdown copy confirmation closing dropdown instantly (#4579)
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-03 16:08:53 +02:00
Tomek bcd1c41aa1 Scroll to top when selecting current page in search (#4578)
Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com>
2026-09-03 11:35:07 +02:00
Viktor Renkema 77058e3f17 Support merged cells (#4500)
Co-authored-by: OpenAI Codex <codex@openai.com>
2026-09-03 10:26:43 +02:00
Tomek 8ad7465801 Simplify carousel overflow with edge masks & fix carousel scroll (#4577)
Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com>
2026-09-02 14:32:53 +00:00
arnau 1b7ac0e41b Open inline Ask AI questions in the configured assistant (#4574) 2026-09-02 12:05:37 +02:00
Tomek 5f88f4e680 Improve cross-space page breadcrumbs (#4571)
Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com>
2026-09-02 11:43:35 +02:00
Peter White 7009bb9311 Drop the body-anchored cover gate from paragraph contrast text (#4573) 2026-09-02 11:24:54 +02:00
Johan Preynat e460ec381e Preserve linked page destinations in published search (#4566) 2026-09-01 15:06:26 +02:00
Johan Preynat 0a82628298 Trap keyboard focus within published search (#4567) 2026-09-01 13:12:01 +02:00
conico974 18ff11b68b Bump @opennextjs/aws and @opennextjs/cloudflare versions (#4570) 2026-09-01 12:14:55 +02:00
Peter White 3bf55cef10 Allow adding query params to the @webframe.navigate action (#4569) 2026-09-01 10:14:07 +02:00