Open alegemaate opened 2 years ago
Hi, it should work with Next.js 12. The CI generally runs the integration tests against the latest Next.js version, so it should be safe for you to upgrade.
The readme currently doesn't include v12 as supported version, since the major feature in v12 were edge functions (middleware), that we currently cannot support. The support of this feature is limited upstream by AWS, since AWS provides no service that could handle middleware correctly at the edge.
But we may should update the readme to include v12 support (without middleware) 👍
Excellent! I will give it a shot. I am most interested in the new SWR compiler 😄 I can of course, let you know if I do notice anything funky, thanks again!
Another missing feature from Next.js 12 is esm-support, that apparently does not work: #275
@ofhouse Thanks for the info!
@ofhouse would it be possible to support esm?
@ofhouse would it be possible to support esm?
@khuezy Yes, it's possible and on the roadmap. It is currently planned as part of #89. Unfortunately I am a bit low on time at the moment so it might take a bit longer until this is shipped.
@ofhouse sorry for the dumb question, but does the lambda support React Server Components (nextjs 12)
@khuezy No wrong questions here 😄
From my understanding React Server Components is simply using another response format (instead of text/html
) but still relies on the standard HTTP protocol for communication.
What seems new here is that it is able to run the renderer in an asynchronous way which enables it to use HTTP streaming responses.
HTTP streaming itself is not a new technology and was established over 20 years ago (I think). So instead of waiting until the full package has arrived, the browser can start painting the website when the first few bytes have arrived. Lambda itself is currently not capable of HTTP streaming since it is invoked synchronously. I think that AWS is actively working on bringing HTTP streaming to Lambda and the first sign of this was the introduction of functionUrls in April.
However I think HTTP streaming is not a big deal as Vercel markets it, since in practice it will probably reduce the time-to-first byte (TTFB) in between 10-20ms which is barely noticeable. But even when AWS releases HTTP steaming for Lambda there is still the CloudFront CDN in front of it that will not support HTTP streaming in the foreseeable future.
Since a HTTP streaming response can always be converted into a synchronous HTTP response (via buffering) I don't see any issues why Lambda should not be able to render Server Components.
Thanks for the response and info!
Hello,
I have been using this package for multiple projects and it has been working great, thanks for providing such an awesome package! I see in the README file that it mentions nextjs 9-11 support, and was curious if anyone has tried it using v12. I would like to get the development performance benefits that v12 is boasting but of course, wanted to ensure that this does work with v12 before doing so.