@dr.pogodin/react-utils
Collection of generic ReactJS components and utils
Last updated 4 days ago by dr.pogodin .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @dr.pogodin/react-utils 
SYNC missed versions from official npm registry.

Master Build Status Dev Build Status Latest NPM Release NPM Downloads

React Utils

ReactJS development kit. The ReactJS Starter Pack implements required setup, and provides usage examples.

Content

Installation

Install the package as

$ npm install --save @dr.pogodin/react-utils
$ ./node_modules/.bin/react-utils-setup

Then import the global stylesheet into the root ReactJS component of your app:

/* eslint-disable global-require */
if (process.env.NODE_ENV === 'production') {
  require('@dr.pogodin/react-utils/prod-styles');
} else {
  require('@dr.pogodin/react-utils/dev-styles');
}
/* eslint-enable global-require */

To upgrade this library to the latest version just execute again

$ ./node_modules/.bin/react-utils-setup

Reference

Standard Configurations

Components

  • <Button> – Handles buttons and button-like links (components that look like regular buttons, but behave as links) in the same uniform manner.
  • <Checkbox> – Themed checkbox component.
  • <CodeSplit> – Code splitting component.
  • <Dropdown> – Themed dropdown component.
  • <GlobalStateProvider> – Alias for <GlobalStateProvider> from @dr.pogodin/react-global-state.
  • <Input> – Themed text input component.
  • <Link> and <NavLink> – Auxiliary wrappers around the React Router's components of the same names. Allow to handle external and internal links in the same uniform manner.
  • <Modal> – Themeable modal component.
  • <PageLayout> – Simple and configurable page layout.
  • <ScalableRect> – Container that keeps the specified aspect ratio regardless the width you set.
  • <Throbber> – Simple activity indicator (three bouncing circles).
  • <WithTooltip> – Tooltip component.
  • <YouTubeVideo> – Embed YouTube video component.

NodeJS Scripts

  • react-utils-build – The script for Babel, and Webpack build of the library and derived apps. Can be used to work around issues with npm link command for the library development within dependant projects.
  • react-utils-setup – The script for library installation and upgrades.

Utilities

  • _ – Alias of lodash (JS utilities).
  • api – Alias of axios (API / HTTP client).
  • client – Client-side initialization code.
  • config – Isomorphic app config.
  • Global Styles – Global SCSS styles necessary for a generic application.
  • hooks – Different React hooks.
  • isomorphy – Collection of helpers to deal with isomorphic aspects of the code.
  • JUjest utilities.
  • PT – Alias of prop-types.
  • React Themes – Aliases for dr.pogodin/react-themes. UI styles for React components with theme composition.
  • SCSS Mixins – Collection of useful style mixins;
  • server – Easy creation and launch of web-server with standard configuration, that serves a ReactJS application with or without server-side rendering, supports development tools (Hop Module Reloading), and can be further configured for the needs of specific projects.
  • time – Alias of moment + related utils. Everything needed to deal with date & times.
  • url – URL utils.
  • webpack – Various utils related to the Webpack bundling process.

Development

Whenever you are to do any changes in the library, keep in mind the following:

  • Different projects rely on this library, the tooling it provides should be as generic and flexible as possible. When you change existing components, do your best to keep backward compatibility of the updated components, any changes that demand updates in the projects relying on the library, must be documented in the changelog.

  • Rely on unit tests to verify your changes, and prevent regression. Update existing unit tests to keep up with your changes, and add new unit tests when necessary.

  • For the final testing of your updates within a host project relying on this lib, see the next section.

  • The library use semantic versioning. In case your changes demand any changes in the project relying on the library, you should release it as a minor library update (more severe comparing to patch update). Consider to use a new branch, called after the minor version, and to not merge your changes into the main devel / master branches until everybody is prepared for that.

Local Testing of Library Updates within a Host Project

