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

feat(rsc): Register top-level function-scoped RSAs #11255

Merged
merged 4 commits into from
Aug 14, 2024

Conversation

Tobbe
Copy link
Member

@Tobbe Tobbe commented Aug 14, 2024

This PR adds support for specifying 'use server' inside top-level functions.

async function formAction(formData: FormData) {
  'use server'

  await fs.promises.writeFile(
    'settings.json',
    `{ "delay": ${formData.get('delay')} }\n`
  )
}

Still no support for inline functions

@Tobbe Tobbe added release:feature This PR introduces a new feature changesets-ok Override the changesets check experimental This PR relates to only experimental feature(s) labels Aug 14, 2024
@Tobbe Tobbe added this to the next-release-patch milestone Aug 14, 2024
@Tobbe Tobbe merged commit 560df46 into redwoodjs:main Aug 14, 2024
46 checks passed
@Tobbe Tobbe deleted the tobbe-rsa-transform-function-scope branch August 14, 2024 22:01
dac09 added a commit to dac09/redwood that referenced this pull request Aug 15, 2024
…o try/apollo-upload-link

* 'try/apollo-upload-link' of github.com:dac09/redwood:
  chore(linting): enable type checked linting (redwoodjs#11258)
  chore(lint): lint config refactoring and re-enable some stylistic rules (redwoodjs#11257)
  chore(linting): Re-enable some ts-eslint rules (redwoodjs#11256)
  feat(rsc): Register top-level function-scoped RSAs (redwoodjs#11255)
  chore(lint): refactor react, react-hooks and ts-eslint usage (redwoodjs#11254)
  chore(formatting): Add prettier check to CI (redwoodjs#11253)
  chore(formatting): Formatting 2 of n (redwoodjs#11252)
  chore(formatting): Formatting 1 of n (redwoodjs#11251)
  chore(formatting): Format readme files (redwoodjs#11248)
  chore(record): Remove used file  (redwoodjs#11247)
  chore(formatting): Remove 'insert_final_newline' from editor config (redwoodjs#11249)
  chore(lint): Split linting and formatting (redwoodjs#11246)
dac09 added a commit to dac09/redwood that referenced this pull request Aug 15, 2024
* 'main' of github.com:redwoodjs/redwood: (37 commits)
  chore(linting): enable type checked linting (redwoodjs#11258)
  chore(lint): lint config refactoring and re-enable some stylistic rules (redwoodjs#11257)
  chore(linting): Re-enable some ts-eslint rules (redwoodjs#11256)
  feat(rsc): Register top-level function-scoped RSAs (redwoodjs#11255)
  chore(lint): refactor react, react-hooks and ts-eslint usage (redwoodjs#11254)
  chore(formatting): Add prettier check to CI (redwoodjs#11253)
  chore(formatting): Formatting 2 of n (redwoodjs#11252)
  chore(formatting): Formatting 1 of n (redwoodjs#11251)
  chore(formatting): Format readme files (redwoodjs#11248)
  chore(record): Remove used file  (redwoodjs#11247)
  chore(formatting): Remove 'insert_final_newline' from editor config (redwoodjs#11249)
  chore(lint): Split linting and formatting (redwoodjs#11246)
  chore(linting): Remove/fix references to non-existant files (redwoodjs#11245)
  chore(rsa): Use swc for parsing server actions (redwoodjs#11243)
  chore(lint): Remove override for 'unused-imports/no-unused-imports' (redwoodjs#11244)
  chore(linting): Separate out framework and user linting config (redwoodjs#11242)
  fix: Update default tsconfig options (target, module and moduleResolution) (redwoodjs#11170)
  chore(fixture): Update tailwind dep (redwoodjs#11241)
  chore(deps): bump fast-xml-parser from 4.4.0 to 4.4.1 (redwoodjs#11239)
  chore(rsc): Switch last remaining transform-server test to inline snapshot (redwoodjs#11240)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changesets-ok Override the changesets check experimental This PR relates to only experimental feature(s) release:feature This PR introduces a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants