Skip to content
This repository has been archived by the owner on Dec 4, 2018. It is now read-only.

Latest commit

 

History

History
71 lines (53 loc) · 2.64 KB

README.md

File metadata and controls

71 lines (53 loc) · 2.64 KB

respa v0.1.12

NPM version NPM downloads

Respa is a React/Redux based SPA framework, which has already made the hard choices for you and you can keep your code base extremely clean.

The document is WIP, you can refer to the demo, we'll add more examples later. To run the demo:

respa$ cd demo
demo$ yarn install
demo$ yarn respa
demo$ yarn respa dist # build for production

If you're interested in this project please tell me: [email protected]

TODO list

We aim to make respa a production-ready scaffold, maybe more than a scaffold. We'll use it internally before a public release (or never); you're welcome to give it a try and let us know your ideas.

  • React + Redux + webpack
  • Choose from react/preact, less/sass, style-loader/extract-text-plugin by installing in guest app
  • Support global (theme) css styles along with component styles using css-module with BEM classnames
  • Postcss-loader with guest config
  • Action generator to avoid action name conflicts and to reduce bundle size
  • Generate root reducer from a tree like reducer definition
  • Configurable view loader for react component code splitting
  • Latest react-router and history api integration (But I don't like it, might use another solution for this)
  • Rewrite this whole thing using typescript, and let guest app to choose which version (typescript/esm) to build from
  • I18n solution
  • Unit test solution
  • Docs and project site

Respa Project Structure

Asuming that webapp is your code base root. These files are used by respa framework:

webapp/src/
├── index.html   -> the index page template.
├── preboot.js   -> An optional pre-boot script, before the react app is loaded, e.g. login redirect, pre-load user info or app config, etc.
├── actions/     -> all actions created using `respa/createAction`
├── reducers/
│   └── index.js -> export the pre-defined reducer tree.
└── views/
    └── index.js -> the App container including Routes.

Use Respa

Respa must be installed locally in order to make dependencies available.

webapp$ yarn add respa

To start the hot reload dev server:

webapp$ yarn respa # or npx

To build for production:

webapp$ yarn respa build
# or
webapp$ yarn respa dist