Skip to content

[node] ignore shouldAddHelpers when exporting a server to match production - #11738

Merged
QuiiBz merged 5 commits into
mainfrom
tomlienard/ec-2223-ignore-shouldaddhelpers-in-vercel-cli-when-using-a-server
Jun 20, 2024
Merged

QuiiBz merged 5 commits into
mainfrom
tomlienard/ec-2223-ignore-shouldaddhelpers-in-vercel-cli-when-using-a-server

Conversation

@QuiiBz

@QuiiBz QuiiBz commented Jun 17, 2024

Copy link
Copy Markdown
Member

Follow-up to https://x.com/maggiepint/status/1801975947421442137, we have a difference between production and development (vc dev) regarding shouldAddHelpers:

  • In production, if the user exports a server (e.g. express), we don't add helpers
  • In development, we always add helpers

That means we set/override things like req.body in development, but don't in production. Changing the logic in production can trigger unexpected behaviors and break existing applications, so we should instead fix the CLI to have the same behavior as production.

@changeset-bot

changeset-bot Bot commented Jun 17, 2024 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 36ce6f4

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

This PR includes changesets to release 2 packages
Name Type
@vercel/node Minor
vercel Patch

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

trek
trek previously approved these changes Jun 18, 2024

@TooTallNate TooTallNate left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Change looks fine, but we should add a test.

@QuiiBz
QuiiBz merged commit 8ae40d0 into main Jun 20, 2024
@QuiiBz
QuiiBz deleted the tomlienard/ec-2223-ignore-shouldaddhelpers-in-vercel-cli-when-using-a-server branch June 20, 2024 13:17
EndangeredMassa pushed a commit that referenced this pull request Jun 25, 2024
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## @vercel/[email protected]

### Minor Changes

- Ignore `shouldAddHelpers` when exporting a server to match production
([#11738](#11738))

### Patch Changes

- Update undici dep to address vulnerabilities
([#11749](#11749))

## [email protected]

### Patch Changes

- Updated dependencies
\[[`fd069f184`](fd069f1),
[`8ae40d096`](8ae40d0),
[`f0d6acaa0`](f0d6aca),
[`e33756494`](e337564),
[`dcb7fa5f9`](dcb7fa5)]:
    -   @vercel/[email protected]
    -   @vercel/[email protected]
    -   @vercel/[email protected]

## @vercel/[email protected]

### Patch Changes

- Allow app router prerender functions to use streaming
([#11745](#11745))

- Add experimental preload flag
([#11753](#11753))

## @vercel/[email protected]

### Patch Changes

- Add opt-in env var to use native Fetch polyfills
([#11748](#11748))

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

This branch was successfully deployed

1 active deployment
Preview — 36ce6f43 Deployed Jun 20, 2024 by vercel[bot]
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.

3 participants