npm @redwoodjs/core 0.50.0
v0.50.0

latest releases: 8.0.0-canary.563, 8.0.0-canary.562, 8.0.0-canary.561...
2 years ago

⚠️ This release removes prior Deprecations and includes Code Modifications

Changelog

Unique contributors: 19

PRs merged: 76

Features

  • allow Redirect to use navigate options.replace #4704 by @odjhey
  • Use GraphQL Yoga #4712 by @ardatan
  • Send a 'ready' message to parent process if api server was spawned #4744 by @cannikin
  • Adds baremetal deploy strategy #4750 by @cannikin
  • Add yarn 3 to create redwood app template #4761 by @jtoar
  • Auth Provider: Update Nhost to V2 #4770 by @nunopato
    • See Code Modification section below
  • Add flightcontrol deploy command #4788 by @beerose
  • Add Layer0 deploy command to CLI and docs #4886 by @tristanlee85
  • Cleanup deprecated features #4856 by @callingmedic911
    • DEPRECATION: see section below
  • Sets Secure cookie attribute in config template to be dependent on NODE_ENV #4722 by @cannikin
    • BREAKING: see sections below
  • Pretty print query in DevFatalErrorPage for better DX and readability #4696 by @dthyresson
    • BREAKING: see sections below
  • Update private routes and Set to use roles vs role #4681 by @dthyresson
    • BREAKING: see sections below
  • netlify build with rw record #4618 by @aguscha333
    • RW Record is an experimental package. This release requires a Code Modification to deploy on Netlify

Fixed

Chore

Package Dependencies

View all Dependency Version Upgrades

Removed Deprecations and Breaking Changes

This release removes prior deprecations and has breaking changes.

Removed binary rw-api-server; replaced with rw-server [side]

This bin is used for running the Fastify server, which is called when you run yarn rw serve.

Projects should use yarn rw-server api. Also takes web positional (or both).

dbAuth: removed COOKIE_META cookies

PR #4722 dbAuth cookie config has moved to api/src/function/auth.js for better customization. See:

Refer to Code Modification below to update.

DevFatalErrorPage now pretty prints query

PR #4696 updates src/components/FatalErrorPage.tsx

Refer to Code Modification below to update.

Private routes and Set now use roles (instead of role)

PR #4681 Changes the use of Router role to be replaced by roles plural.

Projects using role for RBAC will need to make a Code Modification

Code Modifications

Update DevFatalErrorPage

We've made a small change to FatalErrorPage make sure your bundle sizes are as small as possible!
If you only have the default FatalErrorPage, you can run our automatic codemod to pull in the latest changes.

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

If you've customised your error page, just a small tweak is needed:

// src/components/FatalErrorPage.tsx
if (process.env.NODE_ENV === 'development') {
-  RedwoodDevFatalErrorPage = require('@redwoodjs/web').DevFatalErrorPage
+  RedwoodDevFatalErrorPage = require('@redwoodjs/web/dist/components/DevFatalErrorPage').DevFatalErrorPage
}

Update roles for role in Private routes and Sets

Projects using roles and RBAC will need to change any prop in Routes.ts|js named role to roles. The value can be a string or array of strings, which is consistent with previous behavior.

Example:

- <Private unauthenicated="home" role="admin">
+ <Private unauthenicated="home" roles="admin">

Netlify Deploy: Update .toml

PR #4782 improves prerender performance on Jamstack deploy providers. For most cases, the changes are automatic.

It is recommended that projects deploying to Netlify should update netlify.toml:

[[redirects]]
   from = "/*"
-  to = "/index.html"
+  to = "/200.html"
   status = 200
 `

Nhost Auth: Upgrade to v2

PR #4770 updates Nhost Auth provider to use Nhost v2.

Existing projects using Nhost need to use the new Nhost SDK. Make the following changes to Auth.ts|js:

- import { createClient } from 'nhost-js-sdk'
+ import { NhostClient } from '@nhost/nhost-js'

- const nhostClient = createClient({
-  baseUrl: 'url'
+ const nhostClient = new NhostClient({
+  backendUrl: 'url' 
})

dbAuth: Set Secure Cookie Attribute in Config Template

If you're using dbAuth with the new cookie config that we added to api/src/functions/auth.js in the last release, you'll need to make a change if you use Safari as your dev browser, or if you access your dev server at a host other than localhost (you may have noticed that you can't stay logged in).

Change the Secure config to this:

cookie: {
  HttpOnly: true,
  Path: '/',
  SameSite: 'Strict',
- Secure: true,
+ Secure: process.env.NODE_ENV !== 'development' ? true : false,
},

This will set the cookie to not secure when in a development environment, but otherwise true everywhere else (like in production). Chrome has an exception that you can set a secure cookie over HTTP, but only if the domain is localhost. Safari does not have this exception!

Deploy Redwood Record on Netlify (experimental)

See #4618

Redwood Record datamodel file
In order to fix the Netlify deploy when using Redwood Record the datamodel.json generated by running yarn rw record init was moved and will now be tracked under git.

How to Update
If you are using the RedwoodRecord lib the only thing you have to do is run yarn rw record init again and you'll be good to go.

Don't miss a new core release

NewReleases is sending notifications on new releases.