Hops is a modular development and build environment for universal ("isomorphic") web applications. It leverages React and Redux.
Hops is designed to simplify getting started with modern frontend tooling. It streamlines Webpack and Jest configuration featuring Babel and PostCSS.
Besides reasonably recent versions of Node.js and npm, hops has no global dependencies. If you need those, we recommend using nvm or similar.
If you want to go all in with hops, here's what you have to do and install to create a basic project..:
mkdir foo && cd foo
npm init -y
npm install -S hops-cli hops-config \
hops-react react react-dom react-helmet react-router react-router-dom \
hops-redux redux redux-thunk react-reduxAfter installing hops into your project, you need to set it up. This can be done within your project's package.json file. The relevant fields are shown below:
{
"browser": "src/browser.js",
"server": "src/server.js",
"scripts": {
"start": "hops start"
},
"config": {
"hops": {
"locations": [
"/"
]
}
}
}Hops relies heavily on this file for configuration. In the example above, there are two entry points for browser and server - that is, two files that are used for client and server builds.
Hops provides a runner that you can call from the scripts of your package.json and is configured using the hops config object also contained therein. In this example, the only configuration option provided is locations, an array of paths that will be used for generating static html files using the middleware you provide.
For developing using hops, you can use any decent editor with up-to-date language support. Those without a favorite we recommend Atom, probably with the linter, linter-eslint and linter-stylelint plugins.
Assuming you edited your package.json as outlined above, you can fire up a dev server or trigger a production build like so:
npm start (--production)If called with the --production flag, a production mode server is launched. Otherwise, a development server featuring hot module replacement is started. Hops can generate html pages for all locations listed in its config at build time, so you don't need a node server in production, but still can enjoy the benefits of a true universal JavaScript application.
Hops is quite modular, its component being independently published on npm. Its main building blocks, however, rely upon each other:
The following additional packages are rather low-level and you'll probably never need to install and use them directly.
If you want to contribute to this project, create a fork of its repository using the GitHub UI. Check out your new fork to your computer:
mkdir hops && cd $_
git clone git@github.com:user/hops.git .Afterwards, you can npm install Hops' own dev dependencies and start the included demo project and begin developing.
npm install
npm startWhenever you run npm start, the hops packages used in the demo project are being re-installed locally. When you are finished, please do go ahead and create a pull request.
Hops is entirely written in ECMAScript 5 and adheres to semistandard code style. Please make sure your contribution does, too.
The beautiful hops icon used in the logo was created by The Crew at Fusionary and provided via The Noun Project. It is licensed under a Creative Commons license.
