Skip to content

Releases: redwoodjs/redwood

v0.27.1

11 Mar 07:06
Compare
Choose a tag to compare

This release contains many important internal changes that improve security, TypeScript support, framework development CI/CD, and upgrades necessary to prepare for a future v1 release candidate (e.g. upgrading to React v17).

Thank you to all the amazing contributors who are keeping the PRs rolling! Redwood is amazing because of you πŸŽ‰

⚠️ This release contains Breaking Changes and requires code modifications. See the "Breaking" and "How to Upgrade" sections for more information.

Changed

  • ℹ️ Bump CRWA Node.js Engine requirement from 12 to 14 (#1946) 5dbb9e0 @thedavidprice
  • Replaces Flash with react-hot-toast (#1856) 4a899b5 @cannikin
  • Router Docs - Remove idea of sharing router outside of Redwood (#1900) 624b0d5 @andrew-hwahin
  • Port test-tutorial script to JS (#1896) df8d0c2 @dac09
  • ⚠️ Upgrade React to v17. (#1705) f586198 @peterp
  • ⚠️ Upgrade to Prisma v2.18.0 (skipping v2.17.0) (#1851) 9f62208 @thedavidprice
    • Contains changes that may be "Breaking" for some projects. See β€œBreaking” section below.
      • Release Notes: v2.17.0, v2.18.0
        • HIGHLIGHTS: Native Types are now stable, Prisma Migrate now works with cloud-hosted databases (requires additional config)
        • CHANGES: prisma db push flags have been changed, Relation syntax will no longer be updated automatically (use yarn redwood prisma format)

Added

Fixes


Breaking ⚠️

Upgrading React and adding a package resolution

As of this version, Redwood is using React v17.0.1. However, other dependencies, e.g. Storybook, use a different version of React. This results in packages being duplicated and hoisted into web/node_modules, which breaks unexpected things.

Projects need to bump their version of React. Additionally, to avoid duplication and hoisting, the solution is to add a package resolution. See the β€œHow to upgrade…” section below.

Bumping Node.js Engine to v14

Technically this is not (yet) a breaking change. We are bumping Redwood’s Node.js requirement to Node.js v14 (from v12) and strongly encourage you to make the change now in your project. See β€œHow to upgrade…” section below.

Replace Flash with React Hot Toast [deprecation warning]

This release replaces our custom Flash stuff with react-hot-toast and updates the scaffold generators to generate with the new interface. Importing Flash will give a deprecation warning. Flash will be fully deprecated in Redwood v1 release.

Migration to react-hot-toast is not required yet unless you are using dismissMessage() and cycleMessage(), which will now be a noop and you'll just see the deprecation notice.

See more information and a guide here for switching from Flash to Toaster.

Prisma Changes that may affect some projects

Prisma Type Mapping

Type mapping from Prisma schema to the database for Float has changed from Decimal to Double in MySQL and PostgreSQL. Check out this video guide, which covers how to upgrade and address the remapping of Float.

Breaking changes due to strict type diffing and native types

Prisma no longer allows the loose mapping of Prisma scalar types to database column types without the specific notation. For more info, see Prisma v2.17.0 Release Notes


How to upgrade to Redwood v0.27 from v0.26

πŸ‘‰ 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.

Manual Code Modifications

Step 1: React upgrade and resolutions

In your root package.json, add the following resolutions (see also this reference code):

+ "resolutions": {
+  "react-dom": "17.0.1",
+  "react": "17.0.1"
+  }

Depending on what Redwood version your project started on, there might be other lower priority changes to ./package.json. Now might be a good time to inspect the current create-redwood-app package.json template code here and make other updates if needed.

And in your web/package.json, make sure react and react-dom in your dependencies are at the correct version (see also this reference code):

-    "react-dom": "^16.13.1",
-    "react": "^16.13.1",
+    "react": "17.0.1",
+    "react-dom": "17.0.1",

Then run:

yarn install

πŸ‘‰ Note: When running yarn install during and after the upgrade you will see several warnings that are expected and safe to ignore:

[1/5] πŸ”  Validating package.json...
[2/5] πŸ”  Resolving packages...
warning Resolution field "react@17.0.1" is incompatible with requested version "react@^16.8.3"
warning Resolution field "react@17.0.1" is incompatible with requested version "react@^16.8.3"
warning Resolution field "react-dom@17.0.1" is incompatible with requested version "react-dom@^16.8.3"
warning Resolution field "react@17.0.1" is incompatible with requested version "react@^16.8.3"
warning Resolution field "react-dom@17.0.1" is incompatible with requested version "react-dom@^16.8.3"
warning Resolution field "react@17.0.1" is incompatible with requested version "react@^16"

Step 2: Running your app on Node.js v14.x

In your root package.json, make the following change (see also this reference code):

+ β€œengines”: {
-  "node": ">=12”,
+  "node": ">=14",
+  }

Check if the file .nvmrc exists in your project root. If not, create it. Then add the following, which is a configuration option to use the lates LTS version of Node.js, which is currently v14.x. (see also this reference file):

lts/*

If you are deploying on Netlify or Vercel, the .nvmrc will automatically configure the build environment to use Node.js v14.x. There is an additional setting on Vercel you may change in Settings/General/β€œNode.js Version”. However, the .nvmrc file will take precedence.

Upgrade Packages

πŸ‘‰ IMPORTANT: In this version, upgrading packages is a two-step process. Please complete both steps to ensure you’ve resolved any possible issues with React package duplication.

Step 1

Run the following command within your App's directory:

yarn rw upgrade

Step 2

Once the upgrade is complete, inspect the Web workspace for web/node_modules. If this directory is present (it most likely will be), remove it:

rm -rf web/node_modules

This command works for Mac and Linux. For Windows, use the applicable shell command to delete the directory and its contents.

Lastly, run a force install:

yarn --force

Confirm there are no duplicate react, react-dom, or core-js packages in web/node_modules (which might not exist at all). If you have questions about this process or need help, see this forum topic.

Need other help or having trouble upgrading packages? See this forum topic for manual upgrade instructions and general upgrade help.

v0.26.2

26 Feb 03:08
Compare
Choose a tag to compare

This release introduces the new Prerender feature, which is the culmination of months of work by many individuals across the community. Prerender in Redwood is opt-in (simply add a prop to a Route!) with built-in support that "just works" β€” it's fully compatible with other Redwood features like Cells. This is the first new feature from the Redwood at Scale initiative, which will bring many future improvements to application performance.

We think you're going to like it πŸš€

⚠️ This release contains Breaking Changes and requires code modifications. See the "Breaking" and "How to Upgrade" sections for more information.

v0.26.0 Highlights πŸŽ‰

⚑️ Redwood Prerender

Both @dac09 and @peterp carried this one to the finish line. Well done, you two!

Although prerendering is as easy as adding a prerender prop to a Route, there's more you can do and need to know:

  • Redwood Prerender Doc: how to, helpers, and specific considerations
  • For reference, you'll want to understand how Redwood is now automatically handling App.js mounting to the DOM. And for complex cases, you might need to customize index.js. Take a look at the Custom Index Doc
  • For a full walk-through of Redwood Prerender, including discussion and Q&A, watch this YouTube Video from the most recent Meetup

Ready to get started?
All new Redwood projects are ready for prerendering once they're installed! 'Cause that's the Redwood way 🌲

If you're upgrading your project, start with the "Manual Code Modifications" section below before you set up prerender on your Routes.

πŸ” Nhost Auth Provider

The fine folks at Nhost have added a Redwood Auth provider. Check it out!

Changed

Added

  • Prerender: Render landing/marketing/static pages + Private page whileLoading #1641 by @dac09 πŸŽ‰
  • Prerender: image support #1721 by @dac09
  • Prerender: Better messages when no routes marked with prerender #1821 by @dac09
  • Prerender: Hide entry.js | Add setup command to restore #1842 by @dac09 ⚠️
  • Prerender: Changes for prerender release #1855 by @dac09
  • Auth: Nhost Auth 1.0 provider #1725 by @nunopato πŸŽ‰
  • CSS: Minify CSS in production builds #1697 by @dac09
  • Internal: Add Cypress Step6 Test #1780 by @wafuwafu13
  • Internal: New contributor workflow #1792 by @dac09
  • Internal: Add curly rule for blocks #1836 by @Krisztiaan
  • Docs: Docs: Update contributor workflow to yarn rwt link #1803 by @jtoar
  • Docs: Update CONTRIBUTING.md rwt link docs #1852 by @dac09
  • TS: Add types to Flash, clean up some logic #1824 by @Krisztiaan

Fixes

  • Prerender: Fixes to crwa template for prerender #1819 by @dac09
  • Prerender: Adds types for pageLoadingContext | Fix for pageLoader during prerender #1832 by @dac09
  • Prerender: replace instances of web/src/index.js with web/src/App.js #1857 by @thedavidprice
  • Prisma: use new 'prisma' package to replace '@prisma/cli' #1800 by @thedavidprice
  • CLI: Passthrough error codes on cli failures #1791 by @dac09
  • CLI: Remove backticks #1826 by @adriatic
  • CLI: Fix dataMigrate command import error via babel register #1845 by @dac09
  • CLI: fix rw test command when run from dir other than root and upgrade execa #1846 by @thedavidprice
  • Storybook: Don't open storybook when --open=false is given #1795 by @jvanbaarsen
  • Template: Lint the create-redwood-app template #1822 by @peterp
  • TS: Fix Router TS types #1823 by @Tobbe
  • Internal: E2E if path to project given, use the installed packages #1837 by @thedavidprice
  • Internal: webpack config use || instead of ?? #1881 by @Tobbe
  • Generators: Fixes generating scenarios for relations where the field name is different than the relation name #1848 by @cannikin
  • Tests: Run Teardown after each test #1818 by @jvanbaarsen

Breaking ⚠️

To offer built-in Prerender support, Redwood now handles mounting the React <App /> to the DOM internally. This enhancement required breaking changes to the existing web/src/index.js.

  • in web/src/index.js, the React root element is now a component. References to the browser window, e.g. document. will throw an error
  • web/src/index.js has been renamed to web/src/App.js

To learn more about how Redwood is automatically handling mounting, see this Custom Web Index doc. For some applications with specific index.js requirements, this document provides customization instructions.


How to upgrade Redwood to the latest v0.26

πŸ‘‰ 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.

Manual Code Modifications

1. Rename web/src/index.js to web/src/App.js

2. In web/src/App.js, convert the React root element to a component named App

Any references to the browser window need to either be removed or wrapped in a conditional like isBrowser (see step 4 for more about the Prerender utils Redwood provides to make checking for these cases easier). For existing Redwood projects, this means at a minimum you'll need to remove ReactDOM.render(...document.getElementbyID()...

-import ReactDOM from 'react-dom'

import { FatalErrorBoundary } from '@redwoodjs/web'
import { RedwoodApolloProvider } from '@redwoodjs/web/apollo'

import FatalErrorPage from 'src/pages/FatalErrorPage'
import Routes from 'src/Routes'

import './index.css'

-ReactDOM.render(
+ const App = () => (
  <FatalErrorBoundary page={FatalErrorPage}>
    <RedwoodApolloProvider>
      <Routes />
    </RedwoodApolloProvider>
  </FatalErrorBoundary>,
-  document.getElementById('redwood-app')
)

+ export default App

Depending on other custom implementations to your projects App.js, you may need to make additional changes or, in some cases, even create a custom web/src/index.js to handle Reacting mounting. If so, see the Custom Web Index doc

3. Update web/src/index.html to support prerender

This lets Redwood know where to place your pre-rendered HTML.

...

<body>
  <div id="redwood-app">
+    <%= prerenderPlaceholder %>
  </div>

...

4. Special Prerender Considerations

If you're ready to take Prerender for a spin, now is the time to look through the Redwood Prerender Doc, especially the section "Prerender Utils".

Sometimes you'll need granular control over what gets prerendered. For example, if you're using Netlify Identity, you can only initialize it on the browser. You'll need to use the isBrowser helper in your web/src/App.js:

+ import { isBrowser } from '@redwoodjs/prerender/browserUtils'
...

+ if (isBrowser) {
  netlifyIdentity.init()
+ }

Don't worry, we don't expect you to know how to identify every case like this. You can check using the following debugging flow:

  1. First run yarn rw build web. If elements can't run on Node.js, they'll throw errors here, which will show you what needs specific handling.
  2. Once you can build successfully, then run yarn rw prerender --dry-run. You may get a lot of warnings, which is fine. Keep a lookout especially for error, which indicates other elements that require special handling.

Upgrade Packages

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.

v0.25.1

16 Feb 04:30
Compare
Choose a tag to compare

πŸ› This patch release fixes two issues:

  1. Restores Prisma CLI interactivity when using yarn rw prisma #1785 #1790 by @dac09
  2. yarn rw dataMigrate install now runs successfully #1787 #1798 by @dthyresson

v0.25.0

11 Feb 17:50
Compare
Choose a tag to compare

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
  • Bummer 😒: we can no longer use two DBs, e.g. provider = ["sqlite", "postgresql"] in schema.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.

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 with rw 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

Added

Fixes


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 with redwood prisma [option]
    • this also means redwood db seed is deprecated and replaced with Prisma DB Seed
  • 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
  • For a full guide to the Prisma CLI, see this Doc
  • NOTE: rw db seed has been replaced with rw 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 rem...

Read more

v0.24.0

02 Feb 02:54
Compare
Choose a tag to compare

Come join us at the next RedwoodJS Meetup on Thursday, February 11th!

This release contains Breaking Changes. See the "Breaking" section for more information.

v0.24.0 Highlights πŸŽ‰

Ethereum Auth Provider

Thanks to @pi0neerpat, you can now use Ethereum as an Auth provider in your Redwood App!

Change GraphQL Client

This has been a work in progress by both @peterp and @Tobbe. Redwood still ships with first-class Apollo Client support, but as of this release, it's been fully decoupled. You can use another client of your choice (or no provider if you'd like), and Apollo Client will not be referenced or installed.

  • For instructions, see this Blog Post by Tobbe Lundberg
  • This update is a breaking change. See the "Breaking" section below.

Changed

  • GraphQL: Don't bundle Apollo Client if the user specifies their own client #1639 by @Tobbe βš οΈπŸŽ‰
  • CLI: Move deploy and auth from generate to setup #1685 by @dac09
    • this deprecates rw g auth, rw g deploy, and rw g util in favor of rw setup [auth | deploy | etc]
  • Auth: Azure Active Directory updating default auth request for acquireTokenSilent #1703 by @jeliasson
  • Router: TypeScript rewrite #1666 by @Tobbe
  • Internal: Replaced merge-graphql-schemas with graphql-tools #1322 by @himankpathak
  • Internal: vendor create app template #1637 by @pepibumur
  • Internal: add codemod to e2e so web tests pass #1708 by @thedavidprice
  • Docs: Revise the CRWA package README #1668 by @thedavidprice

Added

Fixes


Breaking ⚠️

This release includes a breaking change that affects all projects. There are two other items that may affect some projects.

1. Breaking: Removed and Replaced <RedwoodProvider> (affects ALL projects)

To support switching GraphQL Clients, <RedwoodProvider> has been removed and replaced with <RedwoodApolloProvider>, which imports from @redwoodjs/web/apollo.

  • See "Manual Code Modifications" below for upgrade instructions
  • Related PR #1639

2. Deprecation Warning: Auth Tokens are now refreshed when they expire

authToken is being deprecated and will be removed in future release. Use getToken() instead.

3. Bug: Prisma intermittent write EPIPE error

There is a known API bug in Prisma v2.12 through v2.14 (v2.12 is used by Redwood in this release). This issue affects deployed projects using Serverless API and causes intermittent 502 errors with a console log message including "write EPIPE + Cannot read property 'onError' of undefined". Until Redwood is upgraded to the most recent version of Prisma with the bug fix, v2.15, you can work around the issue based on your project's needs and infrastructure. See this Redwood Forum Topic for more information.

  • This does not affect the Redwood Tutorial experience. If you see a 502 error after deployment, simply refresh the page
  • For production apps using the Prisma Dynamic Provider option (e.g. both SQLite and PostgreSQL), it is recommended you downgrade your project to Prisma v2.11. Run yarn add -W @prisma/sdk@2.11.0 @prisma/client@2.11.0 @prisma/cli@2.11.0.
  • For production apps not using Dynamic Provider, it is recommended you upgraded to Prisma v2.15, which will also require using the Prisma CLI new migrate commands (until they are supported by Redwood CLI in a future release). See this Forum Discussion Topic for an overview and instructions.
  • Related Prisma Issues #4557 and #4744

How to upgrade RedwoodJS to the latest v0.24

πŸ‘‰ 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.

Manual Code Modifications

1. Remove <RedwoodProvider> and Replace with <RedwoodApolloProvider>

See this commit for reference.

In your project, you must replace each instance of <RedwoodProvider> with <RedwoodApolloProvider>. The following example shows the steps to update index.js:

  1. Remove <RedwoodProvider> and import <RedwoodApolloProvider> separately:
// index.js
...
import { FatalErrorBoundary } from '@redwoodjs/web'
import { RedwoodApolloProvider } from '@redwoodjs/web/apollo'
...
  1. Replace <RedwoodProvider> with <RedwoodApolloProvider> in index.js
// index.js
...
      <RedwoodApolloProvider>
        <Routes />
      </RedwoodApolloProvider>
...

Search your project for other instances of <RedwoodProvider> and follow the steps above.

Upgrade Packages

Run the following command within your App's directory:

yarn rw upgrade

Need help or having trouble upgrading? See this forum topic for manual upgrade instructions and general upgrade help.

v0.23.0

13 Jan 20:23
Compare
Choose a tag to compare

Redwood is kicking off 2021 with back-to-back releases. πŸš€ This version also adds the final piece of code for the launch of the Redwood Tutorial Pt 2 β€”Β stay tuned!

Come join us for a RedwoodJS Meetup on Thursday, January 14! πŸ‘‰ See this Forum post for details and free registration.

v0.23.0 Highlights

1. Redwood Console

Launch your very own interactive Redwood shell with yarn rw console

  • This feature is experimental and limited to DB. Docs here.

2. Fix for Redwood v0.22 web/ hoisted node_modules issue

Redwood v0.22 experienced a strange issue with node_modules being hoisted to the web/ directory. If you are upgrading from a v0.22 project and/or are having an issue with 'node_modulesbeing hoisted to yourweb/` directory, see the "Manual Code Modifications" section below for the fix.

Changed

Added

Fixes

  • Tests: move whatwg-fetch from devDep to dep #1625 by @Tobbe
  • Template: fix issue with web/ dependencies being hoisted to ./web 11780ed by @peterp

Breaking ⚠️

Nothing to see here πŸŽ‰


How to upgrade RedwoodJS to the latest v0.23

πŸ‘‰ 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.

Manual Code Modifications

1. Add Test DB Env Var

Projects running a database other than SQLite will need to include an env var to config a local DB for testing. Admittedly, this has not (yet) been well documented.

  • Add the env var TEST_DATABASE_URL to your projects .env
  • See this commit, which adds an example to the installation template's .env.defaults.

2. Downgrade "react" and "react-dom" packages in web/package.json (if applicable)

In the Redwood v0.22 release, both "react" and "react-dom" packages were upgraded to v17. However, this created a weird/strange/unexpected issue where packages were being hoisted from root to the web/ directory, resulting in seemingly random errors with Jest test failures and React hook errors.

  • The fix --> downgrade both "react" and "react-dom" in web/package.json to 16.13.1
  • See this commit for a reference

Upgrade Packages

Run the following command within your App directory:

yarn rw upgrade

Need help or having trouble upgrading? See this forum topic for manual upgrade instructions and general upgrade help.

v0.22.1

07 Jan 19:02
Compare
Choose a tag to compare

Happy New Year πŸ₯³ And what an exciting year it's going to be for Redwood. Things are kicking off with a πŸš€

πŸ‘‰ Join us for the upcoming RedwoodJS Meetup on Thursday, January 14th. We're going to be talking about plans for the upcoming v1, all the shiny new things in this release, and have a demo of a new production Redwood app.

πŸ‘‰ Help us improve the upcoming Redwood Tutorial Pt 2. In preparation for the v1 release, we're again using Tutorial-Driving-Development to guide the way. We need your help trying it out before it's published.

And now on to the amazing work included in this release thanks to the amazing, collaborative community of people listed below.

v0.22 Highlights

Azure AD Authentication Provider

That's right, Azure AD is supported out of the box thanks to @jeliasson.
- Documentation
- PR #1311

New Test Scenarios

Testing with mock data just got a whole lot easier thanks to @cannikin The new Scenarios are data that is pre-set into the database at the start of your test and removed afterward.
- Read the full explanation and how to use in #1465
- And keep a lookout for the deep-dive in the upcoming Tutorial Pt 2

Bring your own GraphQL Client Library

Redwood ships with Appollo GraphQL Client, but we recognize that's not necessarily the right choice for every project. Thanks to @peterp, you can now swap out for the tool of your choice!

Changed

  • CLI: update diagnostics to display a success message when no errors or warnings are encountered #1405 by @M0nica
  • CLI: Update Setup TailwindCSS to v2 using PostCSS v7 compatible install #1540 by @jtoar
  • CLI: Tailwind setup use fs.renameSync instead of mv #1579 by @Tobbe
  • GraphQL: Allow users to "bring your own" GraphQL Library #1498 by @peterp πŸŽ‰
  • Forms: Improve typings for errors #1510 by @Tobbe
  • UI: Only stop rendering on Private routes #1519 by @peterp
  • Webpack: Make webpack load .mjs extensions #1528 by @peterp
  • Auth: upgrade to Supabase 1.0; supabase@1.1.1 with cleaner imports #1536 #1564 by @Tobbe
    • this is a breaking change for projects currently using Supabase. See "Breaking Changes" section below.
  • MSW: Explicit target environment for MSW #1574 by @peterp
  • Docs: Contributors consolidate Core Team with Roles and update with new contributors #1541 by @thedavidprice
  • Docs: Clarify CONTRIBUTING.md #1580 by @jtoar
  • Prisma: Upgrade Prisma v2.12.1 #1604 by @thedavidprice
    • Release Notes for v2.12.0 and v2.12.1
    • Standalone Prisma Studio app for macOS
    • Prisma codemods help upgrading your codebase
    • Microsoft SQL Server now supports native database types (Preview)
    • BREAKING: Remove non-$ methods
    • BREAKING: 1-1-relations must now have an optional side
    • BREAKING: Fix how data for Json[] fields is stored
    • DEPRECATION: Rename findOne to findUnique
    • DEPRECATION: Move most types under the Prisma namespace

Added

Fixes

  • Lint: Orderliness and break avoiding lint rules, package.json flags #1381 by @Krisztiaan
  • Lint: Fix jest-dom lint errors #1575 by @peterp
  • Lint: Fixed a few eslint warnings #1582 by @Tobbe
  • Storybook: Fixes Storybook/Webpack Out of Memory Error by using relative path to config stories location #1509 by @dthyresson
  • Auth: Fix FetchConfigProvider to reprise handling no auth #1515 by @jtoar
  • Auth: Supabase getToken uses session to get access_token so that graphql calls are authenticated #1539 by @dthyresson
  • GraphQL: Fix renamed export QueryHooksProvider to GraphQLHooksProvider #1520 by @peterp
  • Router: Include queryParams in redirectTo #1526 by @dac09
  • Deploy: Fix aws_serverless config when api folder missing #1553 by @bennettrogers
  • Babel: Make glob import dir ignore .scenarios. files. #1607 by @peterp

Breaking ⚠️

For projects using Supabase Auth

  1. This release upgrades to Supabase v1, which requires a new env var SUPABASE_JWT_SECRET:

  2. Additionally, the Supabase token is now decoded whereas before it was returned undecided.

Prisma custom implementations

This version uses Prisma v2.12, which includes the following breaking changes affecting some projects with related custom implementation:

  • Remove non-$ methods
  • 1-1-relations must now have an optional side
  • Fix how data for Json[] fields is stored

If your project is affected, you'll need to review the Prisma v2.12 Release Notes.

Note: Prisma now includes a code mode command, which will help fix any issue. See the release notes for more info. General example:

cd my-app
npm install @prisma/cli @prisma/client
npx @prisma/codemods update-2.12 ./

How to upgrade RedwoodJS to the latest v0.22

πŸ‘‰ 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.

Upgrade Packages

Run the following command within your App directory:

yarn rw upgrade

To run the upgrade command, your project must be using v0.6.0 or greater. See this forum topic for manual upgrade instructions and general upgrade help.

v0.21.0

20 Nov 04:16
Compare
Choose a tag to compare

πŸ‘‰ Join us for the upcoming RedwoodJS Meetup on Thursday, December 3rd.

v0.21.0 Highlights

A huge Thank You to everyone who contributed to documentation on redwoodjs.com. 🀩

And πŸš€ to @dac09 and @Tobbe for these release highlights as well as all the fantastic individuals below who made this release possible!

Experimental support for React fast-refresh!

React fast refresh is a development-time feature that improves the "Hot reloading" functionality. The biggest benefit is that your components maintain state when you save them and they're refreshed on the screen. Learn more here about this feature.

To add support for fast-refresh, edit your redwood.toml file and add the following:

[web]
  # ... others
  experimentalFastRefresh = true

Restart you development process and you should be good to go!

Added multiproviders to firebase auth!

Now, when you logIn() or signUp() with the firebase auth client, you can optionally specify the provider: google.com, facebook.com, github.com, twitter.com, microsoft.com or apple.com. The default is google.com.

Converted @redwoodjs/forms to TypeScript!

More progress toward the Redwood v1 TS support goals!

Changed

Added

  • Auth: added multiproviders to firebase auth! #1412 @dac09 πŸŽ‰
  • TS: converted @redwoodjs/forms to TypeScript! #1431 @Tobbe πŸŽ‰
  • Dev: experimental support for React fast-refresh! #1461 #1463 #1464 @dac09 πŸŽ‰
    • see "Highlights" above for instructions
  • Ops: GH Action to create packages from PRs #1459 #1485 #1477 @Tobbe
  • Storybook: add open flag, yarn rw storbook --open will now open the browsers. #1445 @jvanbaarsen
  • Storybook: add Redwood's "node" Webpack config to Storybook's Webpack config. #1491 @jderrough
  • Server: http server tweaks. #1441 @peterp
  • Prisma: added { redwood { prismaVersion } } field to GraphQL #1425 @jvanbaarsen
  • Prisma: add ability to specify a custom path for the prisma.schema #1424 @dhausser
  • CRWA: Quick start message added to yarn create redwood-app #1388 @kevPo

Fixes


Breaking ⚠️

[Minor Change] In this release, the Apollo fetchPolicy and nextFetchPolicy were changed for Redwood Cell's beforeQuery. It's possible that cache behavior may change for custom implementations of Apollo cache configuration. However, it's unlikely the majority of Redwood projects will experience any changes after upgrading β€” tests demonstrated backwards compatibility. (See #1428) Also relevant are updates to Scaffold Generators no longer requiring refetchQuery calls. Note: existing refetchQuery configuration is backwards compatible. (See #1497)


How to upgrade RedwoodJS to v0.21.0

πŸ‘‰ 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.

Manual Code Modifications

The following code modifications are recommended but not required.

  1. [Recommended] Rename api/prisma to api/db
    This change is not required. New installations of Redwood now use the directory api/db instead of api/prisma. If you change the directory name in your project, you must also add a schemaPath config to redwood.toml. See #116 for code change example.
// redwood.toml
...
[api]
  port = 8911
  schemaPath = "./api/db/schema.prisma"
...
  1. [Recommended] Remove schema.prisma "rhel-openssl-1.0.x" binaryTarget
    Prisma v2.11.0 (included in this release) fixes the requirement for adding "rhel-openssl-1.0.x". Removing this binaryTarget may also reduce the size of the built API. See #115 for code change example.
// api/db/schema.prisma
...
generator client {
  provider      = "prisma-client-js"
  binaryTargets = "native"
}
...

Upgrade Packages

Run the following command within your App directory:

yarn rw upgrade

To run the upgrade command, your project must be using v0.6.0 or greater. See this forum topic for manual upgrade instructions and general upgrade help.

v0.20.0

23 Oct 04:07
Compare
Choose a tag to compare

This is definitely a mega release! πŸ“£ Just scroll through all the work below, contributed by so many individuals. Hats off to the active, growing Redwood community! Version v0.20.0 is amazing because of you. πŸš€

⚠️ This version contains breaking changes and manual code modifications. See the "Breaking" and "Manual Code Modifications" sections below for more info and upgrade instructions.

v0.20.0 Highlights

If this version has a theme, it's performance. Most of the highlights below are under-the-hood improvements and hard-earned fixes.

  • Improved Router Performance #1284
  • Improved GraphQL Cache Handling (Apollo) #1250 #1387 #1342
  • Improved TypeScript Support for Web #1232 #1241 #1247 #1291
  • Added Setup Command for one-step install and config and install #1154 #1234 #1269 #1282 #1294
    • after upgrading, run yarn redwood setup --help to see current commands
  • Fixed Jest Test Command #1376
  • Fixed Storybook Command on Windows #1324

Additionally, a huge Thank You to everyone who contributed to documentation on redwoodjs.com. 🀩

Changed

Added

Fixed


Breaking ⚠️

Appollo Client v3 Cache Behavior for GraphQL Mutations

Prior to this version, Redwood Cells used Apollo's cache and network fetch policy. This has been removed in favor of the default policy (see #1250). This change, along with the new Apollo v3 behavior, changes the behavior of mutations β€” state changes will often not render without a page reload.

From the ApolloDocs: If a mutation modifies multiple entities, or if it creates or deletes entities, the Apollo Client cache is not automatically updated to reflect the result of the mutation.

tl;dr: if things with your App's CRUD rendering seem broken after upgrading, you'll need to update the Mutations in your components to use Apollo's new features like refetchQueries:

Prisma Query Engine Deploy Error

Prisma v2.9.0 now requires setting an additional binaryTarget in schema.prisma. Otherwise, the Prisma query engine will not build correctly, resulting in an error affecting the production deploy.

  • See the "Manual Code Modifications" section below for required changes

How to upgrade RedwoodJS to v0.20.0

πŸ‘‰ 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.

Manual Code Modifications

  1. Prisma v2.9 requires an additional binaryTarget for production deploys to build correctly:
    • add the additional binaryTarget "rhel-openssl-1.0.x" to api/prisma/schema.prisma
    • see this example
  2. VS Code GraphQL extension required config:
  3. Update Scaffold generated Component files (or, in some cases, your own custom mutation implementations)
    • Redwood Scaffold generated CRUD needs to be updated in order to work with the new Apollo v3 Cache. There are four generated component files that need to be updated for each generated Scaffold. The specific names will be different based on your schema models. For the Tutorial post model as an example, the files to update are the components /Post/Post.js, /Posts/Posts.js, /NewPost/NewPost.js, and /EditPostCell/EditPostCell.js
    • Note: One way to handle this is to re-run Scaffold Generator with the --force option. 🚨 It's the fastest. But this will overwrite any customization.
    • Edit [Model].js, [Model]s.js, and New[Model].js Components (e.g. Post.js, Posts.js, and NewPost.js):
      • See the three files in this commit for reference. Note: the reference file are Name.js.template, Names.js.template, and NewName.js.template
      • For each file, add import { QUERY } from 'src/components/${pluralPascalName}Cell'
      • For the respective DELETE and CREATE mutation's onCompleted property, add refetchQueries: [{ query: QUERY }], awaitRefetchQueries: true,
      • For the [Model]s.js file, remove the current refetchQueries property from the onDeleteClick conditional
    • Edit the Edit[Model]Cell.js Component (e.g. EditPostCell.js):
      • See theEditNameCell.js.template file in this commit for reference
      • The UPDATE mutation requires passing all properties, not just id in the same manner as the QUERY
      • Add all QUERY properties (e.g. id, title, body, createdAt) to the UPDATE_[Model]_MUTATION

Upgrading is worth it! And, more importantly, there's a vibrant community for help (and encouragement) if you need it.

  • Have questions or need help upgrading? Check out this Forum Topic.
  • We're evaluating how to handle the Redwood Client GraphQL. Check out this Forum Topic to learn more and share your experience and suggestions.

Upgrade Packages

Run the following command within your App directory:

yarn rw upgrade

*To run the upgrade command, your project must be using v0.6.0 or greater. [See this forum topic for manual upgrade instructions and general upgrade help](https://community.redwoodjs.com/t/how-to-upgrade-redwoodjs-app-and-...

Read more

v0.19.3

10 Oct 01:33
Compare
Choose a tag to compare

Patch release fixing VS Code extension on Windows:

  • fixes several bugs related to path and file-uri handling in Windows #1318
  • also fixes a related issue where we were only looking for ".js" files (it should be "js, jsx, ts, tsx") #1318