Coder Social home page Coder Social logo

kanuny / rogue.js Goto Github PK

View Code? Open in Web Editor NEW

This project forked from alidcast/rogue.js

0.0 1.0 0.0 512 KB

Rogue.js - a nearly invisible framework for creating server-rendered React applications

License: MIT License

TypeScript 34.61% JavaScript 65.39%

rogue.js's Introduction

Rogue

The "nearly invisible" server-rendering framework for React applications

Introduction

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're able to give you back control of your application, because we leverage the elegance of React Router (for dynamic routing) and Apollo Graphql (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.

As an added benefit, Rogue also comes with first-class support for: State Management (Redux) and Css-in-Js (Emotion / Styled-Components).

But anyway, -- these are just words; and we know the way to your heart is with code, so here's an example of how your server-rendered apps will look going forward:

// 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 App from './App'

const app = new Rogue(App)

app.listen(3000)

Packages

There are three Rogue packages:

  • @roguejs/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/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 (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 with your own custom build setup. Check out the with-razzle example to get started.

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

Author

Inspiration

Liscense

MIT

rogue.js's People

Contributors

alidcast avatar kanuny avatar rayandrew avatar stevefan1999-personal avatar davidjb avatar thompsonemerson avatar gaverdugo avatar isbasex avatar msrahman07 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.