Skip to content

Releases: firstlookmedia/react-scripts

v2.0.0-rc4

07 Dec 19:18
v2.0.0-rc4
ae52195
Compare
Choose a tag to compare
v2.0.0-rc4 Pre-release
Pre-release
  • adds .js/.jsx testing and coverage support back in
  • fixes enzyme/react-test-renderer compatibility issue with the new Context API (requires React 16.3+)

v2.0.0-rc3

06 Dec 16:12
e88a522
Compare
Choose a tag to compare
v2.0.0-rc3 Pre-release
Pre-release

Server-side HMR in development

Before, the server entry simply started a node server. The start script would stop it & and start again. This change adds webpack HMR to the server config, which means the node server needs to know how to reload itself

Before

// server.js

- const app = express();
- // app code ...
- app.listen(PORT);

After

// server/app.js

+const app = express();

+// app code ...

+export default app;
// server.js

+import http from 'http';
+import app from './server/app';

+const server = http.createServer(app);
+server.listen(APP_PORT);

+if (module.hot) {
+  let currentApp = app;

+  module.hot.accept('./server/app', () => {
+    server.removeListener('request', currentApp);

+    const app = require('./server/app').default;
+    server.on('request', app);
+    currentApp = app;
+  })
+}

v2.0.0-rc2, rc1 + persisted queries support

11 Sep 17:19
a5de30b
Compare
Choose a tag to compare

Persisted queries support

Refer to updated readme.md for directions on how to enable persisted queries. They are disabled by default and the option won't affect sites at all if upgraded to this release without enabling.

v2.0.0-rc1: React 16, Webpack 4

18 Jul 15:38
2c2f2ea
Compare
Choose a tag to compare
Pre-release

Node 8

Please update node to ^8.0.0

React 16

Please update react to ^16.0.0 and any other packages that depend on this.

Testing

This release updates enzyme to v3.

Read the enzyme migration guide here

react-scripts now makes mount and shallow globally available to tests, so these imports can be removed.

-import { mount, shallow } from 'enzyme';

You need to remove enzyme from package.json:

- "enzyme": "^ 2.9.0",

Manifest

The manifest plugin now properly prepends /assets/ so these lines needs updating:

- <link href="/assets/${manifest['main.css']}" type="text/css" rel="stylesheet">
+ <link href="${manifest['main.css']}" type="text/css" rel="stylesheet">

PreCSS

This updates PreCSS to v2 (to be compatible with updated PostCSS). There are no documented breaking changes, but we've seen some changed behavior using @mixin combined with var. Automatically computed values (via postcss-calc) are now more strict (e.g. it will no longer let you divide by units like em and %):

- width: calc(2 / 300%);
+ width: calc(200% / 3);

Sass support

This release adds support for SCSS via .scss file extensions. A few things to note:

  • .css files will still be processed by PreCSS, which will remove things like :root { --variable: value }. If you wish to preserve these, use .scss files (even if they don't use sass features)

Relay mocks

The Relay.RootContainer mock for testing will now render props.renderFetched({}) (previously rendered null). This will make some components break which expect data, but allows you to send mock data to these components.

v1.0.2

20 Mar 18:56
c8da77c
Compare
Choose a tag to compare

Updates default cache headers for uploaded assets to be set to one year.

v1.0.1

13 Mar 18:42
Compare
Choose a tag to compare

fixes Relay mocks for jest tests

v1.0.0

14 Feb 16:55
2a6979b
Compare
Choose a tag to compare

Relay Modern

This is a major change that enables Relay Modern. To upgrade:

yarn add --dev babel-plugin-relay relay-compiler

Update .babelrc config to include:

{
  "plugins": [
    ["relay", {"compat": true, "schema": "schema.graphql"}]
  ]
}

You'll need to make sure the schema.graphql is constructed using a newer version of the graphql package (>= 0.8)

Consumers can now remove existing babel-relay-plugin-related files.

This also adds support for react-scripts configuration via consumer's package.json. The only option currently is sharedComponentModule, e.g.:

"react-scripts": {
  "sharedComponentModule": "eyrie"
}

This option is required to share Relay Modern components via node_modules. It's expected that the module has a lib folder containing the components.

0.17.0

12 Jan 16:14
2bc7495
Compare
Choose a tag to compare

This is a breaking change

To update, install the basic-auth-middleware above:

yarn add git+ssh://[email protected]/firstlookmedia/basic-auth-middleware.git
-import ipBypassMiddleware from 'react-scripts/lib/ipBypassMiddleware'
-import basicAuthMiddleware from 'react-scripts/lib/basicAuthMiddleware';

-app.use(ipBypassMiddleware);
-app.use(basicAuthMiddleware);

+import basicAuthMiddleware from 'basic-auth-middleware';

+const BASIC_AUTH_USER = process.env.BASIC_AUTH_USER;
+const BASIC_AUTH_PASS = process.env.BASIC_AUTH_PASS;
+const IP_BYPASS = process.env.IP_BYPASS;

+app.use(basicAuthMiddleware({
+  username: BASIC_AUTH_USER,
+  passwordHash: BASIC_AUTH_PASS,
+  allowedIPs: typeof IP_BYPASS === 'string' ? IP_BYPASS.split(',') : null,
+}));

0.16.0

29 Nov 20:34
c8f3e06
Compare
Choose a tag to compare

Adds a logger middleware to add a common log format to our node servers

0.15.2

21 Nov 21:27
0c684ea
Compare
Choose a tag to compare
  • Fixes actual version in package.json
  • Adds command pwhash for generating a hash for basicauthmiddleware