Skip to content

Releases: reactql/kit

2.8.2

07 Sep 13:28
Compare
Choose a tag to compare

2.8.2 - 2017-09-07

CSS

  • Fixes #72 - bumps to cssnano@next to avoid @font-face issues from externally imported packages

React

  • Bumps to React v16 RC2

NPM

  • Bumps packages:
  • cssnano": "^4.0.0-rc.2"
  • "react": "^16.0.0-rc.2"

2.8.1

06 Sep 17:05
Compare
Choose a tag to compare

2.8.1 - 2017-09-06

Webpack

  • Fixes process.env.NODE_ENV in development

Docker

  • Updates Dockerfile to use HOST and PORT env vars, instead of the previous SERVER_PROD_*

NPM

  • Bumps packages:
  • jest ^20.0.4 → ^21.0.1
  • graphql ^0.11.2 → ^0.11.3
  • eslint ^4.5.0 → ^4.6.1
  • image-webpack-loader ^3.4.0 → ^3.4.2
  • webpack ^3.5.5 → ^3.5.6

2.8.0

04 Sep 17:44
Compare
Choose a tag to compare

2.8.0 - 2017-09-04

Breaking changes.

This release introduces some breaking changes to host environment vars, and SSL work:

Host and port environment variables

Until now, changing hosts/ports required setting environment-specific variables, such as SERVER_DEV_HOST or BROWSER_PROD_PORT. The number of combinations made this somewhat confusing; there's little point setting SERVER_PROD_HOST when ReactQL is built in development mode, for example.

In this release, we've simplified config to just:

  • HOST
  • PORT

... which sets both the server endpoints, as well as the default GraphQL URI -- in whichever environment you happen to be running in (i.e. npm start = dev, npm run build-run = production)

Additionally, you can set the following in 'hot code reload' Webpack browser mode:

  • BROWSER_HOST
  • BROWSER_PORT

... which will specifically override HOST and DEV for that mode.

SSL

v2.6.0 introduced SSL. This was implemented as sharing a SINGLE port for both HTTP + HTTPS, which works well for development - but less so for production, where ports 80 and 443 are more typical. The tcpHandler() function has been removed, and both servers now run on their own environment-defined ports.

In addition to the new environment variables above, you can set SSL_PORT in the environment which will mount the HTTPS server on the correct port. If you fail to pass this, the HTTPS server simply won't start, and options sent to config.enableSSL() will be ignored.

kit/lib/env.js

