kit

ReactQL starter kit (use the CLI)

Stars
229
Committers
14

Bot releases are hidden (Show)

kit - 2.10.0 Latest Release

Published by leebenson almost 7 years ago

2.10.0 - 2017-11-18

NPM

  • Adds packages:
    enzyme@^3.0.0

  • Bumps packages:
    "babel-eslint": "^8.0.2"
    "babel-plugin-module-resolver": "^3.0.0"
    "babel-preset-env": "^1.6.1"
    "brotli-webpack-plugin": "^0.5.0"
    "copy-webpack-plugin": "^4.2.1"
    "cross-env": "^5.1.1"
    "eslint": "^4.11.0"
    "eslint-plugin-compat": "^2.1.0",
    "eslint-plugin-import": "^2.8.0",
    "eslint-plugin-jest": "^21.3.2",
    "extract-text-webpack-plugin": "^3.0.2"
    "iltorb": "^2.0.2"
    "node-sass": "^4.7.1"
    "npm-run-all": "^4.1.2"
    "react-test-renderer": "^16.1.1"
    "resolve-url-loader": "^2.2.0"
    "serve": "^6.4.1"
    "webpack": "^3.8.1"
    "webpack-bundle-analyzer": "^2.9.1"
    "webpack-dev-server": "^2.9.4"
    "apollo-local-query": "^0.3.1"
    "apollo-server-koa": "^1.2.0"
    "boxen": "^1.2.2"
    "chalk": "^2.3.0"
    "koa": "^2.4.1"
    "react": "^16.1.1"
    "react-dom": "^16.1.1"
    "react-hot-loader": "^3.1.3"

kit - 2.9.5

Published by leebenson about 7 years ago

2.9.5 - 2017-10-18

Webpack

  • Fixes publicPath with extract-text-webpack-plugin, so that fonts/images are referenced properly in production
kit - 2.9.4

Published by leebenson about 7 years ago

2.9.4 - 2017-10-18

Docker

  • Adds PM2 to Dockerfile, for Docker-compatible process management, clustering and auto-restart policing.
  • Replaces start command with auto-clustering via PM2
kit - 2.9.3

Published by leebenson about 7 years ago

2.9.3 - 2017-10-18

Routing

  • Adds app-wide history instance to kit/lib/routing.js, for controlling routes outside of React directly
  • Replaces React Router's <BrowserRouter> with <Router history={history}>, to stay in sync with global pushstate
kit - 2.9.2

Published by leebenson about 7 years ago

2.9.2 - 2017-10-17

Server

  • Setting ctx.apollo.networkOptions via a function passed to config.addBeforeMiddleware() will now get passed to the call to Apollo's createNetworkInterface() when using a third-party GraphQL server, enabling dynamic per-request CORS / authorisation logic, as needed
kit - 2.9.1

Published by leebenson about 7 years ago

Config

  • Adds .addBeforeMiddleware(), for adding Koa middleware that runs before Apollo/Redux instantiation
  • Adds .disableTiming() to optionally remove the Response-Time header / timing middleware

Server

  • Renames ctx.apollo to ctx.apollo.client. Now, setting ctx.apollo.options in before middleware will merge those settings into Apollo client creation
  • Adds logic to check for the presence of ctx.apollo.client and ctx.store before using default Apollo/Redux init. This allows overrides in before middleware for completely custom instantiation
kit - 2.9.0

Published by leebenson about 7 years ago

2.9.0 - 2017-10-17

Building

  • Fixes static building via npm run build-static, by replacing broken chunk-manifest-webpack-plugin (closes #55)

Webpack

  • Adds src to modules path, to avoid src/ prefixes at the start of userland imports (closes #69)
  • Fixes stats configuration to work with the latest Webpack versions
  • Adds CORS config to webpack_dev_server, to enable LAN-wide browser hot-code reloading (closes #99)
  • Removes leading / in asset output, to allow defining a <base> tag in userland via React Helmet (closes #102)

ESLint

  • Refactors rules, to be grouped by plugin
  • Adds jsx-a11y/anchor-is-valid rule to avoid 'href' on React Router <Link> attributes
  • Adds function-paren-newline rule to enforce consistent parenthesis
  • Adds object-curly-newline rule to allow one-line / multi-line object definitions
  • Fixes various kit and src files to conform to new rules

React

  • Bumps to React v16 - officially out of RC!

Config

  • Adds .disableKoaHelmet() for disabling koa-helmet on the server (closes #79)
  • Adds .setKoaHelmetOptions() for passing options to Koa Helmet
  • Sets .koaHelmetOptions and .bodyParserOptions to null by default

App

  • Disables SSL by default

Server

  • Removes leading / in bundled assets (along with Webpack) to allow for a <base> tag to define the load path

Testing (Jest)

  • Fixes Jest testing to be compatible with Babel and React (closes #81, merges #84 - thanks @nate0001)

General

  • Fixes 'local' typo (merges #89 - thanks @kane-c)
  • Fixes misspelled browserslist file (merges #95 - thanks @klarstrup)
  • Adds idiomatic React Helmet <head> tags, adds missing html/body attributes, base, link, style, script and noscript, uses new Helmet.renderStatic() call (closes #101 & #94 - thanks @klarstrup)
  • Adds default <base href="/" /> tag, when none is defined with React Helmet

Docker

  • Adds Alpine-based Dockerfile to reduce Docker image size from 943mb -> 323mb (closes #98, merges #97 - thanks @kane-c)
  • Adds docker-compose.yml for production (closes #98)
  • Adds docker-compose.dev.yml for local development. Removes the local node_modules to ensure Alpine-compatible Linux binaries are being referenced by local code changes. Supports hot code reloading in-browser and via SSR

NPM

  • Bumps packages:
    "babel-eslint": "^8.0.1"
    "copy-webpack-plugin": "^4.1.1",
    "cross-env": "^5.1.0",
    "eslint": "^4.9.0",
    "eslint-config-airbnb": "^16.1.0",
    "eslint-plugin-compat": "^2.0.1",
    "eslint-plugin-jsx-a11y": "^6.0.2",
    "eslint-plugin-react": "^7.4.0",
    "extract-text-webpack-plugin": "^3.0.1",
    "file-loader": "^1.1.5",
    "graphql-tag": "^2.5.0",
    "iltorb": "^2.0.1"
    "jest": "^21.2.1",
    "less": "^3.0.0-alpha.3",
    "postcss-loader": "^2.0.8",
    "resolve-url-loader": "^2.1.1",
    "rimraf": "^2.6.2",
    "serve": "^6.2.0",
    "style-loader": "^0.19.0",
    "webpack": "^3.8.0",
    "webpack-chunk-hash": "^0.5.0",
    "webpack-config": "^7.5.0",
    "webpack-dev-server": "^2.9.2",
    "webpack-manifest-plugin": "^1.3.2",
    "apollo-server-koa": "^1.1.7",
    "graphql": "^0.11.7",
    "koa-send": "^4.1.1",
    "prop-types": "^15.6.0",
    "react": "^16.0.0",
    "react-apollo": "^1.4.16",
    "react-dom": "^16.0.0",
    "react-hot-loader": "^3.1.1"
kit - 2.8.5

Published by leebenson about 7 years ago

2.8.5 - 2017-09-07

CSS

  • Adds cssnano.config.js, to fix url() resolution for cssnano@next
kit - 2.8.4

Published by leebenson about 7 years ago

2.8.4 - 2017-09-07

NPM

  • Brings package-lock.json up to date
  • Bumps packages:
    "react-dom": "^16.0.0-rc.2"
kit - 2.8.3

Published by leebenson about 7 years ago

2.8.3 - 2017-09-07

## React

kit - 2.8.2

Published by leebenson about 7 years ago

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"
kit - 2.8.1

Published by leebenson about 7 years ago

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
kit - 2.8.0

Published by leebenson about 7 years ago

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"
kit - 2.7.0

Published by leebenson about 7 years ago

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
kit - 2.6.0

Published by leebenson about 7 years ago

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 https://github.com/reactql/kit/issues/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

kit - 2.5.3

Published by leebenson about 7 years ago

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
kit - 2.5.2

Published by leebenson about 7 years ago

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
kit - 2.5.1

Published by leebenson about 7 years ago

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
kit - 2.5.0

Published by leebenson about 7 years ago

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
kit - 2.4.0

Published by leebenson about 7 years ago

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
Related Projects