v0.25.0
You're about to look through these notes and π€―. Go ahead and take a moment. We'll wait...
OK, now that you're back, admittedly there are a lot of changes in this release (we're looking at you, Prisma π). But while you see words on a screen including lots of bullet points, what we see is an incredible community of contributors that hammered out 40 merged PRs in just 9 days. Yes, π€― indeed. Also π. Lots of ππ
To each and every one of you who contributed, you are simply amazing! And to each and every one of you about to upgrade so you can continue building something amazing, we can't wait to see what you do with Redwood!
β οΈ This release contains Breaking Changes and requires code modifications. See the "Breaking" and "How to Upgrade" sections for more information.
v0.25.0 Highlights π
So. Much. Prisma.
This release upgrades to the new, and greatly improved, Prisma Migrate, which includes new workflows for DB management and a β¨ new Prisma CLI. It's fancy. But it changes a lot of things. Like, a whole lot. Don't worry. The hard integration work is done for you!
- This upgrade resolves the Notorious EPIPE serverless API connection error π (What, you don't know about the EPIPE bug? Lucky you.)
- π Get started with the new
yarn redwood prisma
commands via our CLI Doc- Also it's going to be very helpful to learn about new Prisma Migration Flows using the CLI
- Bummer π’: we can no longer use two DBs, e.g.
provider = ["sqlite", "postgresql"]
inschema.prisma
(aka the Dynamic Provider). See "Breaking" and "How to Upgrade" sections below. - Have a Production DB? You'll need to, um, migrate it to the new Prisma Migrate! Check out this handy guide covering both local dev and production DB upgrade steps. π
Scaffold Generators now Support Prisma @relations
With some exceptions about syntax (hint: no @@id
), you can now use Redwood's Scaffold generators with both one-to-many and many-to-many Prisma Schema relations.
- Here's the Redwood Doc about Schema Relations
- And the Prisma Relations Doc
Changed
- Generators: Scaffolded many-to-many relationship #1758 by @cannikin π
- Generators: Remove warning if you scaffold a model with a relation #1757 by @cannikin
- CLI: restructure and update Deploy command and change Setup Deploy command template #1747 by @thedavidprice
β οΈ - CLI: Rebuild Prisma Client between upgrades #1155 by @noire-munich
- CLI: improve rw prisma command options handling #1746 by @thedavidprice
- CLI: Improvements to
rw prisma
alias #1750 by @peterp - CLI: Prisma migrate dev now handles schema path with spaces #1753 #1762 by @dthyresson
- CLI: Specify node_env before running build web #1755 by @dac09
- CLI: Disable --version and -v for prisma alias #1767 by @peterp
- CLI: yarn rw prisma commands now show a little tip #1772 by @dac09
- Tests: MockProvider β Wrap children in LocationProvider #1681 by @Tobbe
- Tests: Update Test command to use new Prisma command #1745 by @thedavidprice
- Tests: use prisma db push for test DB #1768 by @thedavidprice
- TS: Router: Explicitly build types #1722 by @Tobbe
- TS: Router: Automatically import .ts Page files #1723 by @Tobbe
- TS: Format generated *.d.ts files #1724 by @Tobbe
- TS: Fix router typescript problem #1737 by @dac09
- TS: Specify types for the router package #1741 by @dac09
- Internal: update all contributors and add forrest and kim-adeline #1710 #1763 by @thedavidprice
- Internal: Don't run PR build actions on forks #1712 by @Tobbe
- Internal: Updated Status of Storybook in Technologies #1735 by @VinayaSathyanarayana
- Internal: update CRWA template remove dynamic provider and related copy #1743 by @thedavidprice
- Internal: Make e2e tests use local packages #1761 by @peterp
- Prisma: upgrade Prisma v2.16.0/1 and replace
rw db
commands withrw prisma
#1720 #1766 #1774 by @thedavidprice πβ οΈ - See "Breaking" and "How to Upgrade" sections below
- Release Notes: v2.13.0, v2.13.1, v2.14.0, v2.15.0, v2.16.0, v2.16.1
- HIGHLIGHTS: New Prisma Migrate (preview), Native DB types support (Preview), Integrated database seeding (Preview), Improved API for filtering arrays in PostgreSQL, More powerful counting of records using
select
- Preview Features:
createMany
,orderBy
,groupBy
- see Prisma Release Notes above for many many more updates
- HIGHLIGHTS: New Prisma Migrate (preview), Native DB types support (Preview), Integrated database seeding (Preview), Improved API for filtering arrays in PostgreSQL, More powerful counting of records using
Added
- Auth: Adds Facebook to list of supported Supabase OAuth providers #1739 by @dthyresson π
- API: Support unix socket or port for functions server #1689 by @brentjanderson
Fixes
- Structure: Fix import in RWProject in rw/structure #1707 by @dac09
- Structure: "pisma" is probably "prisma" #1779 by @jangxyz
- Tests: Ensure all data is removed during the teardown step #1714 by @tctrautman
- Cells: don't pass cell children to useQuery #1734 by @wminshew
- Storybook: applying afterQuery in storybook mocks #1740 by @dac09
- Internal: CRWA Readme β Add missing comma #1715 by @Tobbe
- Internal: Fix obejct typo #1716 by @ajcwebdev
- Internal: Corrects dataMigrate install instructions #1718 by @dthyresson
- Internal: Fix env loading in users webpack config #1729 by @dac09
- CLI: Fix rw prisma alias bugs #1760 by @peterp
Breaking β οΈ
Due to Prisma's release of the new Migrate feature + CLI (and deprecation of previous), this release includes several breaking changes that affect all projects:
- previous Prisma migrations are deprecated and replaced
- this means your local dev DB is broken, but also fixable (see guides and "how to upgrade" below)!
- and, yes, you'll need to walk through some step to update your production DB's migrations
- Dynamic Provider deprecated
redwood db [option]
command deprecated and replaced withredwood prisma [option]
- this also means
redwood db seed
is deprecated and replaced with Prisma DB Seed
- this also means
- Deployment command set deprecated and replaced
1. Deprecated yarn rw db
command
Due to the new Prisma CLI, all rw db
commands are now deprecated.
- They've been replaced with new
rw prisma
commands β check out the Redwood CLI Doc- and also read through Prisma Migration Flows using the CLI
- For a full guide to the Prisma CLI, see this Doc
- NOTE:
rw db seed
has been replaced withrw prisma db seed
β code modification required
2. Breaking: Deployment Command
Because the redwood db
command is deprecated, the command string used to build for deployment has also been replaced.
- Use
yarn rw deploy [target]
β see the Doc - Vercel hard codes the default Build Command into their dashboard. You'll need to log in and override if it's not using
rw deploy
- Netlify requires a code mod to your project's
netlify.toml
3. Old Migrations are Broken. Long live the New Prisma Migrations!
Along with new commands to manage your DB in development and Production, you'll need to take steps to upgrade to use the New Migrations. It's non-destructive for production DBs. See "How to Upgrade" below and the walkthrough guide.
4. Prisma's Dynamic Provider is Deprecated: No more dual DBs
You can no longer use both SQLite and Postgres at the same time, which previously was set in schema.prisma
as provider = ["sqlite", "postgresql"]
. From here on out you'll have to make a choice. It's a bummer, yes. But it's better for us all in the long run. See "How to Upgrade" below.
How to upgrade Redwood to the latest v0.25
π IMPORTANT: Skipping versions when upgrading is not recommended and will likely cause problems. Do read through all Release Notes between your current version and this latest version. Each minor release will likely require you to implement breaking change fixes and apply manual code modifications.
Most of these steps are covered in this Upgrading to Redwood v0.25 Guide, including steps to upgrade your production DB using the new
prisma migrate resolve
command
Upgrade Packages
Typically we suggest making code modifications before you upgrade packages. However, in this release, you'll need the new packages to run through code modification steps.
Run the following command within your App's directory:
yarn rw upgrade
Need help or having trouble upgrading packages? See this forum topic for manual upgrade instructions and general upgrade help.
Manual Code Modifications
1. Reminder: Remove Directly Installed Prisma Packages
If you've previously added Prisma packages directly to your project package.json
or api/package.json
, now's the time to remove them. Once you do, be sure to run yarn --force
2. No more Dynamic Provider
If applicable to your project, you need to remove provider = ["sqlite", "postgresql"]
from schema.prisma
and replace it with either provider = "sqlite"
or `provider = "postgresql" π’
- Need help? Take a look at the Upgrade Walkthrough Guide
- Also helpful: Postgres Setup Doc
3. Upgrading DBs to use the New Prisma Migrate
See the Upgrading to Redwood v0.25 Guide to transition both your local dev DB and (if applicable) production DB.
3. Want to deploy? Use the new yarn rw deploy [target]
command
- see the CLI Doc for reference
- Netlify: in the file
netlify.toml
, you need to replace the Build Command withyarn rw deploy netlify
- Vercel: the command is set in the Vercel dashboard "Deploy Setting". Examine the build command and make sure it's
yarn rw deploy vercel
, overriding if necessary - AWS Lambdas via Serverless: the command has changed to be
yarn rw deploy aws
- Note about Self-hosting: there is no specific command, however, the build command string has changed to
yarn install && yarn rw build && yarn rw prisma deploy && yarn rw prisma db seed
. (The Seed step is optional.) See this Doc.
4. Rename your Seeds file π±
Rename the file api/db/seeds.js
to api/db/seed.js
to be compatible with the new command yarn rw prisma db seed
.
5. Rename Prisma findOne
--> findUnique
Prisma deprecated findOne
. Search your project and replace with findUnique
as needed.
6. You made it!
Redwood is rewarding on its own. But this upgrade process was way beyond normal. So now you get a well-deserved π
Happy coding! We hope you build something amazing (and then tell us about it).