Dynalon / reactive-state

Redux-clone build with strict typing and RxJS down to its core. Wrist-friendly, no boilerplate or endless switch statements
MIT License
138 stars 7 forks source link

Lodash from devDependencies to dependencies in package.json #6

Closed Ronsku closed 7 years ago

Ronsku commented 7 years ago

I noticed that following:

"lodash.clonedeep": "^4.5.0",
"lodash.isarray": "^4.0.0",
"lodash.isobject": "^3.0.2",
"lodash.isplainobject": "^4.0.6",

Libraries are placed under devDependancies in package.json. These are used in the library and not only in development of the library. Could you move these under dependencies so it would automatically download them when using this library?

It output errors like: ERROR in ./node_modules/reactive-state/dist/store.js Module not found: Error: Can't resolve 'lodash.clonedeep' in '/Users/ron/Projects/test-project/node_modules/reactive-state/dist'

You can of course resolve the issue by installing them to your own project, but since it's a dependancy of reactive-state it should be there. It did not complain about lodash.isarray, so maybe this is only used in the tests and could stay in devDependancies. Typings can also stay in devDependancies.

Are you btw using this in production already? Do you have any plans on develop any more in the future or do you see it as complete package?

Thanks!

Ronsku commented 7 years ago
"devDependencies": {
    "@types/chai": "^3.5.2",
    "@types/lodash.clonedeep": "^4.5.3",
    "@types/lodash.isarray": "^4.0.3",
    "@types/lodash.isobject": "^3.0.3",
    "@types/lodash.isplainobject": "^4.0.3",
    "@types/mocha": "^2.2.41",
    "chai": "^3.5.0",
    "concurrently": "^3.4.0",
    "istanbul": "^0.4.5",
    "mocha": "^3.4.1",
    "tslib": "^1.7.1",
    "typescript": "2.4.x",
    "uglify-js": "^3.0.27",
    "webpack": "^3.4.1"
  },
  "dependencies": {
    "@types/node-fetch": "^1.6.7",
    "node-fetch": "^1.7.1",
    "rxjs": "^5.4.2",
    "lodash.clonedeep": "^4.5.0",
    "lodash.isarray": "^4.0.0",
    "lodash.isobject": "^3.0.2",
    "lodash.isplainobject": "^4.0.6"
  },
Dynalon commented 7 years ago

You are absolutely right, I fixed it and now they are regular dependencies and published v0.1.8.

I use reactive-state myself in two side projects of mine (both are not open source but full standalone react applications with several states, reducers and actions).

I plan on keeping it up to date, but at the same time follow the same principle as redux: Do one thing and one thing well. Everything that could be done outside should probably be done outside. Redux has plenty of middleware for this, and I think reactive-state can be extended the same way using RxJS operators or custom wrappers.

The current code base has 100% test coverage, so I am not saying its "perfect" but consider it done already. Any improvement (or bug) is welcome and might land in the core code. There is also a travis-ci integration that helps me verify builds and auto-executes the tests on every commit or PR.

stefyrosca commented 7 years ago

Same problem with tslib, it is required in Action.js, but it's listed as a dev dependency

Dynalon commented 7 years ago

@stefyrosca This is now fixed starting version v0.2.2 (62d8166de0c74c2b4e9674c807ce5a043be8dd93)

stefyrosca commented 7 years ago

Thank you!