Redux: FEATURE: Publish mini version to npm

Created on 24 Jun 2018  ·  5Comments  ·  Source: reduxjs/redux

Introduction

We are currently working on a feature to migrate yargs state management to redux (see PR https://github.com/yargs/yargs/pull/1151 and Issue https://github.com/yargs/yargs/issues/1150). To do this we are installing the full redux npm package - roughly 145KB.

We believe it would benefit projects, like yargs, if they can instead install just the minified version - 6KB.

Proposal

Auto-publish the minified version of redux to a separate npm package whenever redux package is updated.

Benefits

  • Quicker installation
  • Maintain semver

Notes

We have considered alternatives such as vendoring the minified version, but we believe that this approach will benefit not just our project but others as well.

Most helpful comment

Can we please please please call the package weedux?

All 5 comments

Because of the way npm/node_modules works, we ship a few different versions of the library for different environments (UMD, minified UMD, ES modules, common js, original source). Unfortunately, npm doesn't support multiple "channels" for each of these environments. So, I don't know of a way to make this happen.

Ironically, our README is actually larger than the library itself 🤷‍♂️

If you have a specific idea, I'm all ears.

What about adding a step to the CI/CD pipeline to publish just the minified UMD file to npm? Perhaps scope it under @redux (i.e. @redux/umd-minified?

I feel that would cover most use cases where consumers would want to use redux as-is.

I know very little about the actual package publishing process myself, but there's gotta be _some_ way to do it.

At a bare minimum, we set up separate repos for each deployable artifact (like reduxjs/redux-umd-minified, and use those as the source for these packages.

Can we please please please call the package weedux?

Just opened up a PR to make this happen.

Was this page helpful?
0 / 5 - 0 ratings