npm @redwoodjs/core 0.3.2
v0.3.2

latest releases: 8.0.0-canary.540, 8.0.0-canary.539, 8.0.0-canary.538...
4 years ago

⚠️ This release includes a breaking change where we no longer import db automatically (#334). See "How to upgrade to v0.3.2" for more information. ⚠️

Changed

  • Do not import db automatically. #334

Added

  • new command yarn rw info to get system environment #329
  • create redwood-app can be instantiated in an empty directory #315 @olance
  • Prisma is updated to preview24 #303
  • Added a way to change the webpack configuration #312 @Idered

Fixed

  • Fix Netlify deploy issue with src path #338
  • Fix scaffold and sdl generator `Routes.js’ insertion order #336
  • Fix yarn rw test #290
  • Change the way that routes are matched so that it works in Firefox #308
  • Fix ‘yarn rw help’ issue with output on Windows #331

👉 How to upgrade to v0.3.2

(1 of 3) Create a new folder and file api/src/lib/db.js

This adds a way to instantiate the database.

  • create api/src/lib/db.js file
  • copy and paste the following into db.js
// See https://github.com/prisma/prisma2/blob/master/docs/prisma-client-js/api.md#constructor
// for options.

import { PrismaClient } from '@prisma/client'

export const db = new PrismaClient()

(2 of 3) Manually update Files

First, add an import and update the export in your api/src/functions/graphql.js file.

See this example of the updated template file.

  • Add this line to your list of imports:
import { db } from 'src/lib/db'
  • Export db in export const handler = createGraphQLHandler({...}). Add this to the end of the export after schema: makeMergedSchema({...}) (approx. line 18):
db,

Secondly, for each Services file within api/src/services/*, do the following:

  • add this line at the top:
// api/src/services/*
import { db } from 'src/lib/db'

For example, if you completed the RedwoodJS Tutorial you would have posts.js and contacts.js within api/src/services/posts/ and api/src/services/contacts/, respectively. You would add the import statement to the top of each of those files.

(3 of 3) Update your @redwoodjs/* packages.

Four packages should be updated to v0.3.2

Root directory package.json

  • "@redwoodjs/core": "^0.3.2”

web/package.json

  • "@redwoodjs/web": "^0.3.2”
  • "@redwoodjs/router": "^0.3.2”

api/package.json

  • "@redwoodjs/api": "^0.3.2”

After updating and saving the files, install the packages from the root directory:
$ yarn install

Don't miss a new core release

NewReleases is sending notifications on new releases.