You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 10, 2021. It is now read-only.
* Copy files from next-aws-lambda
Copy over the files from the next-aws-lambda package and manually
bundle them into our Netlify Functions. This gives us more flexibility
to customize the compatibility layer between Netlify Functions and
Next.js. For now, no changes have been made to the next-aws-lambda
files and they have been copied as-is.
next-aws-lambda source: https://github.com/serverless-nextjs/serverless-next.js/tree/master/packages/compat-layers/apigw-lambda-compat
* Remove workaround: base64 support in Netlify Functions
As far as I know, Netlify Functions always support base64 encoding. So
we can remove the code for checking if base64 encoding is supported.
* Netlify Function Handler: Use promise rather than callback
Use the promise approach of next-aws-lambda rather than the callback
approach, because it makes the code easier to read and puts it in the
correct order of execution.
* Refactor: Replace compat.js with renderNextPage.js
Wrap the logic for rendering the Next.js page into its own function.
That keeps the netlifyFunction.js (function handler) minimal and easy
to read. It will also make it easier for users to modify the function
handler while keeping the render function unchanged (down the line,
once we support this feature).
* Refactor: Split reqResMapper into createRequest/ResponseObject
Split the reqResMapper function into two separate files. One for
creating the request object and one for creating the response object.
This is easier to read and understand.
0 commit comments