react-slingshot

React + Redux starter kit / boilerplate with Babel, hot reloading, testing, linting and a working example app built in

Subscribe to updates I use react-slingshot


Statistics on react-slingshot

Number of watchers on Github 8264
Number of open issues 16
Average time to close an issue 4 days
Main language JavaScript
Average time to merge a PR 1 day
Open pull requests 24+
Closed pull requests 44+
Last commit 11 months ago
Repo Created about 3 years ago
Repo Last Updated 10 months ago
Size 1.69 MB
Organization / Authorcoryhouse
Latest Release7.0
Contributors6
Page Updated
Do you use react-slingshot? Leave a review!
View open issues (16)
View react-slingshot activity
View on github
Fresh, new opensource launches 🚀🚀🚀
Trendy new open source projects in your inbox! View examples

Subscribe to our mailing list

Evaluating react-slingshot for your project? Score Explanation
Commits Score (?)
Issues & PR Score (?)

Build status: Linux Build status: Windows Dependency Status Coverage Status

A comprehensive starter kit for rapid application development using React.

Why Slingshot?

  1. One command to get started - Type npm start to start development in your default browser.
  2. Rapid feedback - Each time you hit save, changes hot reload and linting and automated tests run.
  3. One command line to check - All feedback is displayed on a single command line.
  4. No more JavaScript fatigue - Slingshot uses the most popular and powerful libraries for working with React.
  5. Working example app - The included example app shows how this all works together.
  6. Automated production build - Type npm run build to do all this:

React Slingshot Production Build

Get Started

  1. Initial Machine Setup. First time running the starter kit? Then complete the Initial Machine Setup.
  2. Clone the project. git clone https://github.com/coryhouse/react-slingshot.git.
  3. Run the setup script. npm run setup
  4. Run the example app. npm start -s This will run the automated build process, start up a webserver, and open the application in your default browser. When doing development with this kit, this command will continue watching all your files. Every time you hit save the code is rebuilt, linting runs, and tests run automatically. Note: The -s flag is optional. It enables silent mode which suppresses unnecessary messages during the build.
  5. Review the example app. This starter kit includes a working example app that calculates fuel savings. Note how all source code is placed under /src. Tests are placed alongside the file under test. The final built app is placed under /dist. These are the files you run in production.
  6. Delete the example app files. Once you're comfortable with how the example app works, you can delete those files and begin creating your own app.
  7. Having issues? See Having Issues? below.

Initial Machine Setup

  1. Install Node 4.0.0 or greater - (5.0 or greater is recommended for optimal build performance). Need to run multiple versions of Node? Use nvm.
  2. Install Git.
  3. Disable safe write in your editor to assure hot reloading works properly.
  4. On a Mac? You're all set. If you're on Linux or Windows, complete the steps for your OS below.

On Linux:

  • Run this to increase the limit on the number of files Linux will watch. Here's why.
    echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

On Windows:

  • Install Python 2.7. Some node modules may rely on node-gyp, which requires Python on Windows.
  • Install C++ Compiler. Browser-sync requires a C++ compiler on Windows. Visual Studio Express comes bundled with a free C++ compiler. Or, if you already have Visual Studio installed: Open Visual Studio and go to File -> New -> Project -> Visual C++ -> Install Visual C++ Tools for Windows Desktop. The C++ compiler is used to compile browser-sync (and perhaps other Node modules).

