Skip to content

Releases: redwoodjs/redwood

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

v0.19.2

05 Oct 01:23
Compare
Choose a tag to compare

This is a patch release to get VS Code extension working:

  • Small Language Server fixes (to get VSCode extension working) #1267 by @aldonline
    • Suppress most error responses from the Language Server
    • Improve initialization order of LSP components
    • Tolerate certain missing files and folders

v0.19.1

21 Sep 16:06
Compare
Choose a tag to compare

This is a quick bug fixing release:

  • Export some additional Apollo methods: useClient, useSubscription and useLazyQuery. #1185 @KrisCoulson
  • Incorrect import of default merge versus named export merge. #1188 @jeliasson
  • Make yarn rw generate util tailwind use the correct pinned version of postcss-loader and autoprefixer. #1189 @dthyresson

v0.19.0

18 Sep 09:01
Compare
Choose a tag to compare

v0.19.0 Highlights

  • We've upgraded to Apollo Client v3!
  • We've dropped support for IE 11 and remove some things in the bundle that are no longer required. This gave us a ~80KB reduction in bundle size.

Changed

Added

Fixed

Breaking ⚠️

  • We've dropped support for IE 11, which might be a concern for some users, if you absolutely want to support IE 11 please reach out to @peterp and he'll write up some instructions.

  • We've upgraded Apollo Client to v3.1.4, if you modified the cache when a mutation ran then you might experience some issues, please check the migration notes for Apollo Client: https://www.apollographql.com/docs/react/migrating/apollo-client-3-migration/

How to upgrade RedwoodJS to v0.19.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. In the last few releases, we let you know that db should not be passed createGraphQLHandler. We've now removed that. You should instead disconnect from Prisma in onException in the file api/src/functions/graphql.js:
  2. Drop support for IE 11 by updating Browserslist targets in web/package.json:
  3. Improve VS Code debugging by adding .vscode/launch.json:

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.18.0

09 Sep 16:53
Compare
Choose a tag to compare

v0.18.0 Highlights

  • Supabase Authentication Provider 🔐
  • More Typescript and Conventions Support ⚡️
    • Custom Babel plugin mapping imports made against directories to files matching the directory name. Works across a project (both web/ and api/) #1102
    • Router type definitions #1110

Changed

  • Generators: quote paths and keywords with <tt> instead of quotation marks in JSX template generator #1094 by turadg

Added

  • TS: Create Directory Named Import plugin #1102 by peterp  🎉
  • TS: Add typedefs to router #1110 by peterp 🎉
  • Auth: Add supabase auth provider #1033 by amorriscode 🎉
  • Auth: Adds signup() to Auth to default UI to a signup tab/form when available #1057 by dthyresson

Fixed

Breaking ⚠️

nothing to see here 🙈


How to upgrade RedwoodJS to v0.18.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.

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.17.2 - Fix deploy generators

03 Sep 16:41
Compare
Choose a tag to compare

v0.17.1 - Prisma update v2.6.1

03 Sep 13:38
Compare
Choose a tag to compare

We're releasing a small patch update that contains Prisma v2.6.1: https://github.com/prisma/prisma/releases/tag/2.6.1

v0.17.0

03 Sep 01:41
Compare
Choose a tag to compare

So. Many. Contributors. 🤩 (Over 100 individuals!) All of you are making Redwood better every week. And this version is no exception. Hats off to the amazing, growing community! Version v0.17.0 wouldn't have been the same without you.

This version contains breaking changes. See the "Breaking" section below for more info and upgrade instruction.

v0.17.0 Highlights

  • ✨New✨Deploy to AWS Serverless 🚀

    • This is step 1 of 2, initialization. Consider it preview. If you want to try it out, you'll need to have the serverless framework installed
    • Then generate the deployment via yarn rw generate deploy aws_serverless
    • You can deploy manually with these commands, but we're busy working on a deployment command in this issue.
    • Related section in the Deploy Doc
  • TypeScript support: write and reference generated types 🔥

    • See the new TypeScript Doc
    • Upgrading? See "How to Upgrade ..." for required manual code changes.
  • New generator for TailwindCSS Setup 🎩

