-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
feat(adapter-netlify)!: migrate to the modern Netlify Functions API #15203
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: 312d3bf The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
The Netlify adapter now generates "v2" Netlify Functions, which uses modern standards (ESM, Request, Response) instead of the legacy "Lambda-compatible" or "v1" format. Under the hood, this greatly simplifies the adapter code and improves maintainability. See more details in this guide: https://developers.netlify.com/guides/migrating-to-the-modern-netlify-functions/. Some key changes: - The use of Request/Resonse eliminated the need for special header parsing, special multi-value handling header, base64 encoding of binary responses, and more. - Configuration of function routing directly in code eliminated the need for `_redirects` file generation. - As a bonus, this removes the limitation that users cannot specify redirects in `netlify.toml`. BREAKING CHANGES: - `platform.context` type changed to https://docs.netlify.com/build/functions/api/#netlify-specific-context-object
6bde8c1 to
35e8762
Compare
|
Thank you, this is really nice! LGTM. Is there anything we can do to get this out of draft? Ideally, we'd release these breaking changes together with the fix for #1604 |
|
@teemingc It's almost there! I just wanted to:
I should have some time today. btw I also have a PR stacked on this one that ports to the modern https://docs.netlify.com/build/frameworks/frameworks-api/, as discussed 😁. I'll open that up later too. |
|
btw if we're doing a major we could do this one too: kit/packages/adapter-netlify/index.js Line 113 in 99836bf
|
The Netlify adapter now generates "v2" Netlify Functions, which uses modern standards (ESM, Request, Response) instead of the legacy "Lambda-compatible" or "v1" format. Under the hood, this greatly simplifies the adapter code and improves maintainability. See more details in this guide: https://developers.netlify.com/guides/migrating-to-the-modern-netlify-functions/.
Some key changes:
_redirectsfile generation.netlify.toml.BREAKING CHANGES:
platform.contexttype changed to https://docs.netlify.com/build/functions/api/#netlify-specific-context-objectPlease don't delete this checklist! Before submitting the PR, please make sure you do the following:
Tests
pnpm testand lint the project withpnpm lintandpnpm checkChangesets
pnpm changesetand following the prompts. Changesets that add features should beminorand those that fix bugs should bepatch. Please prefix changeset messages withfeat:,fix:, orchore:.Edits