unirakun / k-ramel

State manager for your components apps, the safe and easy way
MIT License
21 stars 5 forks source link

Disable devtools in production #292

Closed frinyvonnick closed 5 years ago

frinyvonnick commented 5 years ago

We experienced an issue on NantesJS website about devtools enable no matter the current env. What do you think of disabling it in production ?

fabienjuif commented 5 years ago

I don't know how to handle env variables in a lib. You can enable/disable it on your own:

createStore(definition, { devtools: process.env.NODE_END !== 'production' }) https://github.com/alakarteio/k-ramel/blob/master/packages/k-ramel/src/createStore/enhanceRedux/getDevTools.js#L12

Side note: The devtools should not be connected if there is no devtools extension in your browser: https://github.com/alakarteio/k-ramel/blob/master/packages/k-ramel/src/createStore/enhanceRedux/getDevTools.js#L7

fabienjuif commented 5 years ago

redux use NODE_ENV: https://github.com/reduxjs/redux/blob/master/src/combineReducers.js

We have to try here, and look at built js