A project starter for universalmorphic React/Redux apps
- React: THE component-based view library.
- Redux: application state management
- React-Redux Official Bindings: remove the boilerplate code when connecting React to Redux
- React Router: server/client side application router
- Redux Thunk: easier async and sequential actions.
- React Helmet: title and meta tags FTW
- ExpressJS: server-side app framework.
- WebPack: module bundler.
- PostCSS: CSS transformations via JS
- CSS Modules: private name spaces for css classes.
- CSSNext: future CSS today.
- React StoryBook: a component authoring sandbox. also component functional testing .
- Jest: unit testing and coverage reporting
- Eslint: JS linting.
- first, run
npm ito install dependencies - to start the component dev environment, run
npm run components - to start the application dev environment, run
npm run dev - to lint the JS, run
npm run lint - build the production app via
npm run build - start the app via
npm start
- The React / Redux app is found in src/app
- The production Express.js server is found in src/server
- Component stories (for the component dev environment) are found in .storybook/config.js
- Do I need a particular version of
npm?- Please use
npmversion 3 or higher.
- Please use
- Why do you have
package.jsonfiles in your Component directories?- Placing a
package.jsonfile with a propermainproperty allows you toimportthat code by referencing only the parent folder. Example:import LandingView from '../views/LandingView';. This gives you the flexibility of refactoring the Component without changing the consumingimports.
- Placing a
- My editor/linter claims the
package.jsonfiles in the Component directories are missing thenameandversionproperties.- According to the specification,
nameandversionare both required properties of apackage.jsonfile. However, they are not necessary in this context because we are not publishing the Components separate from the project. We chose to have minimalpackage.jsonfiles. Please feel free to add the missing values if this bothers you or your linter enough that you or your linter can't get past it.
- According to the specification,
- How do I allow node modules to be processed by webpack (for example, be processed by babel)?
- There is a whitelist array in the file
webpack.server.babel.jswhich allows packages to be processed by webpack if they are included. To add a package calledmy-foo-bar, the array would bewhitelist: ['normalize.css', 'my-foo-bar]. To include all packages under a certain namespace, you can use a regular expression test. For example, to add all packages under@foo, your array would bewhitelist: ['normalize.css', /^[@]foo/]
- There is a whitelist array in the file