Skip to content

fix(adapter-netlify)!: write output conforming to Netlify Frameworks API#15294

Merged
teemingc merged 33 commits intosveltejs:version-3from
serhalp:refactor/netlify-frameworks-api
Feb 20, 2026
Merged

fix(adapter-netlify)!: write output conforming to Netlify Frameworks API#15294
teemingc merged 33 commits intosveltejs:version-3from
serhalp:refactor/netlify-frameworks-api

Conversation

@serhalp
Copy link
Contributor

@serhalp serhalp commented Feb 10, 2026

(Stacked on top of #15203)

closes #15169

The current implementation of the Netlify adapter writes output to paths and config files that are under-documented and in some cases entirely undocumented.

18 months ago, Netlify addressed this by releasing the stable, documented Netlify Frameworks API](https://docs.netlify.com/build/frameworks/frameworks-api/).

This PR migrates the adapter to write output that conforms to this spec.

POTENTIALLY BREAKING CHANGE: Deploying and previewing with Netlify CLI now requires v17.31.0 or later. Run npm i -g netlify-cli@latest to upgrade.


Please don't delete this checklist! Before submitting the PR, please make sure you do the following:

  • It's really useful if your PR references an issue where it is discussed ahead of time. In many cases, features are absent for a reason. For large changes, please create an RFC: https://github.com/sveltejs/rfcs
  • This message body should clearly illustrate what problems it solves.
  • Ideally, include a test that fails without this PR but passes with it.

Tests

  • Run the tests with pnpm test and lint the project with pnpm lint and pnpm check

Changesets

  • If your PR makes a change that should be noted in one or more packages' changelogs, generate a changeset by running pnpm changeset and following the prompts. Changesets that add features should be minor and those that fix bugs should be patch. Please prefix changeset messages with feat:, fix:, or chore:.

Edits

  • Please ensure that 'Allow edits from maintainers' is checked. PRs without this option may be closed.

serhalp and others added 15 commits January 24, 2026 21:20
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
Co-authored-by: Ben McCann <322311+benmccann@users.noreply.github.com>
Co-authored-by: Ben McCann <322311+benmccann@users.noreply.github.com>
@changeset-bot
Copy link

changeset-bot bot commented Feb 10, 2026

🦋 Changeset detected

Latest commit: 74f639b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@sveltejs/adapter-netlify Major

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

@serhalp serhalp changed the title fix(adapter-netlify)!: write output conforming to the documented Netlify Frameworks API fix(adapter-netlify)!: write output conforming to Netlify Frameworks API Feb 10, 2026
@svelte-docs-bot
Copy link

# build output because the Netlify dev plugin doesn't currently detect it
[functions]
directory = ".netlify/functions-internal"
directory = ".netlify/v1/functions"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@serhalp is there any way we could get the Netlify dev plugin to work with the Netlify framework API so we no longer need this hack? Currently, I don't think it picks up these directories or config.json

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I'm working on it actually! I actually realized the issue is that @netlify/dev isn't quite designed yet for a preview/serve context. It doesn't scan output directories, only source.

Copy link
Member

@teemingc teemingc Feb 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we go ahead with this test workaround and leave a todo to remove this once @netlify/dev supports it?

@teemingc teemingc changed the base branch from main to version-3 February 20, 2026 14:26
@teemingc teemingc marked this pull request as ready for review February 20, 2026 14:27
Added a TODO comment regarding @netlify/dev compatibility with the Netlify frameworks API.
@teemingc teemingc merged commit 0a194a0 into sveltejs:version-3 Feb 20, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor Netlify adapter to match new serverless function expected output

3 participants