Universal React+GraphQL starter kit: React 16, Apollo 2, MobX, Emotion, Webpack 4, GraphQL Code Generator, React Router 4, PostCSS, SSR
Re-adds .nvmrc
(v12.2.0)
Bumps Node to v12.2
Fixes Dockerfile
Replaces MobX with MobX React Lite - compatible with hooks!
Replaces ts-loader
with Babel 7 Typescript preset
Refactors tsconfig.json
and imports to use module interop (e.g. no more import * as...
)
Removes src/data
folder; routes are now defined directly in components, and store data is added via MobX in React hooks
Adds NPM packages: "@babel/plugin-proposal-class-properties": "^7.4.4" "@babel/plugin-proposal-object-rest-spread": "^7.4.4" "@babel/preset-react": "^7.0.0" "@babel/preset-typescript": "^7.3.3" "mobx-react-lite": "^1.3.2"
Bumps NPM packages: "mobx": "^5.9.4"
@types/ora
@emotion/styled ^10.0.10 → ^10.0.11 dotenv ^7.0.0 → ^8.0.0 graphql ^14.2.1 → ^14.3.0 react-apollo ^2.5.4 → ^2.5.5 react-helmet ^5.2.0 → ^5.2.1 react-hot-loader ^4.8.3 → ^4.8.4 @babel/core ^7.4.3 → ^7.4.4 @graphql-codegen/cli ^1.0.6 → ^1.1.3 @graphql-codegen/fragment-matcher ^1.0.6 → ^1.1.3 @graphql-codegen/typescript ^1.0.6 → ^1.1.3 @graphql-codegen/typescript-operations ^1.0.6 → ^1.1.3 @graphql-codegen/typescript-react-apollo ^1.0.6 → ^1.1.3 @types/lodash ^4.14.123 → ^4.14.126 @types/node ^11.13.0 → ^12.0.0 @types/prop-types ^15.7.0 → ^15.7.1 @types/react ^16.8.12 → ^16.8.17 @types/react-dom ^16.8.3 → ^16.8.4 @types/react-router-dom ^4.3.1 → ^4.3.3 @types/webpack ^4.4.27 → ^4.4.31 husky ^1.3.1 → ^2.2.0 koa-webpack ^5.2.2 → ^5.2.3 less-loader ^4.1.0 → ^5.0.0 lint-staged ^8.1.5 → ^8.1.6 mini-css-extract-plugin ^0.5.0 → ^0.6.0 node-sass ^4.11.0 → ^4.12.0 prettier ^1.16.4 → ^1.17.0 source-map-support ^0.5.11 → ^0.5.12 ts-loader ^5.3.3 → ^6.0.0 ts-node ^8.0.3 → ^8.1.0 tslint ^5.15.0 → ^5.16.0 typescript ^3.4.2 → ^3.4.5 webpack ^4.29.6 → ^4.31.0
createBrowserHistory
import@types/ws
@types/graphql
bufferutil
react-apollo
-> 2.5.4react-hot-loader
-> 4.8.3utf-8-validate
incremental: true
TS config optionwebpack-node-externals
, in favour of building a single server.js
bundleLOCAL_STORAGE_KEY
to .env
, to allow saving/retrieving MobX store state to localStorage
on the clientschema/schema.graphql
, with sample schema for Hacker News stories<StateConsumer>
as new withStore()
HOC in @/lib/store.ts
<HackerNews>
example to use the new auto-generayed <GetHackerNewsTopStories.Component>
@/data/state.ts
-> @/data/store.ts
(now exports Store
class)autosave
and new rehydrate
funcs in @/lib/store.ts
, for saving and retrieving MobX state to/from localStorage
@/entry/client.tsx
with new MobX store hydration/auto-save@/entry/server.tsx
with new MobX store@/graphql/index.tsx
with query and HOC for getting top HackerNews stories@/lib/mobx.ts
koa2-history-api-fallback
package in favour of a local functionHOST
to .env
and common.host
in runner to allow binding to non-localhost
react-dom
alias to Webpack common config, to use @hot-loader/react-dom
__APOLLO_STATE__
-> __APOLLO__
, for Apollo GraphQL rehydration on the clientstore
to createClient()
, for use-cases where store data is needed inside GraphQL requests (JWTs, etc)adds exit signal 0
to SIGINT
interrupts, to avoid incorrectly interpretting CTRL/CMD+C as a failure
adds new RUNNER
variable in NPM scripts for determining which Webpack runner to load
refactors index.ts
to use runners; implements sanity checks to ensure RUNNER
is set, and an associated .ts
file exists
adds "Static bundling for client-only SPAs" section to readme
adds "NPM commands" section to readme
updates readme to reflect new project layout and NPM command options
removes console log statement in the State.increment()
method when using the supplied example component
adds devServer()
function to src/runner/app.ts
, for adding Koa handlers when spawning a dev server in regular or static mode
updates src/runner/static.ts
to add a new dev option
fixes formatting error for scripts in src/views/static.html
removes BrotliCompression
type definitions in favour of a require()
statement, to avoid newer Typescript syntax issues
adds Prettier formatting to several misc. type files
adds history API fallback middleware to static dev server, for client-side SPA routing
refactors React DOM hooks to use render()
when <div id="root">
is empty, for static bundling
adds NPM packages: "@types/webpack-dev-server": "^3.1.1" "koa2-history-api-fallback": "0.0.5"
bumps NPM packages: "@types/koa-router": "^7.0.39" "@types/react": "^16.7.21" "@types/webpack": "^4.4.24" "brotli-webpack-plugin": "^1.1.0" "ts-node": "^8.0.2"