Skip to content

Release 2.0.0 (May 01, 2019)

Compare
Choose a tag to compare
@ktalebian ktalebian released this 01 May 22:26

2.0.0 (May 01, 2019)

Create Flex Plugin 2.0 upgrades to the latest Create React App 3.

Highlights

  • Create React App 3.0 support
  • Craco (Create React App Configuration Override)
  • Drops React-App-Rewired
  • Jest 24

Migrating from 1.x to 2.x

Update your global create-flex-plugin by running:

npm install --global create-flex-plugin

To update existing plugins, edit package.json and modify scripts and dependencies:

{
    "scripts": {
        "bootstrap": "flex-check-start",
        "postinstall": "npm run bootstrap",
        "prestart": "npm run bootstrap",
        "start": "craco start",
        "build": "craco build",
        "test": "craco test --env=jsdom",
        "eject": "craco eject"
    },
    "dependencies": {
        "@craco/craco": "^5.0.2",
        "flex-plugin": "^2",
        "craco-config-flex-plugin": "^2",
        "react-scripts": "^3.0.0"
    }
}

Add a craco.config.js to the directory and paste the following:

const config = require('craco-config-flex-plugin');

module.exports = {
     ...config,
     plugins: [
          // You can customize the configuration by defining your own plugins.
          // See https://github.com/sharegate/craco/tree/master/packages/craco#develop-a-plugin
          // for more detail
     ]
};

Then update public/plugins.json and update the port on src from 8085 to 3000. Finally run npm install to install/update the new dependencies.

You also need to move your jest configuration into craco.config.js, otherwise CRA will ignore them.

Breaking Changes

Create Flex Plugin upgrades from Create React App 1.x to Create React App 3.x. Please check the CHANGELOG and migration plan on CHANGELOG 1.x to 2.x and CHANGELOG 2.x to 3.x on the official Create React App GitHub page.

We have also dropped support for React App Rewired.

Jest 24

Please check Jest 24 features for any breaking changes.

Create React App 3

Please check CHANGELOG 1.x to 2.x and CHANGELOG 2.x to 3.x features for any breaking changes.

React App Rewired

We have dropped this service and instead replaced it with Create React App Config Override. See below for more detail.

New Features

Create React App 3

Please visit Create React App for all the new changes added to Create React App 3.x.

Craco

We have dropped the usage of React App Rewired and instead have added support for Create React App Configuration Override.

You can now easily provide your own configuration override for all Create React App options by editing the craco.config.js. You can easily create plugins and add them to craco.config.js.