Releases: redwoodjs/redwood
v0.19.3
v0.19.2
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
This is a quick bug fixing release:
- Export some additional Apollo methods:
useClient
,useSubscription
anduseLazyQuery
. #1185 @KrisCoulson - Incorrect import of default
merge
versus named exportmerge
. #1188 @jeliasson - Make
yarn rw generate util tailwind
use the correct pinned version of postcss-loader and autoprefixer. #1189 @dthyresson
v0.19.0
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
- Upgraded to Apollo Client v3 #1005 @thedavidprice
- Alias
diagnostics
tocheck
#1112 @forresthayes - Reduce bundle size by ~80KB #1132 @peterp
- The CLI was getting a slow, we did a bit of an audit and managed to improve the speed significantly. #1173 @peterp
Added
- An updated contributors section #1151 @thedavidprice
Fixed
- Allow CORS to be passed to the GraphQL handler #1175 @peterp
- When trying to destroy pages the propParam was not defined. #1162 @jwkratz
- Add the required prisma binaries when generating an aws deployment target #1144 @hemildesai
- Fix the generated cell test template #1142 @thedavidprice
- In Storybook import
index.[css,scss]
file #1134 @RyannosaurusRex - Put migration name in quotes #1123 @amorriscode
- Fix stats command #1126 @peterp
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
- In the last few releases, we let you know that
db
should not be passedcreateGraphQLHandler
. We've now removed that. You should instead disconnect from Prisma inonException
in the fileapi/src/functions/graphql.js
:- Add
onException
. See Lines 16-19 in this reference example here.
- Add
- Drop support for IE 11 by updating Browserslist targets in
web/package.json
:- Update targets on Lines 5-8 in this reference example
- Improve VS Code debugging by adding
.vscode/launch.json
:- Create a new file and add the code in this reference example
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
v0.18.0 Highlights
- Supabase Authentication Provider 🔐
- More Typescript and Conventions Support ⚡️
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
v0.17.2
v0.17.1 - Prisma update v2.6.1
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
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.
- Check out all the current contributors here
- Did you see the new Redwood v1.0 Roadmap?
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 🎩
yarn rw generate util tailwind
- See related Doc
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
- v2.6.0 Release Notes
- v2.5.1 Release Notes
- v2.5.0 Release Notes
- Middlewares
- removing duplicates with
distinct
- aggregations
- many more preview features; see release notes
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
- example:
- Forms: support passing coercion functions to form fields #973 by forresthayes
Fixed
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:
- Add
@redwoodjs/forms
as a dependency in<app>/web/package.json
.yarn workspace web add @redwoodjs/forms
- 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
, changeweb
toforms
. - Example: change
import { Form, FormError } from '@redwoodjs/web'
toimport { Form, FormError } from '@redwoodjs/forms'
- Search your project for
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
- New TypeScript support requires adding
.redwood
to.gitignore
file. - Add
@redwoodjs/forms
as a standalone package inweb/package.json
.- See "Breaking" section above for instructions.
- 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
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:
- Netlify
- 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
- Prisma upgraded to v2.4.0, @peterp #937
- We switched our Date, Time, and JSON scalar types to graphQL scalar library, @hemildesai #918
- Add stub types to @redwoodjs/forms, @burnsy #922
- Disable SDL parameter type checking, @aldonline #944
- Warn instead of error on prettier linting errors, @turadg #952
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
- Check out the breaking changes to
importAll.macro
. - 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
This fixes an issues with Storybook, Jest and mock data. Also adds Auth decoder backwards compatibility.