Skip to content
This repository has been archived by the owner on Jan 26, 2020. It is now read-only.

Less Code & A Beautiful API

Compare
Choose a tag to compare
@alidcast alidcast released this 11 Jul 04:38
· 88 commits to master since this release

Ultra Breaking Changes

  • No longer calling getInitialProps for Routes #42 #6. It's primarily meant for querying data or redirecting, both of which are handled by Apollo Graphql and React Router, respectively. This change simplified codebase since we only have to walk component tree to App.js component.

Fixes / Changes

  • Hocs now wrap each other's getInitialProp methods. This fixes problem with initilizing hocs before App.js component. #47
  • Now bundling code #46 #2, so we don't need to pass Helmet or LoadableComponents anymore as params
  • Handle router redirects in server #48

Other Improvements

  • Since we now bundle roguejs/app code, we also refactored it to typescript

Quick glance at new API:

// App.js
export default () => 'Hello World!'

// client.js
import { hydrate } from '@roguejs/app'
import App from './App'

hydrate(App)

// server.js
import Rogue from '@roguejs/app/server'
import http from 'http'
import App from './App'

const app = new Rogue(App)

http.createServer(app.render).listen(3000)