Skip to content
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

Remove experimental flag from serverActions.bodySizeLimit #57661

Closed
wants to merge 6 commits into from
Closed

Remove experimental flag from serverActions.bodySizeLimit #57661

wants to merge 6 commits into from

Conversation

devjiwonchoi
Copy link
Contributor

@devjiwonchoi devjiwonchoi commented Oct 28, 2023

Since the Server Actions became stable, the following config for bodySizeLimit should also be removed from the experimental section.

This PR added the serverActions option to the next config for the current bodySizeLimit and further additions.
Also, modified text on docs from bytes to bits and MB to mb.

Extends #57145 #57433

@ijjk ijjk added area: documentation examples Issue/PR related to examples Turbopack Related to Turbopack with Next.js. type: next labels Oct 28, 2023
@ijjk
Copy link
Member

ijjk commented Oct 28, 2023

Allow CI Workflow Run

  • approve CI run for commit: ccac12f

Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer

@devjiwonchoi devjiwonchoi marked this pull request as ready for review October 28, 2023 09:20
@devjiwonchoi devjiwonchoi requested review from jh3y and delbaoliveira and removed request for a team October 28, 2023 09:20
@vercel-spaces
Copy link

vercel-spaces bot commented Oct 28, 2023

Notifying the following users due to files changed in this PR based on this repo's notify modifiers:

@timneutkens, @ijjk, @shuding, @styfle, @huozhi:

packages/next/src/server/config.ts

@@ -140,16 +140,14 @@ In both cases, the form is interactive before hydration occurs. Although Server

## Size Limitation

By default, the maximum size of the request body sent to a Server Action is 1MB, to prevent the consumption of excessive server resources in parsing large amounts of data.
By default, the maximum size of the request body sent to a Server Action is `1mb`, to prevent the consumption of excessive server resources in parsing large amounts of data.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

serverActionsBodySizeLimit ?? '1mb'

@devjiwonchoi
Copy link
Contributor Author

Seems like #57529 is adding more options, need to resolve any conflicts if needed.

@huozhi
Copy link
Member

huozhi commented Oct 31, 2023

@devjiwonchoi Thanks for the PR, we still plan it as experimental flags, we removed serverActions: boolean flag but others could possibly changed as they're mainly related to deployment. Will tackle them later once those flags can move to stable

@devjiwonchoi
Copy link
Contributor Author

devjiwonchoi commented Oct 31, 2023

@huozhi I just wanna know that this:

module.exports = {
  experimental: {
    serverActions: {
      bodySizeLimit: '1mb',
    },
  },
}

is resulting console as:

 ⚠ Invalid next.config.js options detected: 
 ⚠     Unrecognized key(s) in object: 'serverActions' at "experimental"
 ⚠ See more info here: https://nextjs.org/docs/messages/invalid-next-config
 ⚠ Server Actions are available by default now, `experimental.serverActions` option can be safely removed.

and does it not need any modification at the moment?

@devjiwonchoi devjiwonchoi deleted the stable-server-actions-body-size-limit branch October 31, 2023 12:41
@huozhi
Copy link
Member

huozhi commented Oct 31, 2023

@devjiwonchoi that sounds like an issue for configuration validation, thanks for reporting, we'll take a look on that!

@shuding
Copy link
Member

shuding commented Oct 31, 2023

Want to also add that even if Server Actions are considered stable, some options to tweak its behavior might still remain experimental (such as the body size thing). Mostly because they were introduced as a work around to certain issues that might be fixed in a different way in the future.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
examples Issue/PR related to examples locked Turbopack Related to Turbopack with Next.js. type: next
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants