Redwood v1.0.0-rc.6 is now available 🚀

:clapper: Call for Redwood product and startup demos
Redwood 1.0.0 will arrive within the month. We’re planning the first RedwoodJS Startup Showcase, full of demos and panels, highlighting the amazing people and projects using Redwood. Want to demo? Let’s talk! Just take a look at this forum post and complete the submission form.

:microscope:Help QA the new Redwood Tutorials
Both Tutorials I and II have been re-written for v1. We need your help making sure that every “i” is dotted and “t” is crossed. If you’re interested in helping, check out the details here.

It’s been almost 3 months and exactly 14 releases since v1.0.0-rc.4 was published — the Redwood Core Team and community has been very busy. We’re excited to announce this will be the penultimate release candidate! That’s right, you can expect one more RC followed by the final 1.0.0 within a month.

Get.

Excited.

We’ll be kicking off the 1.0.0 publishing with an entire week of events and announcements. Stay tuned in the weeks to come. But until then, enjoy all the amazing updates jam-packed into v1-rc.6.

This release is equivalent to Redwood v0.49.1

tl;dr:

  • :yarn: Yarn 3 (Preview)
  • :rocket: Directly Deploy to AWS Lambdas and Cloudfront using Serverless Framework
  • :bug:New Runtime Error Page

v1.0.0-rc.6 Highlights :tada:

:yarn: Yarn 3 (Preview)

