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

Commit

Permalink
updated documentation, removing cli, loadable-components and changing…
Browse files Browse the repository at this point in the history
… from 'framework' to 'library'
  • Loading branch information
alidcast committed Dec 9, 2018
1 parent e7d208d commit 04433dd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 57 deletions.
11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

Rogue streamlines the process of creating server-rendered React applications.

We call Rogue a _nearly invisible_ framework, because it doesn't require a special `/pages` directory (like Nextjs) or a separate `routes.js` file (like Afterjs); all you need, is the `App.js` entry point you'd usually have. This means that you can wrap your app in layouts/transitions/providers, etc. the same way you would in a regular React Application, and staying true to React's values, you can organize your code however you like.
We call Rogue a _nearly invisible_ library, because it doesn't require a special `/pages` directory (like Nextjs) or a separate `routes.js` file (like Afterjs); all you need, is the `App.js` component you'd usually have. This means that you can wrap your app in layouts/transitions/providers, etc. the same way you would in a regular React Application, and staying true to React's values, you can organize your code however you like.

We're able to give you back control of your application, because we leverage the elegance of [React Router](https://github.com/ReactTraining/react-router/) (for dynamic routing) and [Apollo Graphql](https://github.com/apollographql/apollo-client) (for querying data), which together dispense with the need to split your server-rendered routes into distinct entry points. With these tools, everything already happens on a per component basis, so we just handle the server-rendering setup for you.

Expand Down Expand Up @@ -38,17 +38,16 @@ app.listen(3000)

## Packages

There are three Rogue packages:
There are two Rogue packages:

- [`@roguejs/app`](https://github.com/alidcastano/rogue.js/tree/master/packages/rogue-app), holds the core modules for the Rogue framework. You can use this package to streamline your SSR experience independent of any build setup.
- [`@roguejs/app`](https://github.com/alidcastano/rogue.js/tree/master/packages/rogue-app), holds the core modules for the Rogue library. You can use this package to streamline your SSR experience independent of any build setup.
- [`@roguejs/hocs`](https://github.com/alidcastano/rogue.js/tree/master/packages/rogue-hocs), holds
higher order components that come preconfigured with SSR support for Rogue. You can use this package to enhance your application without uncessary SSR boilerplate.
- [`@roguejs/cli`](https://github.com/alidcastano/rogue.js/tree/master/packages/rogue-cli) (WIP), holds the build and development system for the Roguejs framework. You can use this package to power a Roguejs app with zero configuration.

*If you'd like to get started with Rogue now, we recommend you use [`@roguejs/app`](https://github.com/alidcastano/rogue.js/tree/master/packages/rogue-app) with your own custom build setup. Check out the [with-razzle](https://github.com/alidcastano/rogue.js/tree/master/examples/with-razzle) example to get started.*

Each of the above packages holds its respective documentation inside its `README.md`.

The fastest way to get started with Rogue is with [Razzle](https://github.com/jaredpalmer/razzle) (an SSR build tool). Check out the [with-razzle](https://github.com/alidcastano/rogue.js/tree/master/examples/with-razzle) example to see how to get started.

## Author

- Alid Castano ([@alidcastano](https://twitter.com/alidcastano))
Expand Down
57 changes: 6 additions & 51 deletions packages/rogue-app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
- [`getInitialProps`](#getinitialprops-ctx--data--void)
- [App Enhancements](#app-enhancements)
- [Document Tags](#document-tags)
- [Code Splitting](#code-splitting)
- [Custom Enhancements](#custom-enhancements)
- [Custom Server](#custom-server)

Expand Down Expand Up @@ -59,22 +58,15 @@ Rogue doesn't impose any contraints in your applications structure, but we do re

```
/src
/ components # app wide components
/ layouts # page layouts, each one with its own nested components
/ App
/ Navigation
index.js # entry point for App layout (can be imported as src/layouts/App)
/ Auth
/pages # app routes, each one with its own nested routes and components
/pages
/Dashboard
/ NewsFeed
/ PostList
/ Profile
index.js # entry point for Dashboard page (can be imported as src/pages/Dashboard)
index.js
/ Login
/ Register
/ store # app wide state
/ utils # app wide utils
App.js # your universal application
App.js
```

## `rogue` API
Expand Down Expand Up @@ -144,13 +136,9 @@ This data will then be passed to the component exported from your `App.js` file.

## App Enhancements

Rogue makes it easy to enhance your app with functionality.
Rogue makes it easy to enhance your app with ssr compatible functionality.

For some enhancements, if the community already preferred a certain solution or if support for other options just wouldn't have worked (e.g. because it required Webpack), then we made support for them automatic and included them below.

However, for customizations such as state management and CSS-in-JS, where the community is divided on which solution to use, then we made support optional via higher-order components, or hocs. You can find more information about these hocs in our [`@roguejs/hocs`](https://github.com/alidcastano/rogue.js/tree/master/packages/rogue-hocs).

*Note: Make sure to read the respective packages documentation for usage information.*
The only enhancement that comes built-in to Rogue is [document tag management](#document-tags). For common customizations such as state management and CSS-in-JS, we made support optional via higher-order components, or hocs. You can find more information about these hocs in our [`@roguejs/hocs`](https://github.com/alidcastano/rogue.js/tree/master/packages/rogue-hocs).

## Document Tags

Expand All @@ -171,39 +159,6 @@ export default () => (
)
```

### Code Splitting

Rogue has automatic support for code splitting via [loadable-components](https://github.com/smooth-code/loadable-components).

All you have to do is configure your babel to handle the code split files:

```json
// .babelrc
{
"plugins": [
"dynamic-import-node",
"loadable-components/babel"
]
}
```

Now you can code split anywhere in your application. Here's an example:

```js
import { Route } from 'react-router'
import loadable from 'loadable-components'

export const Dashboard = loadable(() => import('./Dashboard'))
export const Landing = loadable(() => import('./Landing'))

export default () => (
<Switch>
<Route exact path="/" component={Dashboard} />
<Route path="/welcome" component={Landing} />
</Switch>
)
```

## Custom Enhancements

With Rogue, you can configure SSR support for any React Provider by using the [`ctx.app`](#getinitialprops-ctx--data--void) object passed to `getInitialProps`.
Expand Down

0 comments on commit 04433dd

Please sign in to comment.