This repository has been archived by the owner on May 10, 2021. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is the basis for fixing a few issues related to the compatibility layer between Next.js and Netlify Functions.
Until now, we were relying on the
next-aws-lambda
package (source code:https://github.com/serverless-nextjs/serverless-next.js/blob/master/packages/compat-layers/apigw-lambda-compat/). However, there are some issues that have arisen that we can only fix by modifying the compatibility layer (#74, #82, #20). So this PR copies over next-aws-lambda (it's just two files) and removes the dependency, so that we can modify and customize this compatibility layer in the future and fix the aforementioned issues (PRs coming!).The PR also refactors the files from
next-aws-lambda
to remove unnecessary code and make them easier to read. There are were comments in the package code, so unfortunately the files continue to have relatively few comments — at least for now. Our Netlify Function handler should be easier to read now, too.This PR will also enable us to make progress on opennextjs/opennextjs-netlify#10.