This release adds preview support for using Yarn v3 with Redwood projects (See #4444). Why would you want to bump from Yarn v1 to v3? Because it’s amazingly superior. And it’s SuperEasy™ to upgrade and try it out. Just run the codemod:

npx @redwoodjs/codemods@canary upgrade-yarn

Let us know how it goes!

Known Gotchas
Upgrading to Yarn 3 requires corepack. If you’re on a Node.js version less than v14.19, you need to install it manually via npm i -g corepack

:rocket: Deploy to AWS using Serverless Framework

Thanks to @virtuoushub @Irev-Dev @dac09 and @cannikin, you can now deploy your project directly to AWS Lambdas and Cloudfront using the Serverless Framework. (See #3755)

Ready to try it out? Everything you need to know is here:

tl;dr

yarn rw setup deploy serverless

:bug:New Runtime Error Page

Thanks to @orta and @dthyresson, Redwood devs have a shiny new runtime error page. See #4167 for more information.

  • Code Mod required: see “Code Modifications” section below

Changelog

Unique contributors: see Changelogs listed below
PRs merged: 264 :exploding_head:

See links for the individual minor version Changelogs included in this RC.

Breaking :warning:

Webhook verifiers

Redwood’s Webhook verifiers now support timestamp diff checks (see #4608)

See “Code Modifications” for upgrade instructions. This is a required modification for projects using the the timestamp webhook verifier option.

Logging: Pretty Print Option Removed

Version 0.41.0 removed the dependency from the logger on Pino’s “pretty printing” package pino-pretty. Instead, a LogFormatter is used to make the output easy to read.

If you have your logger or your GraphQL logger configured to prettyPrint you will need to remove this option, as it is no longer available.

How to Upgrade

Code Modifications

These upgrade instructions were also included with the semantic version 0.40 through 0.49 Release Notes.

1. Jest Config Improvement (Recommended)

This code modification is recommended but not required unless necessary for use with third-party tools.

PR #4096 improves Jest config (switches to presets from imports) to support third-party tools like Wallaby.

To automatically update to the new config, simply run this code modification in your Redwood project:

npx @redwoodjs/codemods@latest update-jest-config

This will make the following changes:

  1. web/jest.config.js updated to match this template
  2. api/jest.config.js update to match this template
  3. ./jest.config.js added to match this template

Note: The automated code modification will attempt to keep any custom changes to the default configurations. If applicable, do confirm customizations are implemented and working correctly after running the code mod.

2. New Runtime Error Page (Recommended)

This code modification is recommended but not required.

PR #4167 adds a shiny :sparkles: new Runtime Error Page. New projects ship with the updated code. To use the new Error Page with existing projects, the following code modification is required.

Option 1: Automated Code Mod
To automatically apply the required code mods, run this command:

npx @redwoodjs/codemods@canary update-dev-fatal-error-page

Option 2: Manual Code Mod
Only make these changes if you did not use the automated code mod above.

Update the file web/src/pages/FatalErrorPage/FatalErrorPage.js|tsx:

  1. Add a variable and condition for RedwoodDevFatalErrorPage use in development:
+ // Ensures that production builds do not include the error page
+ let RedwoodDevFatalErrorPage = undefined
+ if (process.env.NODE_ENV === 'development') {
+   RedwoodDevFatalErrorPage =
+     require('@redwoodjs/web/dist/components/DevFatalErrorPage').DevFatalErrorPage
+ }
  1. Update export with a condition for production and development:
- export default () => (
+ export default RedwoodDevFatalErrorPage ||
+ (() => (

3. Webhook timestamp verifiers

This is a required modification for projects using the the timestamp webhook verifier option.

PR #4608 introduces a new option called eventTimestamp. Together with the existing tolerance option it’s possible to add timestamp diff checks to all verifiers. But do note that all webhook events won’t have the needed timestamp info to implement. That’s up to the vendor you’re integrating with to include or not include. Currently we know Svix, Clerk and Stripe have the required info.

:rotating_light:This PR renames the timestamp webhook verifier option to currentTimestampOverride.

To automatically update your code, simply run this code modification in your Redwood project:

npx @redwoodjs/codemods@canary rename-verifier-timestamp

Manual Upgrade Step
Only necessary if you do not use the automated code mod above.

  • For any webhook verifier you have a customized timestamp value, you’ll need to rename the timestamp object key to currentTimestampOverride. A simple find and replace should do the trick!

4. dbAuth Cookie Configuration

If you are using dbAuth, we’ve moved the configuration for the dbAuth cookie alongside the rest of the configuration in api/src/functions/auth.js. The original configuration, which was internal to Redwood itself, is now deprecated. If you do not add this cookie config to auth.js your app will continue to work for now, but will show a deprecation notice in your api logs. The old behavior will be removed in a future version of Redwood.

To preserve the existing cookie settings, add the cookie property to the options sent into new DbAuthHandler():

const authHandler = new DbAuthHandler(event, context, {
  db: db,
  authModelAccessor: 'user',
  authFields: {
    id: 'id',
    username: 'email',
    hashedPassword: 'hashedPassword',
    salt: 'salt',
    resetToken: 'resetToken',
    resetTokenExpiresAt: 'resetTokenExpiresAt',
  },
  forgotPassword: forgotPasswordOptions,
  login: loginOptions,
  resetPassword: resetPasswordOptions,
  signup: signupOptions,

+ cookie: {
+  HttpOnly: true,
+  Path: '/',
+  SameSite: 'Strict',
+  Secure: true,
+  // Domain: 'example.com',
+  },

})

The cookie Domain is now set here instead of in an ENV var. When do you need to set Domain? If your web side and api side are served from different domains (such as www.example.com and api.example.com). To read more about Domain config: Using HTTP cookies - HTTP | MDN

Upgrade Packages from v1.0.0-rc.4 to v1.0.0-rc.6

Run the following command within your App’s directory:

yarn redwood upgrade --tag rc

The --tag rc option targets the most recent “release candidate” published to NPM

:white_check_mark: Don’t forget to git commit your updated yarn.lock file

Upgrading from an earlier version?

Please follow the “how to upgrade” sections for each newer version here :point_right: Releases · redwoodjs/redwood · GitHub, as there may be manual code mods needed for each version.

Upgrading to a version that is not the latest?

The command yarn rw upgrade will always upgrade to the latest (i.e. most recent) Redwood version. If you need to upgrade incrementally to an earlier, specific release, use the --tag option. For example, if you need to upgrade from v0.44.0 to v0.45.0, run the following command:

yarn redwood upgrade --tag 0.45.0

Need help or having trouble upgrading packages?

See this forum topic for manual upgrade instructions and general upgrade help.


Redwood Releases on GitHub

You can see all Redwood release notes and version history on GitHub

4 Likes