Skip to content

chore: add SDK route infrastructure and parity tests#773

Draft
qw-in wants to merge 2 commits intomainfrom
quinn/sdk-routes
Draft

chore: add SDK route infrastructure and parity tests#773
qw-in wants to merge 2 commits intomainfrom
quinn/sdk-routes

Conversation

@qw-in
Copy link
Copy Markdown
Member

@qw-in qw-in commented Mar 3, 2026

Introduce the variant type system, Astro component wrappers, and visual regression tests that validate per-SDK routes render identically to legacy ?f= query parameter pages.

  • Add ArcjetSdkVariant type and helpers (sdkVariants, sdksWithVariants, sdkVariantFromPathname, legacyKeyFromPathname, pathnameForSdkVariant)
  • Rename React components to *React.tsx and wrap with Astro server components (SlotByFramework, TextByFramework, FrameworkLinks) that render statically on SDK routes and delegate to React on legacy pages
  • Update MDX imports to use .astro wrappers and remove client:load
  • Add stub MDX files for variant get-started pages (bun+hono, node+express, node+hono, python+fastapi, python+flask)
  • Add Playwright screenshot parity tests covering all 16 page types across all supported frameworks (114 tests)

Introduce the variant type system, Astro component wrappers, and visual
regression tests that validate per-SDK routes render identically to legacy
?f= query parameter pages.

- Add ArcjetSdkVariant type and helpers (sdkVariants, sdksWithVariants,
  sdkVariantFromPathname, legacyKeyFromPathname, pathnameForSdkVariant)
- Rename React components to *React.tsx and wrap with Astro server
  components (SlotByFramework, TextByFramework, FrameworkLinks) that
  render statically on SDK routes and delegate to React on legacy pages
- Update MDX imports to use .astro wrappers and remove client:load
- Add stub MDX files for variant get-started pages (bun+hono,
  node+express, node+hono, python+fastapi, python+flask)
- Add Playwright screenshot parity tests covering all 16 page types
  across all supported frameworks (114 tests)
@qw-in qw-in requested a review from a team as a code owner March 3, 2026 18:53
@qw-in qw-in self-assigned this Mar 3, 2026
@qw-in
Copy link
Copy Markdown
Member Author

qw-in commented Mar 3, 2026

This sets up the plumbing for per-SDK routes (/sdk/next/get-started,
/sdk/bun/plus/hono/get-started, etc.) without actually changing any
user-facing content yet.

The main idea: Astro wrapper components that render content statically on
SDK-scoped routes and fall back to the existing React+client:load behavior
on legacy ?f= pages. That way both URL schemes produce identical output,
which we now verify with 114 Playwright screenshot tests.

This is a stepping stone — once the SDK routes are live and linked, we can
start migrating content into per-SDK MDX files and eventually retire the
?f= query param approach.

It replaces the approach in #729 where I tried to do it all at once. Instead here we have parity guarantee without duplicated content! Once we swap over we can continue to leverage the screenshots and refactor to something more in line with #729

You should notice testing this preview that going to /sdk/astro/get-started now shows astro content which is the big improvement. Plus, as you can tell from removing client:load, this is all ssr (in the /sdk routes)

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 3, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
arcjet-docs Ready Ready Preview, Comment Mar 3, 2026 7:17pm

Request Review

@qw-in
Copy link
Copy Markdown
Member Author

qw-in commented Mar 3, 2026

Hoping its due to the outage or the preview or something but this seems to break with the Vercel adapter 🤔

@qw-in qw-in marked this pull request as draft March 3, 2026 21:52
@davidmytton
Copy link
Copy Markdown
Contributor

Yeah when I go to /sdk/astro/get-started there are permanent loading skeletons:

image

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.

2 participants