npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

generator-universal-react-and-redux

v0.1.1

Published

a yeoman generator for universal/isomorphic applications using react, redux, webpack and express.

Downloads

15

Readme

generator-universal-react-and-redux NPM version Dependency Status

a yeoman generator for universal/isomorphic applications using react, redux, webpack and express.

Installation

First, install Yeoman and generator-universal-react-and-redux using npm (we assume you have pre-installed node.js).

npm install -g yo
npm install -g generator-universal-react-and-redux

Then generate your new project:

yo universal-react-and-redux

Getting To Know Yeoman

  • Yeoman has a heart of gold.
  • Yeoman is a person with feelings and opinions, but is very easy to work with.
  • Yeoman can be too opinionated at times but is easily convinced not to be.
  • Feel free to learn more about Yeoman.

Universal Web Applications & Current Setup

This generator was put together to ease the pain of starting a 'Universal Web Application', also referred to as an 'Isomorphic Web Application'. The goal behind Universal applications are to:

  • reduce the amount of duplicated client and server side code
  • reduce initial load times of Single Page Applications
  • increase SEO for Single Page Applications
  • increase overall UX that Single Page Applications can be prone to (such as stuttered loading & reducing loading spinners)

If you're familiar with writing Single Page Applications, you'll no doubt stumbled accross one or all of the issues outlined above. To overcome these issues, this generator builds an application shell using React, Redux, Webpack and Express. The application will be rendered on the server, and initial state will be transfered to the client. Furthermore, the through using webpack and react-router we can load our scripts and static assets dynamically as we navigate through the application opposed to upfront.

This generator has been put together with the aid and influence of several other blogs and documentation sites, for more information on the state of Univeral Web Applications see the resources below.

Useage

After the Yeoman Generator has completed, and npm install has been successful you can launch your new Universal App with:

   npm run dev

Development Mode

Running in dev mode uses webpacks dev server, this does not produce an output file/bundle and offers hot reloading. Once the server is running head to http://localhost.com:8080. If you happen to navigate to localhost:3000 you will see your web page however as webpack stores the bundles in memory there will be an error in the console noting that your scripts can not be found. Simply use port 8080 in development mode to get a functioning development environment. For more information see the webpack documentation listed in the Resources.

Testing & Linting

They are several testing and linting commands baked into the project, they are:

  npm test
  npm run lint
  npm run test:watch
  npm run cover

Firstly, npm test runs the tests in the test directory once. npm run lint lints the project. npm run test:watch runs the test runner continiously, watching files for changes and reruns on a change event (good for TDD). Finally, npm run cover gives a breakdown as both a terminal output and within the coverage folder of all the test paths being covered and not covered in the project.

Building

To build the application for production you can run:

  npm run build

This runs webpack with configurations to uglify and optimise the javascript. It also outputs the files and chunks into the dist/ folder. You can then call:

  npm start

Resources

  • http://redux.js.org/
  • https://egghead.io/lessons/javascript-redux-the-single-immutable-state-tree
  • https://github.com/reactjs/react-router/blob/master/docs/guides/ServerRendering.md
  • https://github.com/DavidWells/isomorphic-react-example
  • http://blog.scottlogic.com/2016/02/05/a-lazy-isomorphic-react-experiment.html
  • https://medium.com/front-end-developers/handcrafting-an-isomorphic-redux-application-with-love-40ada4468af4#.6qon662vr
  • https://medium.com/@dan_abramov/smart-and-dumb-components-7ca2f9a7c7d0#.1gtchtcdg
  • https://github.com/petehunt/webpack-howto
  • http://webpack.github.io/docs/
  • http://survivejs.com/webpack/developing-with-webpack/
  • https://medium.com/@dan_abramov

License

ISC © HistoireDeBabar