{"repo":"icflorescu/next-server-actions-parallel","free":true,"listed":false,"github":"https://github.com/icflorescu/next-server-actions-parallel","clone":"git clone https://github.com/icflorescu/next-server-actions-parallel.git","description":"A small utility library that enables you to execute Next.js server actions in parallel - the missing ingredient to build a boilerplate-free tRPC-style server-actions workflow.","language":"TypeScript","stars":55,"topics":["concurrency","concurrent","nextjs","non-blocking","parallel","react","rpc","server-actions"],"license":"MIT","category":"deployment-docker-iac","readme_excerpt":"Parallel Next.js Server Actions [![NPM version][npm-image]][npm-url] [![License][license-image]][license-url] [![Sponsor the author][sponsor-image]][sponsor-url] Run multiple Next.js server actions in parallel. The missing ingredient to build tRPC-like workflows, but without the boilerplate. TL;DR Install: Define your server actions like so: app/page.actions.ts : Call them like so: app/page.tsx : How does it perform? In a nutshell: a lot faster than default Next.js server actions, not as fast as REST API routes. Check it in your specific deployment environment and decide if it makes sense for your project. Show gratitude If you find my open-source work useful, please consider sponsing me on GitHub Sponsors. Background story When Vercel added support for server actions in Next.js, a lot of developers - myself included - were hyper-excited about it and saw it as a boilerplate-free alternative to tRPC.io or Telefunc. Many were, however, disappointed to find that Next.js server actions were only executed in series, contrary to what one would expect when triggering them in parallel with Promise.all . It probably worked like that because they were intended to be used for mutations, as \"data should be fetched in server components or using REST API endpoints\" . Plus, since server actions are implemented with POST requests, some purists are reluctant to the idea of using them for fetching data, though POST requests can and usually do return data. However, there are many reasons why pr","default_branch":null,"files":null,"tree":[],"storefront":"/r/icflorescu","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/icflorescu/next-server-actions-parallel/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}