Skip to content

feat(nextjs): add Next.js App Router support #80

@perasperaactual

Description

@perasperaactual

Problem

Stackwright's current registration pattern targets Next.js Pages Router (pages/_app.tsx). The Next.js community has largely migrated to App Router (Next.js 13+). New users starting a project today default to App Router and find no supported Stackwright path.

What needs to change

Registration

  • Document and test registerNextJSComponents() in app/layout.tsx
  • Add 'use client' directives where required

Static generation

  • getStaticPropsForSlug / getStaticPaths are Pages Router APIs
  • Add App Router equivalents: generateStackwrightStaticParams() and an async page data fetcher

Scaffolding

Testing

  • Verify the prebuild pipeline output is consumed correctly under App Router data fetching model
  • Add or migrate an example to App Router

Acceptance criteria

  • A working Stackwright site can be built with Next.js App Router
  • Registration, static generation, and routing all work
  • App Router path is the default in documentation and scaffold output

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority:visionAspirational — shapes direction, no timeline

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions