nextlove
nextlove copied to clipboard
add support for edge
This PR contains a LOT of stuff, and will probably be split into some PRs
- edge only supports web native API, so some things we do in the generated scripts are not allowed, and we should either move them to a new package (nextlove-generate) or improve the build to not bundle everything in one file.
- move the nextjs-wrappers-middleware and nextjs-exception-middleware to nextlove
- nsm needs to support the new folder structure (/app), unable to test until it.
- we need to check the issue with nextjs redirects (in nextjs config file)
After that, we are good to go.
The final result is:
Note that: responseEdge, edgeBody, and edgeQuery are variable names just to make it work, I'll appreciate it with you have better names.
nsm needs to support the new folder structure (/app), unable to test until it.
I think we can opt-in specific routes without using /app: https://nextjs.org/docs/app/building-your-application/rendering/edge-and-nodejs-runtimes#segment-runtime-option