v0.33 Highlights π
This release moves Redwood within striking distance of a v1 release candidate. If you haven't looked in a while, check out the Roadmap to v1 for current status.
For everyone who contributed below (and in all the previous releases), thank you for making Redwood amazing π The project just wouldn't be the same if not for the vibrant, helpful community making it happen.
π¦ TypeScript Support is (almost) π―
With this release, you'll immediately notice all the new TypeScript features and support. @peterp @dac09 @Tobbe and so many others have been chipping away for many months β their hard work is really starting to shine.
There are a few remaining pieces to put in place. In the meantime, check out what's included, and then let us know what you think (or what's missing) via the Redwood Forums.
π©βπ»π¨βπ» Contributing is getting even easier
We β€οΈ contributors! Just look at all the different names below of individuals who contributed to this release alone. Several of them are first-time contributors who attended a recent Contributing Workshop (keep a lookout for another one soon).
The local development tooling for contributing is just getting better and better. We highlight the new yarn redwood-tools link
command in this Contributing Doc as well as the β¨brand newβ¨ script to spin-up a local test project, bells and whistles included! Just run yarn build:test-project
from a local clone of the Redwood framework, and then thank @renansoares for a job well done.
Changelog
Added
- Add script to create a functional test project using the latest CRWA template #2324 by @renansoares
- TS: GraphQL Codegen for generating gql types #2485 by @dac09
- TS: Improve page, component and layout generators with idiomatic TypeScript support #2505 by @zakmandhro
- TS: Router: More helpful typings for Route #2592 by @Tobbe
- TS: Create file watch for type def generation #2614 by @peterp
- TS: TypeScript support for scenarios and service testing #2643 by @dac09
- TS: Avoid generating gql types if not cell present #2710 by @dac09
- rw exec to run arbitrary scripts in Redwood context #2548 by @dac09 @viperfx
- Ability to filter tests by filename #2630 by @dac09
- Add default config for Component generation #1814 by @jvanbaarsen
- Add Storybook component checks to E2E runner #2073 by @thedavidprice
- Custom useAuth pass-through for RedwoodApolloProvider #2455 by @realStandal
- Add JSON headers to Function generator template #2457 by @ryancwalsh
- Prerender all routes nested in Set with prerender prop #2542 by @Tobbe
- add esbuild config to CLI build and dev #2564 by @thedavidprice
- Add stories and tests to destroy command #2568 by @pdjota
- Adds option to cell generation for lists of a given model #2569 by @dthyresson
- Add command to create functional project to CONTRIBUTING.md #2667 by @renansoares
Changed
- upgrade Prisma v2.23.0 #2566 by @thedavidprice
- v2.23.0 Release Notes
- JSON Filtering is now in Preview
- BREAKING: Options in groupBy queries are now prefixed with an underscore
- DEPRECATING: Options in aggregate queries
- Rename default datasource #1941 by @jvanbaarsen
- Update Contributors corresponding with release v0.32 #2544 by @thedavidprice
- Add learn.rwjs.com translator contributors from crowdin #2560 by @thedavidprice
- Configure babel-plugin-private-methods loose explicitly #2554 by @dac09
- Cache magic.link's token #2555 by @simoncrypta
- Removes console warnings in webhook verifiers #2563 by @dthyresson
- Wrap routes with Set in scaffold #2609 by @callingmedic911
- Pin package dependencies, remove CRWA template yarn.lock, set up Yarn offline cache #2637 #2669 #2703 by @thedavidprice
- Exclude yarn packages cache folder from VSCode search #2697 by @peterp
- Supabase upgraded to 1.13.1 to support Apple, Twitter and refreshToken authentication #2700 by @dthyresson
- remove CRWA/template/redwood.toml schemaPort #2702 by @thedavidprice
Fixed
- Fixed Firebase promises so that errors/exceptions can be caught #2503 by @cjreimer
- Prevent re-initialization of a Firebase app that is already initialized #2504 by @cjreimer
- forms: Fix number validation msg #2552 by @andrew-hwahin
- Fix CONTRIBUTING.md#integration-tests ./tasks/test-tutorial to ./tasks/run-e2e #2593 by @devhmac
- CONTRIBUTING.md: add missing char #2594 by @AntonioMeireles
- CONTRIBUTING.md: styling tweaks for improved readability and consistency #2608 by @AntonioMeireles
- Manage history state length exploding if clicking on a link with with the current route location #2616 by @KrisCoulson
- Fix serve tests #2668 by @Tobbe
- schemaPath must be the same as default toml #2677 by @pdjota
- Fix lerna canary publishing; use default --canary versioning with git describe #2693 by @thedavidprice
- E2E Cypress improvements β fix Cells and Forms, upgrade Cypress #2707 by @thedavidprice
Package Dependencies
View all Dependency Version Upgrades
- upgrade magic-sdk from 2.7.0 to 4.3.0 #2463
- build(deps): bump core-js from 3.10.1 to 3.12.1 #2481
- build(deps): bump @graphql-tools/merge from 6.2.13 to 6.2.14 #2516
- build(deps): bump esbuild-loader from 2.10.0 to 2.13.0 #2518
- build(deps-dev): bump firebase-admin from 9.7.0 to 9.8.0 #2522
- updating minor dependency versions across packages #2532 by @thedavidprice
- build(deps): bump concurrently from 6.0.2 to 6.1.0 #2533
- build(deps): bump pino-pretty from 4.7.1 to 4.8.0 #2534
- build(deps): bump http-proxy-middleware from 1.1.0 to 2.0.0 #2536
- Upgrade eslint and prettier packages including formatting fixes #2540 by @thedavidprice
- Upgrade Babel 7.14.2 including misc babel packages #2541 by @thedavidprice
- build(deps-dev): bump @types/findup-sync from 2.0.2 to 4.0.0 #2574
- build(deps): bump @apollo/client from 3.3.18 to 3.3.19 #2576
- build(deps): bump @babel/cli from 7.13.16 to 7.14.3 #2578
- build(deps): bump esbuild from 0.11.21 to 0.12.1 #2579
- build(deps): bump apollo-server-lambda from 2.22.2 to 2.24.1 #2580
- build(deps-dev): bump @supabase/supabase-js from 1.11.13 to 1.11.14 #2583
- Aggregate Dependabot misc patch minor upgrades #2596 by @thedavidprice
- build(deps-dev): bump @types/lodash from 4.14.169 to 4.14.170 #2597
- build(deps): bump babel-plugin-graphql-tag from 3.2.0 to 3.3.0 #2600
- build(deps): bump @types/node from 15.3.1 to 15.6.0 #2601
- build(deps): bump @babel/plugin-transform-runtime from 7.14.2 to 7.14.3 #2603
- upgrade eslint-plugin-import v2.23.3 with lint fixes #2604 by @thedavidprice
- build(deps): bump eslint from 7.26.0 to 7.27.0 #2610
- build(deps): bump msw from 0.28.2 to 0.29.0 #2618
- bump concurrently from 6.1.0 to 6.2.0 #2620
- build(deps-dev): bump @supabase/supabase-js from 1.11.14 to 1.11.15 #2621
- build(deps): bump @typescript-eslint/parser from 4.24.0 to 4.25.0 #2624
- build(deps): bump @types/node from 15.6.0 to 15.6.1 #2626
- build(deps): bump @typescript-eslint/eslint-plugin from 4.24.0 to 4.25.0 #2627
- build(deps): bump esbuild from 0.12.1 to 0.12.5 #2654
- build(deps): bump ts-morph from 10.1.0 to 11.0.0 #2656
- build(deps): bump core-js from 3.12.1 to 3.13.1 #2680
- Upgrade axios due to security issue #2688 by @peterp
- Misc Dependabot upgrades including mostly patches #2694 by @thedavidprice
- bump react types and eslint packages patch version #2695 by @thedavidprice
- downgrade jest-watch-typeahead 0.6.3 #2699 by @thedavidprice
Breaking β οΈ
Projects with api/prisma/
directory will error
This release changes the default path to api/db/
and fully deprecates default support for api/prisma
. There are two ways to resolve this, including changing the directory name. See the "Code Modifications" section for more info.
How to Upgrade
Code Modifications
1. Projects created at Redwood v0.20 (or earlier) must update api/prisma/
or add config
Redwood projects now default to the directory structure api/db/
. This release fully deprecates default support for projects with an api/prisma/
directory. This can be resolved by either of the following:
- rename
api/prisma/
toapi/db/
- add the following config to
redwood.toml
[api]
schemaPath = './api/prisma/schema.prisma'
Any projects using api/db
can remove the schemaPath
config from redwood.toml
, which now defaults to './api/db/schema.prisma'
2. TypeScript Projects: Update your tsconfig.json
in web/ and api/ folders (recommended)
To take advantage of new TS support features, TS projects should update their two tsconfig.json
files. There are two options:
- If you haven't modified the files, run
yarn rw setup tsconfig --force
to overwrite your old configs with the latest - Manually apply the updates:
3. Update graphql.config.js
(recommended)
Redwood now writes the graphql.schema
to disk when you run yarn rw dev
or yarn rw generate types
! You should modify your project's graphql.config.js
file so the VSCode GraphQL plugin reads the schema from disk rather than from the api-server. This will be faster, doesn't require your API server to be running, and you won't see a bunch of unwanted requests in your api-server!
Manually update graphql.config.js
(see this reference file):
const { getPaths } = require('@redwoodjs/internal')
module.exports = {
schema: getPaths().generated.schema,
}
4. Rename Prisma Schema Datasource (recommended)
Prisma boilerplate renames the api/db/schema.prisma
Datasource from DS
to db
. We recommend all projects do the same. See PR #1941 for reference.
5. Add ESbuild config option to redwood.toml
(not required)
The commands yarn rw dev
and yarn rw build
both offer experimental support with the --esbuild
option. You can now add the config to your redwood.toml
instead of passing as a command option.
[experimental]
esbuild = false
The default is false
. Set to true
to enable.
6. Firebase Auth: Add additional initialization check
A firebase app will throw an error if you try to reinitialize it after it is already initialized. It is recommend you modify your code to add an additional check if already initialized (see this comment for reference):
export const firebaseClient = ((config) => {
if (!firebase.apps.length) {
firebase.initializeApp(config)
}
return firebase
})(firebaseClientConfig)
Upgrade Packages to v0.33.x from v0.32.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.