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

ir-app-boilerplate-adam

v2.2.0

Published

Boilerplate for ignite-react-app

Downloads

11

Readme

Ignite React App Boilerplate ("Adam")

Currently includes:

  • React 16
  • React Router Dom
  • Redux
  • Redux Sagas
  • And more!

Quick Start

When you've installed the Ignite React App, you can get started with this boilerplate like this:

ir-app new my-awesome-app

Boilerplate walkthrough

Your src folder is where most of the goodies are found in an Ignite React App that was created using Create React App. Let's walk through them in more detail. Start with src/index.js (described below) and work your way down the walkthrough in order.

Layouts

This boilerplate uses the methodology described here. Layout components are generally associated with the application routing and they take advantage of the Dynamic Routing concept of React Router v4.

To generate a new Layout you can use the following generator commands:

ir-app layout Products

Containers

This boilerplate makes use of the methodology discussed by Dan Abramov here. Containers are components that are concerned with how things work.

Container components:

  • Are concerned with how things work.
  • May contain both presentational and container components** inside but usually don’t have any DOM markup of their own except for some wrapping divs, and never have any styles.
  • Provide the data and behavior to presentational or other container components.
  • Call Redux actions and provide these as callbacks to the presentational components.
  • Are often stateful, as they tend to serve as data sources.
  • Are usually generated using higher order components such as connect() from React Redux, createContainer() from Relay, or Container.create() from Flux Utils, rather than written by hand.
  • Examples: UserPage, FollowersSidebar, StoryContainer, FollowedUserList.

To generate a new Container you can use the following generator commands:

ir-app container Comment
or
ir-app cont Comment

Components

Again borrowing from Dan Abramov's approach. Components are presentaional components and they are concerned with how things look.

To generate a new Component you can use the following generator commands:

ir-app component Comment
or 
ir-app comp Comment

Storybook

Storybook has been setup to show off components in the different states. Storybook is a great way to develop and test components outside of use in your app. Simply run npm run storybook or yarn storybook to get started. All stories are contained in the *.story.js files along side the components.

Themes

Styling themes used throughout your app styles.

  • Colors.js - defined colors for your app
  • Metrics.js - useful measurements of things like navBarHeight

Config

Initialize and configure things here.

  • ApiConfig.js - simple api configuration here
  • AppConfig.js - simple app configuration here
  • DevConfig.js - define how you want your development environment to act
  • ReduxPersistConfig.js - configures Redux Persist

Fixtures

Contains json files that mimic API responses for quicker development. These are used by the Services/FixtureApi.js object to mock API responses.

Redux, Sagas

Contains a preconfigured Redux and Redux-Sagas setup. Review each file carefully to see how Redux interacts with your application.

Here again we have generators to help you out. You just have to use one of the following:

  • ir-app redux Amazing - Will generate the redux for Amazing.
  • ir-app saga Amazing - The same as above, but for the Sagas

Services

Contains your API service and other important utilities for your application.

  • Api.js - main API service, giving you an interface to communicate with your back end
  • FixtureApi.js - mocks your API service, making it faster to develop early on in your app
  • RehydrationServices.js - part of the redux-persist implementation

Lib

We recommend using this folder for modules that can be extracted into their own NPM packages at some point.

Images

Contains actual images (usually png) used in your application.

Utils

Helpers for transforming data between API and your application and vice versa. An example is provided that you can look at to see how it works.

Extras

Generating multiple files

In a situation were you want to create a component, container, redux or saga or any variations of these you can run the following commands

  • ir-app gen redux saga Amazing - Will generate the redux and saga for Amazing.
  • ir-app g comp cont redux saga Register - This will generate a component, container, redux and saga for Register.

Loading async components

import Loadable from 'react-loadable'
const Button = Loadable({
  loader: () => import('../Components/Button'),
  loading: () => <div>loading...</div>
});