To locally test how your library updates work within a host project relying on the lib (without releasing them to NPM), use npm link to link local copy of the lib into the host project, then run npm run build:dev:watch in the library root to automatically re-build the lib when you change it, and use the host project to see the final effect of changes you make.

Library Releases to NPM

Continious Integration and Delivery (CI/CD) is set up for this repository with CircleCI 2.0. Commits to all branches trigger testing of the code with $ npm test (it runs linters and unit tests), and also build the library. CI/CD flow is interrupted in case of any problems.

To release updated library version to NPM do the following:

  • Bump library version in package.json and package-lock.json by $ npm version UPDATE_TYPE --no-git-tag command, where UPDATE_TYPE should be one of patch / minor / major to update current version x.y.z to x.y.(z+1) / x.(y+1).0 / (x+1).0.0. The --no-git-tag flag prevents automatic creation of the Git tag with the same name as the version.

  • Tag the commit to be released with the git tag like v0.1.2, where 0.1.2 is the new version set in the previous step.

  • Commit the tag to GitHub repository.

License

React Utils are MIT Licensed.

Current Tags

  • 0.23.9                                ...           latest (4 days ago)

54 Versions

  • 0.23.9                                ...           4 days ago
  • 0.23.8                                ...           6 days ago
  • 0.23.7                                ...           8 days ago
  • 0.23.6                                ...           8 days ago
  • 0.23.5                                ...           15 days ago
  • 0.23.4                                ...           23 days ago
  • 0.23.3                                ...           a month ago
  • 0.23.2                                ...           a month ago
  • 0.23.1                                ...           a month ago
  • 0.23.0                                ...           a month ago
  • 0.22.0                                ...           a month ago
  • 0.21.0                                ...           a month ago
  • 0.20.3                                ...           2 months ago
  • 0.20.2                                ...           2 months ago
  • 0.20.1                                ...           2 months ago
  • 0.20.0                                ...           2 months ago
  • 0.19.3                                ...           2 months ago
  • 0.19.2                                ...           2 months ago
  • 0.19.1                                ...           2 months ago
  • 0.19.0                                ...           2 months ago
  • 0.18.10                                ...           2 months ago
  • 0.18.9                                ...           2 months ago
  • 0.18.8                                ...           2 months ago
  • 0.18.7                                ...           2 months ago
  • 0.18.6                                ...           2 months ago
  • 0.18.5                                ...           3 months ago
  • 0.18.4                                ...           3 months ago
  • 0.18.3                                ...           3 months ago
  • 0.18.1                                ...           3 months ago
  • 0.18.0                                ...           3 months ago
  • 0.17.6                                ...           3 months ago
  • 0.17.5                                ...           3 months ago
  • 0.17.4                                ...           3 months ago
  • 0.17.3                                ...           3 months ago
  • 0.17.2                                ...           4 months ago
  • 0.17.1                                ...           4 months ago
  • 0.17.0                                ...           4 months ago
  • 0.16.0                                ...           4 months ago
  • 0.15.2                                ...           5 months ago
  • 0.15.1                                ...           6 months ago
  • 0.15.0                                ...           6 months ago
  • 0.14.2                                ...           6 months ago
  • 0.14.1                                ...           6 months ago
  • 0.14.0                                ...           6 months ago
  • 0.13.0                                ...           7 months ago
  • 0.12.0                                ...           7 months ago
  • 0.11.0                                ...           8 months ago
  • 0.10.7                                ...           8 months ago
  • 0.10.6                                ...           8 months ago
  • 0.10.5                                ...           8 months ago
  • 0.10.4                                ...           8 months ago
  • 0.10.3                                ...           9 months ago
  • 0.10.2                                ...           9 months ago
  • 0.10.1                                ...           10 months ago
Maintainers (1)
Downloads
Today 0
This Week 16
This Month 16
Last Day 0
Last Week 17
Last Month 177
Dependencies (33)

Copyright 2014 - 2016 © taobao.org |