Bot releases are hidden (Show)
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"
Published by leebenson about 7 years ago
publicPath
with extract-text-webpack-plugin
, so that fonts/images are referenced properly in productionPublished by leebenson about 7 years ago
history
instance to kit/lib/routing.js
, for controlling routes outside of React directly<BrowserRouter>
with <Router history={history}>
, to stay in sync with global pushstatePublished by leebenson about 7 years ago
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 neededPublished by leebenson about 7 years ago
.addBeforeMiddleware()
, for adding Koa middleware that runs before Apollo/Redux instantiation.disableTiming()
to optionally remove the Response-Time
header / timing middlewarectx.apollo
to ctx.apollo.client
. Now, setting ctx.apollo.options
in before middleware will merge those settings into Apollo client creationctx.apollo.client
and ctx.store
before using default Apollo/Redux init. This allows overrides in before middleware for completely custom instantiationPublished by leebenson about 7 years ago
npm run build-static
, by replacing broken chunk-manifest-webpack-plugin
(closes #55)src
to modules path, to avoid src/
prefixes at the start of userland imports (closes #69)/
in asset output, to allow defining a <base>
tag in userland via React Helmet (closes #102)jsx-a11y/anchor-is-valid
rule to avoid 'href' on React Router <Link>
attributesfunction-paren-newline
rule to enforce consistent parenthesisobject-curly-newline
rule to allow one-line / multi-line object definitions.disableKoaHelmet()
for disabling koa-helmet on the server (closes #79).setKoaHelmetOptions()
for passing options to Koa Helmet.koaHelmetOptions
and .bodyParserOptions
to null by default/
in bundled assets (along with Webpack) to allow for a <base>
tag to define the load pathbrowserslist
file (merges #95 - thanks @klarstrup)<head>
tags, adds missing html/body attributes, base, link, style, script and noscript, uses new Helmet.renderStatic()
call (closes #101 & #94 - thanks @klarstrup)<base href="/" />
tag, when none is defined with React HelmetDockerfile
to reduce Docker image size from 943mb -> 323mb (closes #98, merges #97 - thanks @kane-c)docker-compose.yml
for production (closes #98)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 SSRPublished by leebenson about 7 years ago
cssnano.config.js
, to fix url()
resolution for cssnano@next
Published by leebenson about 7 years ago
package-lock.json
up to datePublished by leebenson about 7 years ago
## React
ReactDOMServer.renderToStream()
-> renderToNodeStream()
per https://github.com/facebook/react/issues/10294#issuecomment-327903463
Published by leebenson about 7 years ago
cssnano@next
to avoid @font-face
issues from externally imported packagesPublished by leebenson about 7 years ago
process.env.NODE_ENV
in developmentDockerfile
to use HOST
and PORT
env vars, instead of the previous SERVER_PROD_*
Published by leebenson about 7 years ago
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.)
SERVER_DEV_HOST
and SERVER_PROD_HOST
results in the correct GraphQL and app endpointsPublished by leebenson about 7 years ago
config.addRoute()
(and derivatives) accept multiple route handlersPublished by leebenson about 7 years ago
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.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)config.enableSSL(opt)
, for running Koa via a HTTPS/SSL serverconfig.disableHTTP()
, for disabling a plain HTTP server listener (used in conjunction with config.enableSSL()
, when you want SSL-only)config.forceSSL(opts)
, for re-writing plain http://
-> https://
using koa-sslify
http
and https
configurations, for enabling SSLget-port
, for assigning http(s) listeners to random portslisten()
function, for proxying traffic to http(s) depending on the request received (if the first byte == 22 ? SSL : HTTP)kit/entry/server.js
to no longer export an immediate async
function (no longer returns a Promise)kit/entry/server_*
to use the new server.js
default exportconfig.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.src/cert/self_signed.js
, to export a sample self-signed SSL certificate to enable SSL in userlandconfig.enableSSL()
example, for running HTTPS side-by-side with the regular HTTP portconfig.disableHTTP()
and config.forceSSL()
functionsAdds 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
Published by leebenson about 7 years ago
config.setApolloNetworkOptions()
, for passing opts
to Apollo's createNetworkInterface
config.setApolloOptions()
-> config.setApolloClientOptions()
, to differentiate with config.setApolloNetworkOptions()
config.setCORSOptions()
, for setting CORS config options for koa-cors
Published by leebenson about 7 years ago
config.setApolloOptions()
, for passing in an object of Apollo Client instantiation optionscreateLocalInterface
to accept Koa's context object when using local GraphQL schema via apollo-local-query
Published by leebenson about 7 years ago
setErrorHandler()
function, to enable custom error logging/middlewareINCREMENT_COUNTER
action in server middleware, to demonstrate sending count: 1
down the wire via SSRPublished by leebenson about 7 years ago
## Redux
{ 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!)
config.addApolloMiddleware()
config.addApolloAfterware()
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
class to progressively add server-side config functions by moving the class into sub-classes for the browser/serverPublished by leebenson about 7 years ago
ctx
middleware, so it's available to all routesconfig.addMiddleware()
, to add custom middleware to the Koa server## App
Powered-By
header, to showcase custom middlewarectx.store.getStore()
dump to sample /test
and 404 routes, to show the difference in Apollo response