Since env vars have been simplified, most of the boilerplate in this file was rendered moot. This has now been refactored into an enhanced getServerURL function that automatically returns either 'http://' or 'https://' as the URL prefix, the correct host, along with a port number -- (unless the port is 80 or 443, in which case the port is omitted since it's implicit.)

Kit

  • Fixes #71 - setting SERVER_DEV_HOST and SERVER_PROD_HOST results in the correct GraphQL and app endpoints

NPM

  • Removes packages:
    "get-port": "^3.2.0"

2.7.0

01 Sep 08:54
Compare
Choose a tag to compare

2.7.0 - 2017-09-01

Config

  • Now config.addRoute() (and derivatives) accept multiple route handlers

NPM

  • Bumps packages:
    graphql ^0.11.1 → ^0.11.2
    react-helmet ^5.1.3 → ^5.2.0
    brotli-webpack-plugin ^0.4.0 → ^0.4.1
    css-loader ^0.28.5 → ^0.28.7
    iltorb ^1.3.5 → ^1.3.6
    image-webpack-loader ^3.3.1 → ^3.4.0
    npm-run-all ^4.1.0 → ^4.1.1

2.6.0

28 Aug 16:00
Compare
Choose a tag to compare

2.6.0 - 2017-08-28

This release enables SSL with one line -- config.enableSSL(options)!

Now SSL and plain HTTP can live side-by-side, on the same port, thanks to a new tcpHandler() function that proxies data to the correct listening port, avoiding the need to expose more than one port publicly.

All changes:

Config

  • Adds config.getKoaApp(), for passing a function that access Koa's app instance, allowing you to do something with app that's not covered by other functions (closes #65)
  • Adds config.enableSSL(opt), for running Koa via a HTTPS/SSL server
  • Adds config.disableHTTP(), for disabling a plain HTTP server listener (used in conjunction with config.enableSSL(), when you want SSL-only)
  • Adds config.forceSSL(opts), for re-writing plain http:// -> https:// using koa-sslify

Server

  • Adds http and https configurations, for enabling SSL
  • Adds get-port, for assigning http(s) listeners to random ports
  • Adds listen() function, for proxying traffic to http(s) depending on the request received (if the first byte == 22 ? SSL : HTTP)
  • Refactors kit/entry/server.js to no longer export an immediate async function (no longer returns a Promise)
  • Refactors kit/entry/server_* to use the new server.js default export

App

  • Adds example use of config.getKoaApp(), that extends the app.context prototype with an engine = 'ReactQL' key, which we later use in middleware to add a 'Powered-By' response header. Also adds a general error catching function, for server-level errors.
  • Adds src/cert/self_signed.js, to export a sample self-signed SSL certificate to enable SSL in userland
  • Adds config.enableSSL() example, for running HTTPS side-by-side with the regular HTTP port
  • Adds commentary for new config.disableHTTP() and config.forceSSL() functions

NPM

  • Adds packages:
    "get-port": "^3.2.0"
    "koa-sslify": "^2.1.2"

  • Bumps packages:
    graphql ^0.10.5 → ^0.11.1
    apollo-server-koa ^1.1.0 → ^1.1.2
    react-apollo ^1.4.14 → ^1.4.15
    react-router ^4.1.2 → ^4.2.0
    react-router-dom ^4.1.2 → ^4.2.2
    npm-run-all ^4.0.2 → ^4.1.0

2.5.3

26 Aug 19:01
Compare
Choose a tag to compare

2.5.3 - 2017-08-26

Config

  • Adds config.setApolloNetworkOptions(), for passing opts to Apollo's createNetworkInterface
  • Renames config.setApolloOptions() -> config.setApolloClientOptions(), to differentiate with config.setApolloNetworkOptions()
  • Adds server-side config.setCORSOptions(), for setting CORS config options for koa-cors

2.5.2

26 Aug 08:03
Compare
Choose a tag to compare

2.5.2 - 2017-08-26

Config

  • Adds config.setApolloOptions(), for passing in an object of Apollo Client instantiation options

Server

  • Refactors createLocalInterface to accept Koa's context object when using local GraphQL schema via apollo-local-query

2.5.1

22 Aug 07:26
Compare
Choose a tag to compare

2.5.1 - 2017-08-22

Config

  • Adds setErrorHandler() function, to enable custom error logging/middleware

App

  • Adds example that uses a custom error handler
  • Fires sample INCREMENT_COUNTER action in server middleware, to demonstrate sending count: 1 down the wire via SSR

NPM

  • Bumps packages:
    babel-loader ^7.1.1 → ^7.1.2
    eslint ^4.4.1 → ^4.5.0
    eslint-plugin-react ^7.2.1 → ^7.3.0
    webpack-config ^7.2.1 → ^7.4.0

2.5.0

21 Aug 14:57
Compare
Choose a tag to compare

2.5.0 - 2017-08-21

## Redux

  • Breaking change - reducers should no longer be registered as { state, reducer}. Instead, the format is:
// root key name, reducer function, and initial state (as a plain object)
config.addReducer('keyName', reducerFunction, { count: 0 });
  • Initial state should now be a plain object; it will be wrapped in a call to seamless-immutable automatically, providing immutability by default

  • Refactors kit/lib/redux.js -> unwind() to wrap custom reducers in a defaultReducer function, that detects a Redux undefined sentinel state and returns a plain object -- otherwise, calls the 'real' reducer. (The side-effect to this is that reducer no longer need to handle undefined values!)

GraphQL

  • Adds optional middleware / afterware to Apollo client instantiation via:
  • config.addApolloMiddleware()
  • config.addApolloAfterware()
    Both functions can be called isomorphically; the middleware will be attached only to the environment in which it's called, so wrap in an if (SERVER)... block if you need to isolate this behaviour. Note: If you're using a built-in GraphQL server, ReactQL will use apollo-local-query instead of regular HTTP requests so middleware won't be executed -- be aware of this if you're doing HTTP header authentication!

Config

  • Refactors the Config class to progressively add server-side config functions by moving the class into sub-classes for the browser/server

2.4.0

18 Aug 18:05
Compare
Choose a tag to compare

2.4.0 - 2017-08-18

Server

  • Moves Apollo client and Redux store to Koa ctx middleware, so it's available to all routes
  • Adds config.addMiddleware(), to add custom middleware to the Koa server

## App

  • Adds sample Powered-By header, to showcase custom middleware
  • Adds ctx.store.getStore() dump to sample /test and 404 routes, to show the difference in Apollo response