Changed

  • Auth: Auth RBAC, hasRole accepts a single role or an array of roles #1016 by dthyresson
  • Auth: Bump firebase-admin from 8.13.0 to 9.1.1 #1027
  • Docs: Add usePageLoadingContext demo video to Router documentation. #792 by jtoar
  • Router: Memoize routes and named routes #956 by jtoar
  • Forms: react-hook-form upgraded to latest v6.0 #964 by Ako92
    • 🚨possible breaking changes
  • Forms: removes @redwoodjs/forms from @redwoodjs/web #1048 by alvincrespo
    • 🚨possible breaking changes
  • Generator: add Scaffold generator CLI warning when model contains @relation #984
  • TS: upgrade to typescript v4.02 #1018
  • Prisma: upgrade to Prisma 2.6.0 #1004 #10

Added

  • Deploy: Add deploy command for api with aws_serverless provider #1012 by hemildesai
  • Deploy: Add aws_serverless provider for generate deploy command #976 by hemildesai
  • TS: Add a way to write and reference generated types #960 🎉
  • Config: add tailwind generator #828 #1025 #1026 by jtoar 🎉
  • Project: Add documentation links to outline #935 by forresthayes
  • Project: Add env variable diagnostics (fix #983 #971) #987 by aldonline
  • Docs: add Contributors to README using All-Contributors #875
  • CLI: Add option to skip yarn install to create-redwood-app #966 by forresthayes
    • example: yarn create redwood-app ./my-project --no-yarn-install
  • Forms: support passing coercion functions to form fields #973 by forresthayes

Fixed

  • Config: fix webpack merge TypeError #1003 by jtoar

Breaking ⚠️

React Hook Forms v6

This release upgrades to v6 of React Hook Forms, which has breaking changes. The Redwood Forms package is not affected. However, if your project has custom implementations of React Hook Forms, you may need to follow the upgrade instructions in the React Hook Forms v6 Release Notes.

Redwood Forms as a standalone package

We've removed @redwoodjs/forms from @redwoodjs/web to reduce the web bundle size for projects not using forms. If you are using forms, then complete these two steps:

  1. Add @redwoodjs/forms as a dependency in <app>/web/package.json.
    • yarn workspace web add @redwoodjs/forms
  2. Change any "Forms" related imports from @redwoodjs/web to be from @redwoodjs/forms
    • Search your project for @redwoodjs/web
    • Check for instances of imports like import { Form .. }
    • For all cases importing Form related elements from @redwoodjs/web, change web to forms.
    • Example: change import { Form, FormError } from '@redwoodjs/web' to import { Form, FormError } from '@redwoodjs/forms'

How to upgrade Redwood to v0.17.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. New TypeScript support requires adding .redwood to .gitignore file.
  2. Add @redwoodjs/forms as a standalone package in web/package.json.
    • See "Breaking" section above for instructions.
  3. Prisma deprecated syntax for the disconnect method from disconnect() to $disconnect()
    • update you project accordingly for specific use
    • for updates to the existing api/prisma/seeds.js file, see required code modification here

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.16.0

19 Aug 08:20
Compare
Choose a tag to compare

v0.16.0 Highlights

Deploy to Vercel! 🎉

Check out our Example Blog live on Vercel.

Redwood is designed for serverless architecture deployment, and now there are two officially supported deploy targets:

  1. Netlify
  2. Vercel

If you would like to try it out, read our deployment documentation.

A huge thank to the @styfle and the team at Vercel, and @thedavidprice and @cannikin for working on this feature!

Role based access control (RBAC)

Hot off @dthyresson's keystrokes comes RBAC to Redwood! We've enhanced the great semantics of our authentication implementation with a few small additions, first off on the API side, tell Redwood which role your currentUser has:

// src/lib/auth.js

export const getCurrentUser = (decoded) => {
  // get user from the database, token, etc.
  const user = await db.user.findOne({ where: { sub: sub.decoded } })
  return {
    ...user,
+    roles: ['admin'],
  }
}

- export const requireAuth = () => {
+ export const requireAuth = ({ roles } = { roles: [] }) => {

  if (!context.currentUser) {
    throw new AuthenticationError("You are not authenticated")
  }
+  // We now check that the current user's role matches!
+  if (!roles.some((role) => context.currentUser.roles.includes(role))) {
+   throw new AuthenticationError("You are not authenticated")
+  }
}

And invoke it in your services:

export const blogPosts = () => {
-   requireAuth()
+  requireAuth({ roles: ['admin'] })
// fetch blogPosts...
}

On the web side we've introduced a new hasRole hook:

const { isAuthenticated, hasRole } = useAuth()

{hasRole('admin') && (
  <Link to={routes.admin()}>Admin</Link>
)}

And a way to protect routes by role:

<Router>
  <Private unauthenticated="forbidden" role="admin">
    <Route path="/settings" page={SettingsPage} name="settings" />
    <Route path="/admin" page={AdminPage} name="sites" />
  </Private>
  <Route path="/forbidden" page={ForbiddenPage} name="forbidden" />
</Router>

Check out the auth documentation for more information

Changed

Added

  • Added roles to @redwoodjs/auth, @dthyresson #939
  • A way to generate pages with route parameters, doing yarn rw g page post {id} will now add the parameter to the route's path and page component. @Tobbe #882
  • Added the webpack-retry-chunks plugin, @dac09 #929
  • Add descriptions to yarn rw test command, @forresthayes #950

Fixed

  • Fixed a bug in the GraphQLClientConfig of the GraphQLAuthProvider, @hemildesai #931
  • Fixed intermittent connection issues between webpack and dev-server proxy, @hemildesai #940
  • Make data migration call process.exit(1) when failing, @MontelAle #948
  • Remove the warning about production usage and Prisma, @amorriscode #958
  • Add a proper way to remove history listeners @peterp #959

Breaking ⚠️

ImportAll.macro removed

We deprecated importAll.macro in v0.13.0, and now we've finally removed it. You'll need to change your api/src/functions/graphql.js file to the following:

import {
  createGraphQLHandler,
  makeMergedSchema,
  makeServices,
} from '@redwoodjs/api'
-import importAll from '@redwoodjs/api/importAll.macro'
-const schemas = importAll('api', 'graphql')
-const services = importAll('api', 'services')
+import schemas from 'src/graphql/**/*.{js,ts}'
+import services from 'src/services/**/*.{js,ts}'

import { db } from 'src/lib/db'

export const handler = createGraphQLHandler({
  schema: makeMergedSchema({
    schemas,
    services: makeServices({ services }),
  }),
  db,
})

How to upgrade RedwoodJS to v0.16.0

  1. Check out the breaking changes to importAll.macro.
  2. Our Prisma Dynamic Plugin Provider is no longer required:

Remove it from package.json

  "devDependencies": {
-  "netlify-plugin-prisma-provider": "^0.3.0"	
  },

Remove it from netlify.toml

- [[plugins]]	
- package = 'netlify-plugin-prisma-provider'	
-  [plugins.inputs]	
-  path = 'api/prisma/schema.prisma'

You must run yarn rw db save to create a new migration.

If you're stuck please ask for help on our community, or read the deployment docs

👉 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.15.3

31 Jul 16:42
Compare
Choose a tag to compare

This fixes an issues with Storybook, Jest and mock data. Also adds Auth decoder backwards compatibility.

  • fix: Make auth decoder backwards compatible with 0.12 #898 @dac09
  • Change build:watch command to only build js aeee9a0
  • Upgrade msw d13bf6b
  • Remove symlink for Storybook public folder. ebbff4c
  • StorybookLoader != StorybookProvider. e598a51
  • Remove dynamic import b2b3d19