hi-ogawa / vite-plugins

Next.js compatible React Server Component framework on Vite
https://rsc-experiment-hiroshi.vercel.app/test
MIT License
57 stars 3 forks source link

`middleware.js` convention #551

Closed hi-ogawa closed 3 months ago

hi-ogawa commented 3 months ago

https://nextjs.org/docs/app/api-reference/file-conventions/middleware

It's probably straight-forward. But, I would expect actually integrating things like next-auth is harder.


Probably the hard part is to implement NextResponse.next api?

Indeed, next-auth would need those https://github.com/nextauthjs/next-auth/blob/a3d3d4bab3e037a5359ed22de8b1fff0b5557523/packages/next-auth/src/lib/index.ts#L2-L3

import { headers } from "next/headers.js"
import { NextResponse } from "next/server.js"

Also, our current flight data convention (path)__f.data might cause some trouble with this (cf. https://github.com/hi-ogawa/vite-plugins/pull/374).

hi-ogawa commented 3 months ago

Closed by https://github.com/hi-ogawa/vite-plugins/pull/553