Skip to content

Conversation

@eduardoboucas
Copy link
Member

@eduardoboucas eduardoboucas commented Oct 13, 2025

Breaks up the @netlify/functions module into two:

  • @netlify/functions: production runtime logic, published from the packages/functions/prod directory
  • @netlify/functions-dev: local development emulation logic, published from the packages/functions/dev directory

I've opted for the nested directory setup, where functions has both dev and prod as opposed to top-level functions and functions-dev directories, as a way to convey the relationship between the packages. I'm hoping that release-please will be okay with this setup, but I haven't actually tested.

If that works and we're okay with this setup, we can apply the same logic to the other packages.

Part of https://linear.app/netlify/issue/FRB-2012/separate-types-and-public-methods-from-internal-dependencies.

BREAKING CHANGE

The /dev export, introduced in version 3.1.0, has been removed.

The local development functionality has been extracted into a new @netlify/functions-dev package. If your application relies on that logic, you should npm install @netlify/functions-dev and update your import:

-import { FunctionsHandler } from "@netlify/functions/dev"
+import { FunctionsHandler } from "@netlify/functions-dev"

No other changes are needed.

@eduardoboucas eduardoboucas requested review from a team as code owners October 13, 2025 09:53
Copy link
Contributor

@pieh pieh left a comment

Choose a reason for hiding this comment

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

I've opted for the nested directory setup, where functions has both dev and prod as opposed to top-level functions and functions-dev directories, as a way to convey the relationship between the packages. I'm hoping that release-please will be okay with this setup, but I haven't actually tested.

If that works and we're okay with this setup, we can apply the same logic to the other packages.

I think it's doable to make release please happy, I just tried adjusting config on top of the current changes ( c9110e9 ) and run npx release-please release-pr --token="$(gh auth token)" --repo-url=netlify/primitives --dry-run --target-branch=feat/split-functions-release-please-test and it produced following:

dev: 5.0.0

5.0.0 (2025-10-13)

⚠ BREAKING CHANGES

  • split functions package

Features

  • split functions package (4a5d768)

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @netlify/functions bumped from 4.3.0 to 5.0.0
functions: 5.0.0

5.0.0 (2025-10-13)

⚠ BREAKING CHANGES

  • split functions package

Features

  • split functions package (4a5d768)
functions-dev: 5.0.0

5.0.0 (2025-10-13)

⚠ BREAKING CHANGES

  • split functions package

Features

  • split functions package (4a5d768)

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @netlify/functions bumped from 4.3.0 to 5.0.0
nuxt: 0.2.1

0.2.1 (2025-10-13)

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @netlify/dev bumped from ^4.6.0 to ^5.0.0
vite-plugin: 2.7.1

2.7.1 (2025-10-13)

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @netlify/dev bumped from 4.6.0 to 5.0.0
vite-plugin-tanstack-start: 1.1.1

1.1.1 (2025-10-13)

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @netlify/vite-plugin bumped from ^2.7.0 to ^2.7.1

This PR was generated with Release Please. See documentation.


only question is what the initial version of functions-dev package should be? We can skip putting any version in manifest and the it will produce 1.0.0 as initial version

Also note that I did have to bump last release sha in config, as otherwise functions-dev get bunch of outdated entries in changelog like so:

functions-dev: 1.0.0

1.0.0 (2025-10-13)

⚠ BREAKING CHANGES

  • split functions package

Features

  • add support for edge functions (#233) (c80d77d)
  • Adds W3C trace context propagation to tracer provider (#471) (afe4656)
  • move primitives into monorepo (#101) (93b72b1)
  • split functions package (4a5d768)

Copy link
Member

@serhalp serhalp left a comment

Choose a reason for hiding this comment

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

Definitely on board with this!

So good:
13 direct deps → 1 direct dep
311 transitive deps → 1 transitive dep
82 MB install size → 84 KB install size

eduardoboucas and others added 9 commits October 13, 2025 14:57
Co-authored-by: Philippe Serhal <philippe.serhal@netlify.com>
Co-authored-by: Philippe Serhal <philippe.serhal@netlify.com>
Co-authored-by: Philippe Serhal <philippe.serhal@netlify.com>
Co-authored-by: Philippe Serhal <philippe.serhal@netlify.com>
Co-authored-by: Michal Piechowiak <misiek.piechowiak@gmail.com>
@eduardoboucas
Copy link
Member Author

Also note that I did have to bump last release sha in config, as otherwise functions-dev get bunch of outdated entries in changelog like so:

@pieh do you mind committing this?

@pieh
Copy link
Contributor

pieh commented Oct 13, 2025

@pieh do you mind committing this?

To not mess up your ongoing work - #476 is PR against this branch so you can merge whenever it's convenient

@eduardoboucas eduardoboucas merged commit 0730f5f into main Oct 14, 2025
17 checks passed
@eduardoboucas eduardoboucas deleted the feat/split-functions branch October 14, 2025 08:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants