v0.36 Highlights π
This is a minor version release with major additions and improvements to Redwood. A massive "Thank you!" goes out to every individual that contributed code, updated docs, submitted issues, and participated in the amazing community. Well done, Team Redwood!! π
β οΈ This release has breaking changes. Please follow the Code modifications section to upgrade your app
πΊ Watch the recorded Livestream : Highlights discussion + Upgrade walkthrough
π Performance, Stability, and SEO
With version v0.36, you'll experience much snappier performance and overall improved stability. There's almost too many improvements and upgrades to list here:
- A overhauled Redwood Dev Server when running
yarn redwood dev
- and an improved API two-step build including ESBuild
- Webpack v5 and Webpack-dev-server v4
- Jest v27
- Storybook v6.3 (supporting Cypress E2E tests) using Webpack v5
Built-in Page SEO Title and Description
PR #3026 adds Helmet configuration by default on generated Pages, providing better SEO out of the box.
- See the updated SEO Doc
π§ͺ Built-in Testing for Functions and Webhooks
Testing serverless functions and webhooks can be difficult and time-consuming because you have to construct the event and context information that the function handler needs. As of this version, Redwood includes api testing utilities to make this a breeze!
π Redwood Auth updates + new Clerk provider
There's a new loginHandler()
for dbAuth. Magic.link and Firebase updates. And added Supabase providers for Twitch and SMS one-time-passwords with Twilio.
And Redwood Auth now has a new provider, supporting Clerk authentication:
π©βπ¬ Contributing to Redwood made (even) easier
In our never ending quest ππ€Ί for simple Redwood Framework local development, there's a new command and workflow via rwfw project:sync
. See the updated Contributing Docs.
And thanks to the fine folks from Gitpod, every Redwood PR can now be reviewed via a Cloud-based dev environment. π€― Simply click on the Gitpod "details" link in any PR. Or just use the syntax https://gitpod.io/#<link to PR or branch>
. See #3150 for more details.
πΊοΈ Navigation
navigate()
now gives you greater control over just how the browserβs history is updated. By passing in { replace: true }
as a second parameter to navigate()
, Redwood will use replaceState
instead of pushState
behind the scenes. There is also a new back()
function exported from the router that does exactly what you think it does π Related PRs #2212 and #3055
βοΈ Coming in the next version v0.37: migrating the GraphQL Server to Envelop+Helix
Since v0.35, Redwood projects have been able to run a preview version of Envelop+Helix as the GraphQL Server. Now that Envelop has reached GA, and after a lot of amazing progress and feedback, we are excited to annouce that Redwood will fully move to Envelop+Helix in v0.37 (which will replace Apollo Server β Redwood will still continue using Apollo Client). As always, we'll do our best to make the switch as painless and clear as possible.
You can learn more about this switch and all the Envelop+Helix has in store via the following Forum Post. Additionally, we encourage you to try out the current preview of Envelop+Helix by following the included instructions:
Changelog
No. of unique contributors: 24
No. of PRs: 85
Added
- @redwoodjs/history #2212 by @Tobbe
- Adds a hasRole() and isAuthenticated() to determine the role membership or if the request is authenticated #3006 by @dthyresson
- Better SEO by default on every pages #3026 by @simoncrypta
- GraphQL useMutation options #3041 by @cjreimer
- Add Clerk as an auth provider #3080 by @zackdotcomputer
- Adds loginHandler to dbAuth for custom login checks #3111 by @cannikin
- Typing services on makeMergedSchema #3129 by @dthyresson
- Supabase to support Twitch auth #3134 by @dthyresson
- Expose cache config for
RedwoodApolloProvider
#3145 by @zackdotcomputer - Configure cloud based development for contributors #3150 by @mikenikles
- Support Supabase phone and OTP authentication #3177 by @dthyresson
- Adds ability to test api functions #3207 by @dac09
- add e2e cli commands #3250 by @thedavidprice
Changed
- Configure dedicated log level for GraphQL logger #3232 by @dthyresson
- GraphQL logging default has been changed
- Improved useMatch to support search parameters #2683 by @LBrian
- See the updated Router Docs
- Allow custom functions to serve binary data #3219 by @corbt
- Router.tsx: Test Route matching in Sets #2591 by @Tobbe
- Restart development servers when
redwood.toml
is modified #2800 by @aggmoulik - Firebase auth options #2824 by @ryanmdoyle
- Purged cached Magic.link token at logout #2862 by @LBrian
- Webpack v5; Use PostCSS v8 with Tailwind Setup #2884 by @thedavidprice
- upgrade to Jest v27 #2893 by @thedavidprice
- Add pretranspile + programatic build to API side. #2938 by @peterp
- Upgrade RHF to v7.11.0 #3043 by @LBrian
- GraphQL Handler improvements for api imports and log options #3054 by @dthyresson
- Docs Update - Eslint Config README w/example override #3029 by @webstackdev
- Adds async/await to beforeResolver rule function invocation #3072 by @cannikin
- Rework Logger for Redaction lists, Prisma client version, and Prisma log events #3079 by @dthyresson
- Change src imports to relative #3082 by @jtoar
- Update Failure styles for scaffolded Cells #3083 by @cannikin
- Upgrade setup tailwind #3087 by @jtoar
- Remove deprecated non-critical features #3088 by @callingmedic911
- Make the test project generator more composable #3099 by @dac09
- Upgrades graphql-server envelop and plugins to 1.0.0 #3106 by @dthyresson
- Remove old esbuild/ babel build commands from core. #3119 by @peterp
- Remove local-npm-registry config and docs. #3120 by @peterp
- Ignore graphql-server TS errors #3126 by @peterp
- [setup tailwind] Add ability to skip install #3136 by @jtoar
- Add more info in the terminal | Tweak gitpod settings #3185 by @dac09
- Use user babel.config.js on api side. #3187 by @peterp
- Ignore d.ts file in glob imports #3188 by @peterp
- Enable generating gitpods for forks #3206 by @dac09
- Makes it clearer in the logs when Rufus errors out #3238 by @dac09
- upgrade stable v4 webpack-dev-server #3252 by @thedavidprice
- upgrade Prisma v2.29.1 #3039 #3139 #3233 #3243 by @thedavidprice @vchoy
Fixed
- [setup tailwind] Include tailwind by adding directives to index.css #3181 by @jtoar
- Fixes UnhandledPromiseRejectionWarning on generating types #3211 by @dac09
- Fix: Custom auth provider Private route redirect #2872 by @benada002
- Windows: fix build:link build:test-project #3023 by @Tobbe
- auth0: Full page reload to get around history issue #3055 by @Tobbe
- Fix: type issue on the dbAuth generated pages #3068 by @Albert-Gao
- fix: Fixes yarn build:test-project failing due to jscodeshift #3070 by @dac09
- [yarn rwfw]: clean before building, don't exit on errors #3074 by @jtoar
- Add help command to rwfw #3085 by @alicelovescake
- fix(rwfw): Fixes rufus building graphql-server package #3100 by @dac09
- fix(webpack-manifest): Manifest plugin errors out if manifest.json exists #3104 by @dac09
- Fixes a couple of typos, return
true
if no roles were provided to requireAuth() #3107 by @cannikin - Fix setup tailwind #3108 by @jtoar
- fix scaffoding typo #3112 by @macovedj
- Prerender non-index pages #3113 by @macovedj
- Prerender
Private
routes #3124 by @callingmedic911 - Resolves Typescript errors in useRedwoodLogger plugin in GraphQL-server #3127 by @dthyresson
- fix storybook build, restore E2E specs #3132 by @thedavidprice
- Router: Properly keep track of active route in sub-tree #3135 by @Tobbe
- fix(generate-page): map param types to TS #3138 by @dac09
- fix(project-generator): Add RW_PATH to execa options #3143 by @dac09
- Auth test: Fix typings #3155 by @Tobbe
- Undo vscode settings change #3184 by @dac09
- Supports SDL and Scaffold generation for Float scalar types #3218 by @dthyresson
- fix(babel): API side include babel runtime as deps | Bump babel #3220 by @dac09
- Fix issue where Clerk client is sometimes unset #3224 by @zackdotcomputer
- [build:test-project] set canary as default #3228 by @thedavidprice
- Fix API sourcemaps (babel+esbuild) for debugging #3230 by @aldonline
- fix(babel-hooks): Import babel hooks correctly for console, exec and dm up commands #3231 by @dac09
- downgrade configstore #3247 by @jtoar
- v0.36 fix(babel): Dont transform runtime for framework #3249 by @dac09
Package Dependencies
View all Dependency Version Upgrades
- Bump @apollo/client from 3.3.19 to 3.3.21 #2999 by @dependabot
- Bump @auth0/auth0-spa-js from 1.16.0 to 1.16.1 #3008 by @dependabot
- misc dependency upgrades (aka dependabot fight π€Ί) #3194 by @thedavidprice
- Bump tar from 6.1.0 to 6.1.5 #3203 by @dependabot
- Upgrades graphql-server to use latest envelop, graphql-tools, helix #3204 by @dthyresson
- webpack and misc upgrades #3235 by @thedavidprice
Breaking β οΈ
1. Webpack bumped to v5.x
We've taken the leap, and upgraded Webpack to v5 and the Webpack-Dev-Server to v4. If you have any custom Webpack configuration (in ./web/config/webpack.config.js
), please make sure all your config and custom plugins have been upgraded to support Webpack 5. The same is true for custom options used with devServer and/or when running yarn redwood dev --forward=...
β it's common to have a dev server configuration that needs a bit of tweaking.
See this Forum post Webpack and Jest v0.36 Upgrade Guide
2. Jest bumped to v27
We've migrated the test runner to Jest Circus. For the majority of users, this should be a non-breaking change. In the case you have any custom Jest config or are using custom test environments, this might be one to watch for.
See this Forum post Webpack and Jest v0.36 Upgrade Guide
3. Configuration changes
Very important (but small) changes are required to use this version of Redwood. Please make sure you follow steps 1. and 2. in the "Code Modifications" section.
4. Removed deprecated commands
We've removed some of the old deprecated commands e.g. yarn redwood db
and yarn redwood generate util
5. dbAuth: New loginHandler()
For projects using dbAuth, there are two breaking changes related to adding a new loginHandler()
function and changes to Login/Signup Components. (PR #3111)
See "Code Modifications" below for required changes.
How to Upgrade
Code Modifications
1. Remove babel config from .api
side
Option A If you do not have any custom babel plugins on your api side, simply remove.babelrc.js
.
rm api/.babelrc.js
Option B If you want to use custom babel plugins on your API side, you can create api/babel.config.js
file, but you should not import babel preset from redwood or extend the root babel config.
For more information, see #3187
2. How you set your App's title has changed
Please remove any code to set your App's title from ./web/config/webpack.config.js
(if you have it).
// ./web/config/webpack.config.js
module.exports = (config, { _env }) => {
- config.plugins.forEach((plugin) => {
- if (plugin.constructor.name === 'HtmlWebpackPlugin') {
- plugin.options.title = 'Redwood App';
- }
- });
return config;
};
Setting the title is now much simpler, by simply setting the title property in your redwood.toml
. We recommend you read the following details here and update your project to take advantage of the improved SEO settings.
3. Upgrade Tailwind dependencies and Config
Upgrading Webpack to v5 made it possible to upgrade other Tailwind dependencies. And for projects running yarn redwood setup tailwind for the first time, theyβll see other config improvements (see related PRs #3087 and #3181):
If your project is using Tailwind, changes are not required. However, we recommend you read this Forum post Tailwind v0.36 Upgrade Guide and update dependencies and config for stability and performance improvements.
4. dbAuth: new loginHandler()
Users who have implemented dbAuth since the last release must add a loginHandler()
function in their api/src/functions/auth.js
. A new instance of DbAuthHandler is created and passed several options. loginHandler() needs to be added to that list.
See this Forum post for details: dbAuth v0.36 Upgrade Guide and Breaking Changes
Upgrade Packages to v0.36.x from v0.35.x
Run the following command within your App's directory:
yarn redwood upgrade
Upgrading from an earlier version?
Please follow the "how to upgrade" sections for each newer version here π https://github.com/redwoodjs/redwood/releases, 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.27.0 to v0.28.4, run the following command:
yarn redwood upgrade --tag 0.28.4
Need help or having trouble upgrading packages?
See this forum topic for manual upgrade instructions and general upgrade help.