Having Issues? Try these things first.

  1. Make sure you ran all steps in Get started including the initial machine setup.
  2. Run npm install - If you forget to do this, you'll see this: babel-node: command not found.
  3. Install the latest version of Node. Or install Node 5.12.0 if you're having issues on Windows. Node 6 has issues on some Windows machines.
  4. Make sure files with names that begin with a dot (.editorconfig, .gitignore, .npmrc) are copied to the project directory root. This is easy to overlook if you copy this repository manually.
  5. Don't run the project from a symbolic link. It may cause issues with file watches.
  6. Delete any .eslintrc that you're storing in your user directory. Also, disable any ESLint plugin / custom rules that you've enabled within your editor. These will conflict with the ESLint rules defined in this project.
  7. Make sure you don't have NODE_ENV set to production on your machine. If you do then the development dependencies won't be installed. Here's how to check.
  8. Install watchman with brew install watchman if you are having the following error after an initial npm start -s: ```sh 2017-09-05 00:44 node68587 FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-22) 2017-09-05 00:44 node68587 FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-22) events.js:160 throw er; // Unhandled 'error' event ^

Error: Error watching file for changes: EMFILE at exports._errnoException (util.js:1022:11) at FSEvent.FSWatcher._handle.onchange (fs.js:1406:11)

9. Tip: Things to check if you get an `npm run lint` error or build error:

    * If ESW found an error or warning in your project (e.g. console statement or a missing semi-colon), the lint thread will exit with `Exit status 1`. To fix: 

      1. Change the `npm run lint` script to `"esw webpack.config.* src tools; exit 0"`
      1. Change the `npm run lint:watch` script to `"esw webpack.config.* src tools --watch; exit 0"`

      > Note: Adding `exit 0` will allow the npm scripts to ignore the status 1 and allow ESW to print all warnings and errors.

    * Ensure the `eslint`/`esw` globally installed version matches the version used in the project. This will ensure the `esw` keyword is resolved.
10. Rebuild node-sass with `npm rebuild node-sass` if you are having and error like `Node Sass does not yet support your current environment on macOS XXX` after an initial `npm start -s`.

<a id="technologies"/>
## Technologies

Slingshot offers a rich development experience using the following technologies:

| **Tech** | **Description** |**Learn More**|
|----------|-------|---|
|  [React](https://facebook.github.io/react/)  |   Fast, composable client-side components.    | [Pluralsight Course](https://www.pluralsight.com/courses/react-flux-building-applications)  |
|  [Redux](http://redux.js.org) |  Enforces unidirectional data flows and immutable, hot reloadable store. Supports time-travel debugging. Lean alternative to [Facebook's Flux](https://facebook.github.io/flux/docs/overview.html).| [Getting Started with Redux](https://egghead.io/courses/getting-started-with-redux), [Building React Applications with Idiomatic Redux](https://egghead.io/courses/building-react-applications-with-idiomatic-redux), [Pluralsight Course](http://www.pluralsight.com/courses/react-redux-react-router-es6)|
|  [React Router](https://github.com/reactjs/react-router) | A complete routing library for React | [Pluralsight Course](https://www.pluralsight.com/courses/react-flux-building-applications) |
|  [Babel](http://babeljs.io) |  Compiles ES6 to ES5. Enjoy the new version of JavaScript today.     | [ES6 REPL](https://babeljs.io/repl/), [ES6 vs ES5](http://es6-features.org), [ES6 Katas](http://es6katas.org), [Pluralsight course](https://www.pluralsight.com/courses/javascript-fundamentals-es6)    |
| [Webpack](https://webpack.js.org) | Bundles npm packages and our JS into a single file. Includes hot reloading via [react-transform-hmr](https://www.npmjs.com/package/react-transform-hmr). | [Quick Webpack How-to](https://github.com/petehunt/webpack-howto) [Pluralsight Course](https://www.pluralsight.com/courses/webpack-fundamentals)|
| [Browsersync](https://www.browsersync.io/) | Lightweight development HTTP server that supports synchronized testing and debugging on multiple devices. | [Intro vid](https://www.youtube.com/watch?time_continue=1&v=heNWfzc7ufQ)|
| [Jest](https://facebook.github.io/jest/) | Automated tests with built-in expect assertions and [Enzyme](https://github.com/airbnb/enzyme) for DOM testing without a browser using Node. | [Pluralsight Course](https://www.pluralsight.com/courses/testing-javascript) |
| [TrackJS](https://trackjs.com/) | JavaScript error tracking. | [Free trial](https://my.trackjs.com/signup)|  
| [ESLint](http://eslint.org/)| Lint JS. Reports syntax and style issues. Using [eslint-plugin-react](https://github.com/yannickcr/eslint-plugin-react) for additional React specific linting rules. | |
| [SASS](http://sass-lang.com/) | Compiled CSS styles with variables, functions, and more. | [Pluralsight Course](https://www.pluralsight.com/courses/better-css)|
| [PostCSS](https://github.com/postcss/postcss) | Transform styles with JS plugins. Used to autoprefix CSS |
| [Editor Config](http://editorconfig.org) | Enforce consistent editor settings (spaces vs tabs, etc). | [IDE Plugins](http://editorconfig.org/#download) |
| [npm Scripts](https://docs.npmjs.com/misc/scripts)| Glues all this together in a handy automated build. | [Pluralsight course](https://www.pluralsight.com/courses/npm-build-tool-introduction), [Why not Gulp?](https://medium.com/@housecor/why-i-left-gulp-and-grunt-for-npm-scripts-3d6853dd22b8#.vtaziro8n)  |

The starter kit includes a working example app that puts all of the above to use.
## Questions?
Check out the [FAQ](/docs/FAQ.md)
react-slingshot open issues Ask a question     (View All Issues)
  • about 2 years How do you get this to work in webstorm?
  • about 2 years Future-proofing for Webpack 2
  • about 2 years SASS only working in DEV build, not production
  • about 2 years How to change application root from / to /app for both dev and production
  • about 2 years Connecting Backend express-mongo with react-slingshot
  • about 2 years Bundle analyzer Error: listen EADDRINUSE :::8888
  • over 2 years Deploying on Heroku
  • over 2 years Jest Migration
  • over 2 years Debugging is broken in development mode when using cheap-module-eval-source-map
  • over 2 years `test:cover` results in "No coverage information was collected, exit without writing coverage information"
  • over 2 years npm start -s fails
  • over 2 years Tests coverage
  • over 2 years Is the 'remove-demo' script maybe a little over-zealous?
  • over 2 years Tip: Things to check if you get an npm run lint error or build error
  • over 2 years Create Project Logo
  • over 2 years Organize directories by domain
  • over 2 years Include redux-thunk by default
  • over 2 years Killing start script requires hitting Ctrl+C twice
  • almost 3 years add ajax structure support
  • almost 3 years Integrate CSS-Modules
  • almost 3 years Add proxy for API calls
  • about 3 years Wrap this project inside a Yeoman Generator
  • over 1 year NPM Inject-Loader
  • over 1 year Add express to serve static files
  • almost 2 years Hot reload not working: [react-router] You cannot change <Router routes>
  • almost 2 years Add Deployment Section to Docs
  • almost 2 years Update ESLint Config
  • almost 2 years Update Jest Reporter to output single line report
react-slingshot open pull requests (View All Pulls)
  • Make slingshot compatible with the React Toolbox (http://react-toolbox.com/)
  • connect-history-api-fallback
  • include postcss and autoprefixer
  • webpack-hot-middleware/client reload params configured to true
  • Proxy for Webpack.
  • Remove babel-eslint and disable stage-1 support
  • Make bundle URL relative to index.html
  • adding react-css-modules support
  • Rename businessLogic to utils
  • Added Support for ES6 Coverage
  • Remove typo from comment
  • Add links to Learn More for Redux
  • fixes bootstrap glyiphicons without hardcoding public path
  • Move chunk injection into template
  • Use file-name for images, eot, woff, ttf, svg and ttf
  • Better HMR with React Hot Loader v3
  • Update test script to be more inclusive
  • updates to travis ci config for yarn.
  • Webpack 2
  • Add express to serve static files
  • Implement React Router@4.0.0
  • Add CONTRIBUTE.md
  • Adding docker support
  • Change build and clean to get target from package.json
react-slingshot questions on Stackoverflow (View All Questions)
  • integrate flow checking into react-slingshot
react-slingshot list of languages used
react-slingshot latest release notes
7.0 7.0

Breaking Changes

  • Upgraded to React Router 4 #393
  • Upgraded to Webpack 3 #444
  • Upgraded to React Hot Loader 3 #392
  • Upgraded all other dependencies to latest #444 #390 #401
  • Switched to babel-preset-env #411

Bug fixes

  • Update Jest config to properly handle static assets #457
  • Enhance babel env config to transpile for IE9+ #452
  • Remove escape chars in setupPrompts.js causing linting to fail #449
  • Add jest-cli as an explicit dependency a5cf0e0
  • Copy favicon to /dist #424
  • Switch from open to opn to resolve issue on Windows #421
  • Resolve setup script issues #416

Enhancements

  • Added prop-types and updated all example code #418
  • Eliminated .babelrc and .eslintrc by moving Babel and ESLint configs to package.json #405

Documentation

  • Documented more items to check if you receive lint or build errors #151
  • Documented how to configure the public path #415
6.0 6.0

Major Enhancements

Thanks so much to the many contributors that made 6.0 possible!

5.0 5.0 Release

v5.0 (2016-07-11)

Full Changelog

Another major release with tons of tweaks and improvements! Thanks to everyone for contributing!

Major Enhancements:

  • Added setup script - Pompts you for initial setup preferences, populates package.json, and runs install. Thanks @gargrave!
  • ES6 Code coverage reporting - Uses Isparta to show code coverage on your ES6 code. Thanks @dwmkerr! View on the command line via npm run test:cover. Open detailed coverage in browser via npm run open:cover.
  • Hash bundles in production build - This supports cache busting. Also generating index.html via html-wepack-plugin so hashed filenames are referenced automatically and HTML is automatically minified. This eliminated the build:html script from package.json.
  • Updated all dependencies to latest versions including React. - Also added react-router-redux.

Full Change Log

Implemented enhancements:

  • Hash bundle name #171
  • Create Setup command #148
  • Consider adding react-router-redux #122
  • Add babel-based code coverage #108
  • Add code coverage reporting #97
  • Absolute styles.css path for multi-level paths #143 (rndstr)
  • Added Support for ES6 Coverage #142 (dwmkerr)

Fixed bugs:

  • npm run lint throws error when spaces are in path on Windows #150
  • Load styles last for same behaviour as in dev mode #144 (rndstr)

Closed issues:

  • image map require error #191
  • App will not display after build #186
  • Object spread assignment does not work #178
  • Stage1/2 #177
  • Does the webpack prod build exclude all spec.js files from bundle.js? #176
  • Eslint issue #175
  • npm run build error #170
  • CSS in the dev vs prod builds #169
  • Unhandled 'error' event #167
  • Cannot import extract-text-webpack-plugin #164
  • Changed port #159
  • Add carte-blanche #158
  • Instructions for deleting example files missing #145
  • Nested routes are not working when URL is refreshed #65

Merged pull requests:

Other projects in JavaScript