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: next-safe-action for server actions #16613

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

Conversation

sean-brydon
Copy link
Member

What does this PR do?

Adds next-safe action so we can use mutations in close approach to trpc https://next-safe-action.dev

Moves next-auth api route over to app directory. Doesnt break pages and allows us to easily call getServerSession from within server actions without needing to pass in req,res.

Mandatory Tasks (DO NOT REMOVE)

  • [ X] I have self-reviewed the code (A decent size PR without self-review might be rejected).
  • I have added a Docs issue here if this PR makes changes that would require a documentation change. If N/A, write N/A here and check the checkbox.
  • I confirm automated tests are in place that prove my fix is effective or that my feature works.

How should this be tested?

  1. Test authentication works both on pages directory and app directory.
    These server actions are not used anywhere yet and are created for when we need them in app directory

Checklist

  • I haven't read the contributing guide
  • My code doesn't follow the style guidelines of this project
  • I haven't commented my code, particularly in hard-to-understand areas
  • I haven't checked if my changes generate no new warnings

@keithwillcode keithwillcode added consumer core area: core, team members only labels Sep 12, 2024
Copy link

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher

🚮 Removed packages: npm/@formkit/auto-animate@1.0.0-beta.5

View full report↗︎

@@ -175,7 +175,7 @@ const nextConfig = {
output: process.env.BUILD_STANDALONE === "true" ? "standalone" : undefined,
experimental: {
// externalize server-side node_modules with size > 1mb, to improve dev mode performance/RAM usage
serverComponentsExternalPackages: ["next-i18next"],
serverComponentsExternalPackages: ["next-i18next", "typeorm", "@boxyhq/saml-jackson", "handlebars"],
Copy link
Member Author

Choose a reason for hiding this comment

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

saml-jackson imports a bunch of things nextjs will try to bundle by default. We don't want them to as theyre pretty big so we just let node take care of it.

Copy link
Contributor

@keithwillcode keithwillcode left a comment

Choose a reason for hiding this comment

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

Approving to test integration

@keithwillcode keithwillcode added this to the v4.6 milestone Sep 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
consumer core area: core, team members only ready-for-e2e
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants