-
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"
- Fixes
publicPath
withextract-text-webpack-plugin
, so that fonts/images are referenced properly in production
- Adds PM2 to
Dockerfile
, for Docker-compatible process management, clustering and auto-restart policing. - Replaces start command with auto-clustering via PM2
- Adds app-wide
history
instance tokit/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
- Setting
ctx.apollo.networkOptions
via a function passed toconfig.addBeforeMiddleware()
will now get passed to the call to Apollo'screateNetworkInterface()
when using a third-party GraphQL server, enabling dynamic per-request CORS / authorisation logic, as needed
- Adds
.addBeforeMiddleware()
, for adding Koa middleware that runs before Apollo/Redux instantiation - Adds
.disableTiming()
to optionally remove theResponse-Time
header / timing middleware
- Renames
ctx.apollo
toctx.apollo.client
. Now, settingctx.apollo.options
in before middleware will merge those settings into Apollo client creation - Adds logic to check for the presence of
ctx.apollo.client
andctx.store
before using default Apollo/Redux init. This allows overrides in before middleware for completely custom instantiation
- Fixes static building via
npm run build-static
, by replacing brokenchunk-manifest-webpack-plugin
(closes #55)
- Adds
src
to modules path, to avoidsrc/
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)
- 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
- Bumps to React v16 - officially out of RC!
- 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
- Disables SSL by default
- Removes leading
/
in bundled assets (along with Webpack) to allow for a<base>
tag to define the load path
- Fixes Jest testing to be compatible with Babel and React (closes #81, merges #84 - thanks @nate0001)
- 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 newHelmet.renderStatic()
call (closes #101 & #94 - thanks @klarstrup) - Adds default
<base href="/" />
tag, when none is defined with React Helmet
- 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 localnode_modules
to ensure Alpine-compatible Linux binaries are being referenced by local code changes. Supports hot code reloading in-browser and via SSR
- 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"
- Adds
cssnano.config.js
, to fixurl()
resolution forcssnano@next
- Brings
package-lock.json
up to date - Bumps packages: "react-dom": "^16.0.0-rc.2"
## React
- Fixes invalid call to
ReactDOMServer.renderToStream()
->renderToNodeStream()
per facebook/react#10294 (comment)
- Fixes 72 - bumps to
cssnano@next
to avoid@font-face
issues from externally imported packages
- Bumps to React v16 RC2
- Bumps packages:
- cssnano": "^4.0.0-rc.2"
- "react": "^16.0.0-rc.2"
- Fixes
process.env.NODE_ENV
in development
- Updates
Dockerfile
to useHOST
andPORT
env vars, instead of the previousSERVER_PROD_*
- 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
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.)
- Fixes #71 - setting
SERVER_DEV_HOST
andSERVER_PROD_HOST
results in the correct GraphQL and app endpoints
- Removes packages: "get-port": "^3.2.0"
- Now
config.addRoute()
(and derivatives) accept multiple route handlers
- 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
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:
- Adds
config.getKoaApp()
, for passing a function that access Koa'sapp
instance, allowing you to do something withapp
that's not covered by other functions (closes reactql/kit#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 withconfig.enableSSL()
, when you want SSL-only) - Adds
config.forceSSL(opts)
, for re-writing plainhttp://
->https://
using koa-sslify
- Adds
http
andhttps
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 immediateasync
function (no longer returns a Promise) - Refactors
kit/entry/server_*
to use the newserver.js
default export
- Adds example use of
config.getKoaApp()
, that extends theapp.context
prototype with anengine = '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()
andconfig.forceSSL()
functions
-
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
- Adds
config.setApolloNetworkOptions()
, for passingopts
to Apollo'screateNetworkInterface
- Renames
config.setApolloOptions()
->config.setApolloClientOptions()
, to differentiate withconfig.setApolloNetworkOptions()
- Adds server-side
config.setCORSOptions()
, for setting CORS config options forkoa-cors
- Adds
config.setApolloOptions()
, for passing in an object of Apollo Client instantiation options
- Refactors
createLocalInterface
to accept Koa's context object when using local GraphQL schema viaapollo-local-query
- Adds
setErrorHandler()
function, to enable custom error logging/middleware
- Adds example that uses a custom error handler
- Fires sample
INCREMENT_COUNTER
action in server middleware, to demonstrate sendingcount: 1
down the wire via SSR
- 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
## 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 adefaultReducer
function, that detects a Redux undefined sentinelstate
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!)
- 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 anif (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!
- Refactors the
Config
class to progressively add server-side config functions by moving the class into sub-classes for the browser/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
- Adds GraphiQL IDE by default to
/graphql
when using external GraphQL endpoint - Allows explicit GraphiQL IDE endpoint to be set on
config.enableGraphQLServer|setGraphQLEndpoint()
- Updates GraphiQL endpoint to match internal GraphQL POST endpoint URL by default (falls back to
/graphql
)
- Breaking change -- now
config.enableGraphQLServer()
should be called isomorphically! - Adds explicit
config.setGraphQLSchema()
for passing the schema to the GraphQL server (use inside aSERVER
block only!)
- Bumps packages: regenerator-runtime ^0.10.5 → ^0.11.0 eslint-plugin-jsx-a11y ^5.1.1 → ^6.0.2 apollo-server-koa ^1.0.5 → ^1.1.0 react-apollo ^1.4.8 → ^1.4.14 react-redux ^5.0.5 → ^5.0.6 react-router ^4.1.1 → ^4.1.2 react-router-dom ^4.1.1 → ^4.1.2 redux ^3.7.1 → ^3.7.2 babel-core ^6.25.0 → ^6.26.0 babel-plugin-transform-object-rest-spread ^6.23.0 → ^6.26.0 babel-plugin-transform-regenerator ^6.24.1 → ^6.26.0 babel-polyfill ^6.23.0 → ^6.26.0 cross-env ^5.0.4 → ^5.0.5 css-loader ^0.28.4 → ^0.28.5 eslint-plugin-react ^7.1.0 → ^7.2.1 html-webpack-plugin ^2.29.0 → ^2.30.1 less-loader ^4.0.4 → ^4.0.5 postcss-nested ^2.1.0 → ^2.1.2 progress-bar-webpack-plugin ^1.9.3 → ^1.10.0 webpack ^3.4.1 → ^3.5.5 webpack-bundle-analyzer ^2.8.2 → ^2.9.0 webpack-config ^7.0.0 → ^7.2.1 webpack-dev-server ^2.6.1 → ^2.7.1 webpack-manifest-plugin ^1.2.1 → ^1.3.1
- Fixes production server run error introduced by when diagnosing #55
- Fixes docker image building
- Bumps packages:
- "cross-env": "^5.0.4"
- "eslint": "^4.4.1"
- "chalk": "^2.1.0"
Kit v2 introduces a few significant improvements that make it easier to upgrade between kits, and power-up your ReactQL experience:
React has been bumped to the new v16, and renderToString
has been replaced with renderToStream
-- for turbo-powered first page rendering of React to HTML.
Early tests have shown a promising reduction from 12ms+ for React-only rendering (no GraphQL) to 4-5ms on my local Macbook Pro, using out-the-box defaults.
What's more, on Node 8+, the asynchronous createReactHandler
that sets up the Redux store, runs Helmet, initialises the component tree and starts the stream, has been benchmarked as low as 0.48ms on my same machine!
Your ReactQL project will be faster than ever.
In kit v1.x, the lines between ReactQL and your client code were a little blurry. Editing the Apollo endpoint meant modifying config/project.js
, which was a file that Webpack also used to assess whether to show the bundle optimiser post-build.
If you wanted to add anything more to the server or browser, you'd typically need to delve into kit/*
files and make changes.
Now, the separation between two is clearer than ever. ReactQL v2.x introduces a new Config
singleton instance that provides 'hooks' into adding functionality to the standard config, without mashing together custom code.
ReactQL is and always has been a 'starter kit', and will continue to be so. But now the framework-esque separation of client and kit code paves the way to clean abstractions, and easier upgrading.
In a future ReactQL CLI version, it's possible that you'll be able to upgrade an active project to the latest kit with a single command, instead of the current process of creating a new project, copying over src
and manually/surgically editing kit files.
ReactQL was originally focused on being a front-end starter kit. But the effort put into creating a fast and capable SSR stack means you now also have an ideal home to run a monolithic GraphQL server, too.
Starting with 2.0, you're now able to add a GraphQL server easily, by add a few lines of code to src/app.js
:
src/app.js
// Import the new `Config` singleton instance
import config from `kit/config`;
// Enable GraphQL on the server -- this code will be eliminated from the browser bundle
if (SERVER) {
config.enableGraphQLServer(require('src/path/to/schema').default);
}
That's it!
The above mounts a GraphQL server inside Koa at /graphql
, gives you a visual UI to query data via GraphiQL, and sets up Apollo to point to the server URI automatically. It takes care of your server-side CORS config, and adds POST body processing for incoming GraphQL queries.
It also adds apollo-local-query to Apollo client initialisation on the server, so instead of routing requests over the network, GraphQL queries are made against the schema already loaded in memory -- eliminating TCP/IP overhead.
Of course, if you want to connect to a third-party endpoint, you can still do that easily:
config.setApolloURI('http://example.com/graphql');
(Special thanks to graph.cool for allowing us to use their service in the starter kit in 1.x. Hopefully the move above will also take some load off your server 😄)
With the new Config
API, you no longer need to edit kit/lib/redux.js
to add custom reducers.
Instead, you can add them to src/app.js
and keep reducers in userland:
import config from `kit/config`;
// Create a reducer somewhere, shaped as { state, reducer() } -- this will
// probably be imported from a separate file
const someReducer = {
// This is the reducer's initial state
state: {
someSetting: true,
},
reducer(state, action) {
// ... reducer code to do something with `state`
}
}
// Add the reducer, and specify the reducer key
settings.addReducer('someKey', someReducer);
You can now add custom GET|POST|PUT|PATCH routes to the server, like so:
// We can add custom routes to the web server easily, by using
// `config.add<Get|Post|Put|Patch>Route()`. Note: These are server routes only.
config.addGetRoute('/test', async ctx => {
ctx.body = 'Hello from your ReactQL route.';
});
Routes will be added in insertion order, to obey your precedence rules.
koa-bodyparser
is enabled by default, to process POST requests for a built-in GraphQL server or custom POST routes.
By default, it'll process JSON and form requests automatically.
You can disable with:
config.disableBodyParser();
Or pass in your own custom options to koa-bodyparser
with:
config.setBodyParserOptions({
// Example of a config option -- see https://github.com/koajs/bodyparser
jsonLimit: '8mb',
})
The custom 404 handler added in 2.0 is one of several planned API 'hooks' that allow you to attach custom functionality to common server and browser entry points, without editing kit code.
This example ships in the starter kit:
config.set404Handler((ctx, store) => {
// For demo purposes, let's get a JSON dump of the current Redux state
// to see that we can expect its contents
const stateDump = JSON.stringify(store.getState());
// Explicitly set the return status to 404. This is done for us by
// default if we don't have a custom 404 handler, but left to the function
// otherwise (since we might not always want to return a 404)
ctx.status = 404;
// Set the body
ctx.body = `This route does not exist on the server - Redux dump: ${stateDump}`;
});
You get access to the Koa ctx
request context object as well as the Redux store
, giving you the flexibility to handle responses in whichever way makes the most sense for your application.
In future kits, expect hooks to crop up in places like redirect and error handling.
The out-the-box sample app that comes with a new ReactQL project is now better organised. Instead of a single src/app.js
file, components have been given their own files/folders, and tons of extra commentary has been added to give you a better idea of what's happening under the hood.
Whilst src/app.js
is still required in every project (that's where ReactQL will look for your app code), now the file should serve two simple purposes:
- Configuring the app, per the new features above.
- Exporting the root React component, to mount automatically inside
<Html> -> <div id="main"/>
This best practice will make it easier to organise your code, and know what goes where.
Several components also demonstrate the pattern of asset co-location; images and SASS code is often in the same directory as the calling .js
file, to make it clear which assets belong to which React components.
v2.0 documentation will land on https://reactql.org/docs soon.
All changes:
- Removes moot
config/project.js
- Adds new
Config
class tokit/config.js
, initialised as a singleton to use globally insrc/app.js
- Adds the following new methods:
addReducer(key, reducer)
-- adds a new Redux reducer in the shape of{state, reducer()}
disableBodyParser()
-- disableskoa-bodyparser
in the server configsetBodyParserOptions(opt)
-- pass customkoa-bodyparser
options to override defaultsaddRoute(method, route, handler)
-- add new Koa routeaddGetRoute(route, handler)
-- add new GET routeaddPostRoute(route, handler)
-- add new POST routeaddPutRoute(route, handler)
-- add new PUT routeaddPatchRoute(route, handler)
-- add new PATCH routeaddDeleteRoute(route, handler)
-- add new DELETE routeset404Handler(func)
-- sets a custom 404 handler, which is given(state, store)
insidecreateReactHandler()
enableGraphQLServer(schema, endpoint = '/graphql', graphiql = true)
-- enables built-in GraphQL web server at/graphql
, (optionally) enables up GraphiQLsetGraphQLEndpoint(uri)
-- sets the GraphQL server URI for Apollo. For use with external GraphQL servers.
- Replaces ReactDOM's deprecated
render
with the newhydrate
method, for rehydrating server HTML.
- Bumps to React v16's streaming API.
- React's
data-reactid
tags no longer appear in resulting HTML, saving bandwidth - Adds GraphQL server configuration
- Adds GraphiQL UI option when using a local GraphQL server
- Adds
apollo-local-query
, for bypassing the network when using a local GraphQL server - Adds
createNeworkInterface()
, for memoizing network interface creation on the server - Refactors React to use
renderToStream
instead ofrenderToStaticMarkup
- Refactors
<Html>
component to take component tree as a child prop, and not as a rendered string - Adds custom route configuration
- Adds
kcors
to allow cross-origin requests by default (for REST/GraphQL)
- Removes
serverClient()
method inkit/lib/apollo.js
, to avoid unnecessaryapollo-local-query
bundling on the browser - Improves
getURL()
inkit/lib/env.js
, to allow a boolean flag to enable HTTPS - Adds
getServerURL()
tokit/lib/env.js
, to explicitly get the web server host and port (typically for GraphQL) - Refactors
kib/lib/redux.js
to derive config from theconfig.reducers
Map
- Adds new
npm run build-analyze
option, to open a browser window showing the bundle analysis report after building - Removes explicit
BUNDLE_ANALYZER
config option -- now uses the above command
- Refactors app code to tidy up the
src
folder - Gives each component its own file/folder layout, with images/CSS co-located
- Adds tons of extra commentary to make it clearer how each component works
- Moves
<root>/reducers
tosrc/reducers
, to reflect best practices - Refactors counter reducer to use the new
{state, reducer()}
reducer shape (now exported bare; no longer attached to a reducer key) - Refactors SASS/CSS to use separate files to be imported by components, instead of together in one file
- Fixes spacing issues being reported in ESLInt 4.0
- Shaves 9kb off
vendor.<hash>.js
bundle (383kb -> 374kb... 107kb gzipped... 90.9kb Brotli!)
- Adds packages:
- "apollo-local-query": "^0.3.0",
- "apollo-server-koa": "^1.0.5",
- "graphql": "^0.10.5"
- "kcors": "^2.2.1"
- "koa-bodyparser": "^4.2.0"
- Bumps packages:
- "eslint": "^4.3.0"
- "serve": "^6.0.6"
- "react": "^16.0.0-beta.3"
- "react-dom": "^16.0.0-beta.3"
- Static bundling via
npm run build-static
builds an an invalid<script>
include for the Webpack manifest, pending reactql/kit#55
- Refactors inline image and font file regex to
kit/webpack/common.js
- Fixes image/font file loading, when importing from an NPM package
- Adds
--inspect
to server fork in development, to enable debugging
- Moves sass
sourceMap
option to neweroptions
object
- Bumps packages: brotli-webpack-plugin ^0.3.0 → ^0.4.0 boxen ^1.1.0 → ^1.2.1 react-apollo ^1.4.3 → ^1.4.8 chunk-manifest-webpack-plugin ^1.1.0 → ^1.1.2 eslint-config-airbnb ^15.0.2 → ^15.1.0 eslint-plugin-babel ^4.1.1 → ^4.1.2 iltorb ^1.3.3 → ^1.3.5 postcss-nested ^2.0.2 → ^2.1.0 serve ^6.0.2 → ^6.0.3 webpack ^3.1.0 → ^3.4.1 webpack-dev-server ^2.5.1 → ^2.6.1 webpack-manifest-plugin ^1.1.2 → ^1.2.1
- Fixes
url()
imports in CSSNano, by disablingnormalizeUrl
- Fixes global CSS/Sass/LESS RegEx check
- Merges #49 - browser window now automatically opens on
npm start
- Removes
compression-webpack-plugin
in favour ofzopfli-webpack-plugin
- Bumps packages extract-text-webpack-plugin ^2.1.2 → ^3.0.0 postcss-cssnext 3.0.0 → 3.0.2
boxen ^1.1.0 → ^1.2.0 react-router ^4.1.1 → ^4.1.2 react-router-dom ^4.1.1 → ^4.1.2 redux ^3.7.1 → ^3.7.2 postcss-nested ^2.0.2 → ^2.0.4 webpack ^3.1.0 → ^3.3.0 webpack-bundle-analyzer ^2.8.2 → ^2.8.3
- Enables scope hoisting
webpack.optimize.ModuleConcatenationPlugin
-- shaves a few KB of the vendor bundle size
- Bumps packages: postcss-cssnext 2.11.0 → 3.0.0 react-apollo ^1.4.2 → ^1.4.3 babel-preset-env ^1.5.2 → ^1.6.0 eslint-config-airbnb ^15.0.1 → ^15.0.2 eslint-plugin-import ^2.6.1 → ^2.7.0 iltorb ^1.3.2 → ^1.3.3 serve ^6.0.0 → ^6.0.2 webpack ^3.0.0 → ^3.1.0 webpack-dev-server ^2.5.0 → ^2.5.1 webpack-manifest-plugin ^1.1.0 → ^1.1.2
- Reverts back to ESLint v3, to avoid Airbnb syntax issues (fixes #44)
- Reverts to
eslint-plugin-jsx-a11y
^5.1.0, fixing ESLint v3 issues
- Adds
jest
test runner (currently no tests) - Adds
npm test
option topackage.json
- Adds
.travis.yml
for building and testing lint status via Travis-CI
- Removes Uglify2 compression options, to avoid edge cases in NPM packages
- Bump to Webpack v3 and latest versions (shaves 12.2% off the default vendor build sizes)
- Bumps versions: chalk ^1.1.3 → ^2.0.1 eslint ^3.19.0 → ^4.1.1 eslint-plugin-jsx-a11y ^5.0.3 → ^6.0.2 serve ^5.2.2 → ^6.0.0 webpack ^2.6.1 → ^3.0.0 koa ^2.2.0 → ^2.3.0 redux ^3.7.0 → ^3.7.1 babel-loader ^7.1.0 → ^7.1.1 eslint-import-resolver-webpack ^0.8.1 → ^0.8.3 eslint-plugin-import ^2.3.0 → ^2.6.1 graphql-tag ^2.4.0 → ^2.4.2 html-webpack-plugin ^2.28.0 → ^2.29.0 resolve-url-loader ^2.0.3 → ^2.1.0
- Fixes #35 - image optimiser binaries are now built successfully
- Reverts to ESLint v3.19.0 pending airbnb/javascript#1447
- Removes redundant
OccurrenceOrderPlugin
(on in default in Weback v2) - Updates
module.loaders
->module.rules
, andloaders.loaders
->rules.use
- Bumps packages: "babel-core": "^6.25.0" "babel-loader": "^7.1.0" "babel-preset-env": "^1.5.2" "cross-env": "^5.0.1" "eslint-plugin-compat": "^1.0.4" "eslint-plugin-react": "^7.1.0", "extract-text-webpack-plugin": "^2.1.2", "file-loader": "^0.11.2", "graphql-tag": "^2.4.0" "less-loader": "^4.0.4" "resolve-url-loader": "^2.0.3" "sass-loader": "^6.0.6", "serve": "^5.2.2", "style-loader": "^0.18.2" "webpack-dev-server": "^2.5.0" "koa-helmet": "^3.2.0", "koa-router": "^7.2.1" "react": "^15.6.1", "react-apollo": "^1.4.2", "react-dom": "^15.6.1" "redux": "^3.7.0"
- Improves sourceMap handling in
postcss-loader
per the fix at webpack-contrib/postcss-loader#250
- Bumps packages: "postcss-loader": "^2.0.6"
- Refactors
kit/lib/redux.js
to provide a pattern for adding custom reducers outside of Apollo - Adds
reducers/counter.js
sample reducer, for incrementing a counter - Adds
<ReduxCounter>
example tosrc/app.js
for triggering an increment action and listening for store changes - Adds
react-redux
, for passing Redux store state to React via props - Adds
redux-thunk
, for allowing custom actions that return functions, giving them access todispatch
related actions - Adds
seamless-immutable
, for enforcing immutability in custom Redux state
- Bumps to ESLint v4 (from v3.19)
- Adds packages "react-redux": "^5.0.5" "redux-thunk": "^2.2.0", "seamless-immutable": "^7.1.2"
- Bumps packages: "eslint": "^4.0.0"
- Fixes issue in
kit/lib/env.js
, whereisProduction
was always returningfalse
- Adds
Dockerfile
, for building a production web server Docker image - Adds
.dockerignore
, copied from the existing.gitignore
to avoid unnecessary build context
- Removes
yarn.lock
-- the official advice is to avoid Yarn at present, due to certain third-party NPM packages relying on 'postinstall' hooks to build binaries from source - Adds
package-lock.json
, for faster builds with NPM v5 - Explicitly adds
iltorb
andnode-zopfli
, binary packages required for Brotli and Zopfli compression respectively - Adds packages: "iltorb": "^1.3.1" "node-zopfli": "^2.0.2"
- Adds
graphql-tag
loader, for storing queries in.gql|graphql
files (closes #32) - Refactors
src/app.js
to use file queries - Adds
src/queries/all_messages.gql
, for retrieving GraphCool endpoint messages - Adds
src/queries/message.gql
, imported byall_messages.gql
as a query fragment
- Adds
graphql-tag
loader config tokit/webpack/base.js
- Adds packages: "graphql-tag": "^2.2.1"
- Replaces
cheap-module-source-map
withsource-map
in development, for compatibility with CSS - Adds
sourceMap
option tocommon.css.getExtractCSSLoaders()
- Adds React ignore for the following props:
dispatch
, for less Redux boilerplatedata
, injected by Apollo
- Removes redundant
kit/lib/apollo.js -> mergeData()
function
- Adds more complete
kit/lib/env.js
, with functions for getting browser/server-specific host/ports
- Adds
kit/lib/env.js
, for determining local environment settings - Adds
getHost()
,getPort()
andgetURL()
tokit/lib/env.js
to detect where the local server is/will be spawned on - Updates Webpack and
kit/entry/server_*.js
configs to use dynamic environment host/port/URL - Adds development/production env vars to webpack builds, to provide context to Webpack
- Replaces
concurrently
withnpm-run-all
, to avoid errors in NPM v5.0.0 when terminating with Ctrl/Cmd + C - Removes packages: "concurrently": "^3.4.0"
- Adds packages: "npm-run-all": "^4.0.2"
- Adds 301/302 redirect handling (issues
Location:
header to new URL) - Adds 404 Not Found handling; by default, just sets a 404 status code
- Adds sample
<Redirect>
handler, from /old/path to /new/path - Adds fall-through 404 handler, when no routes are matched
- Fixes edge case where
<script defer>
tags inkit/views/ssr.js
could cause manifest/vendor/browser files to load in the wrong order - Adds Brotli compression - builds
.br
versions of static assets in production - Adds
staticMiddleware()
tokit/entry/server.js
for serving static file assets - Replaces
koa-static
middleware with a direct call to parentkoa-send
- Bumps to PostCSS v6 by removing inline Webpack config
-
Removes packages: "koa-static": "^3.0.0"
-
Adds packages: "brotli-webpack-plugin": "^0.3.0" "koa-send": "^4.1.0"
-
Bumps packages: "babel-preset-env": "^1.5.1" "css-loader": "^0.28.4" "eslint-plugin-compat": "^1.0.3" "eslint-plugin-import": "^2.3.0" "eslint-plugin-jsx-a11y": "^5.0.3" "node-sass": "^4.5.3" "style-loader": "^0.18.1" "webpack": "^2.6.1" "webpack-bundle-analyzer": "^2.8.2" "koa-router": "^7.2.0" "react-helmet": "^5.1.3"
- Replaces
gzip
withzopfli
compression on Webpack build assets (up to 5% better compression) - Adds
npm run build-browser
script, for generating just a production browser bundle
- Fixes #30 - code splitting now works on both the dev and production web server
## Linting
- Fixes #24 - ESLint works with latest Atom ESLinter, bypasses the need for Webpack and
babel-register
, and speeds up linting. - Removes
kit/webpack/eslint.js
- which is now moot
- Closes #4 - Introduces server development bundling. Now running
npm start
bundles both a hot-reloading browser bundle, and a spawns server-side rendering that reloads upon code changes. - Adds
distDev
route to paths, for server development bundled assets - Adds
kit/webpack/server_dev.js
Webpack config for building and launching a development server - Adds separate
kit/webpack/server_prod.js
Webpack config for building production server bundle - Refactors
kit/entry/server.js
for working in both dev/production - Adds console messages to show server start-up info, including network IP and ports
- Fixes
__dirname
in the built server bundle, so thatdist/server.js
can be run from anywhere (mentioned in / fixes leebenson/reactql#36)
- Adds
kit/lib/console.js
andlogServerStarted()
function, for dumping neat console messages to the screen when starting servers - Adds
kit/lib/routing.js
, with<Status>
(internal),<NotFound>
and<Redirect>
components for handling status codes, 404s and redirects, universally.
- Adds ability to use multiple webpack-configs in a given config file, by exporting as an array
- Tidies up
kit/webpack/base
with common stats; fixes path typo - Adds
kit/webpack/dev.js
, which is extended by server_dev and browser_dev and adds the correct env vars and source-maps. - Closes #22 - Adds static bundling. Now you can run
npm run build-static
to create a production browser bundle along with anindex.html
file, for uploading to a static web host - Adds
npm run build-static-run
, for static bundling and running the static site locally on port 5000 - Adds
npm run static
, for running an already built static bundle - Refactors
kit/webpack/browser_prod.js
to add console messages; fixes minor chunk hash typo - Adds
css.getDevLoaders()
andcss.getExtractCSSLoaders()
helper functions tokit/webpack/common.js
, for CSS configs that work across multiple configs - Adds
stats
tokit/webpack/common.js
, for a common output format that shows built assets, errors and warnings, with minimal clutter
- Adds packages: "concurrently": "^3.4.0" "serve": "^5.1.5" "boxen": "^1.1.0", "chalk": "^1.1.3", "ip": "^1.1.5"
- Removes redundant packages: "babel-register": "^6.24.1" "node-noop": "^1.0.0" "promise-monofill": "^1.0.1"
- Re-orders packages so that they correctly appear within
devDependencies
ordependencies
- Refactors
npm run...
commands as follows: "browser": Runs hot-reloaded Webpack dev server for the browser on port 8080 "build": Builds production bundles for server and browser "build-run": Builds production bundles, and runs a live web server "build-static": Builds a production browser bundle andindex.html
, for hosting statically "build-static-run": Builds static bundle, and runs it locally on port 5000 "clean": Removesdist
folder and contents "lint": Runs ESLint on project source code "server": Runs a previously build production web server "server-dev": Runs a development web server on port 8081 (restarts automatically on code changes) "start": Starts both a development web server and a hot-reloadable browser Webpack dev server (ports 8081/8080 respectively) "static": Starts a static web server on port 5000 for a previously built static bundle "test": Currently does nothing. TBD.
- Adds 404 route handling (currently a blank response - but 404 codes can be implemented at the server level to be handled by middleware, or respond appropriately; redirects TBD.)
- Adds
npm run build-browser-only
option, which createsindex.html
alongside regular JS and CSS browser bundling. Useful for static hosts or via a BYO web server. - Adds provisional
postcss.config.js
, for upcoming PostCSS v6.0 (note: not implemented yet; CSSNext currently awaiting MoOx/postcss-cssnext#374) - Fixes PostCSS source maps in development
- Adds
HOST
environment var for overridinglocalhost
default - Adds
Running on http://localhost:4000/
default message when server starts (or whatever the correctHOST
andPORT
are) - Bumps NPM packages: "cross-env": "^5.0.0", "css-loader": "^0.28.1", "eslint-config-airbnb": "^15.0.0", "eslint-plugin-jsx-a11y": "^5.0.1", "eslint-plugin-react": "^7.0.1", "image-webpack-loader": "^3.3.1", "node-noop": "^1.0.0", "postcss-cssnext": "2.11.0", "postcss-loader": "^2.0.5", "postcss-nested": "^2.0.2", "promise-monofill": "^1.0.1", "sass-loader": "^6.0.5", "style-loader": "^0.18.0", "webpack": "^2.5.1", "webpack-bundle-analyzer": "^2.8.1", "webpack-dev-server": "^2.4.5", "webpack-node-externals": "^1.6.0"
- Bumps
yarn.lock
- Merges #25 - .editorconfig ESLint fix eol-last
- Closes #33 - Webpack config options are not specified by
WEBPACK_CONFIG
inpackage.json
- Adds CSSNano, for optimising resulting stylesheet code via PostCSS
- Adds extensible
css-loader
defaults tokit/webpack/common.js
- Fixes
src/styles.css
to use SASS-style nesting of elements - Bumps
yarn.lock
- Bumps NPM: chunk-manifest-webpack-plugin ^1.0.0 → ^1.1.0 webpack-dev-server ^2.4.3 → ^2.4.4
- Adds '.global.(css|scss|sass|less)' loaders, making it trivial to separate 'localised' and global styles
- Fixes ESLint'ing to allow
for...of
, correctly filtering out the Airbnb restriction - Adds
postcss-nested
, to allow SASS-style nesting on plain CSS - Adds
kit/webpack/common.js
for shared configuration between Webpack files - Refactors style loading in Webpack files targeting all environments
- Fixes
prop-types
warning generated byreact-apollo
by bumping to 1.1.0 - Adds global style to
src/styles.global.css
- Refactors class names with original name, prepended to the base64 hash
- Updates
yarn.lock
- Bumps NPM packages: react-apollo ^1.0.1 → ^1.1.0 babel-eslint ^7.2.1 → ^7.2.3 babel-loader ^7.0.0-beta.1 → ^7.0.0 webpack-dev-server ^2.4.2 → ^2.4.3
- Optimises
window.*
initial variables on SSR by removing whitespace - Allows passing a
window
prop to<Html>
on SSR, instead of separate props forwebpackManifest
/state
- Moves
manifest.json
andchunk-manifest.json
todist
instead ofdist/public
(stops them being accessible publicly) - Fixes issue with manifest paths not working on non-root routes
- Closes #1 - Adds
/favicon.ico
route handling-- if an icon is available, it'll be served. Otherwise, the server will return "204 No Content" - Adds sample ReactQL favicon at
static/favicon.ico
- Moved
static/webpack.html
default page for the Webpack Dev Server tokit/views/webpack.html
, to emphasise thatstatic
is userland - Improves Webpack Dev Server config to check
static/*
first, and thenkit/views/*
when looking for static files (i.e. thewebpack.html
default view) - Adds
CopyWebpackPlugin
to production--static/*
will be copied todist/public/*
to make static files available to the production server
- Adds decorator syntax via transform-decorators-legacy
- Adds static class properties transform-class-properties
- Adds support for extending
React.PureComponent
without generating linting errors (when using props/context) - Modifies sample
<GraphQLMessage>
component insrc/app.js
to use@graphql
as a decorator and staticpropTypes
- Merges #8 - removes deprecation warning related to loaderUtils.parseQuery()
- Merges #7 - bumps NPM packages
- Adds
CHANGELOG
- Adds
README.md
- Adds
process.env.NODE_ENV === 'production'
to server Webpack config, for SSR minification (React in particular)
- Initial kit -- all starter kit code provided up to CLI version 2.2.0