-
Notifications
You must be signed in to change notification settings - Fork 318
remove window #121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
remove window #121
Conversation
+1 |
It breaks default behavior. Pass |
I am not sure what default behaviour it breaks. console exists in both browser and nodejs globals. Could you explain ? Using the logger option is not a possibility since this breaks at import - a work around is to do perhaps a conditional import - but that just looks like a mess. The only thing this removes is an assumption that the global is called |
Uh... what? How does this break any behavior? |
Unless I'm missing something this should fix Node usage and should not have any effect in the browser. Any downsides? |
Since we are officially recommending this library on the docs, and people are using Redux on server, we would prefer to see this fixed. |
#12 |
It's because the variable is also named Here's example of what was happening https://jsfiddle.net/Lzmuftt4/ |
@epeli no, see screenshot. @gaearon why does middleware lose |
I think it's because the return function (action) {
var console; // make the console undefined
console.log(console);
var collapsed = options.collapsed;
var predicate = options.predicate;
var logger = options.logger;
console.log(console);
console = logger || console;
console.log(console);
.. |
@epeli it doesn't have an explicit declaration. |
It doesn't need to have. That's the sad magic of Here's a fiddle demonstrating it https://jsfiddle.net/Lzmuftt4/2/ |
@epeli oh wow! But how we can fix it? I don't have an idea. |
Hmm. In the current version there is no more |
@epeli yeah, you are right. Thanks, @ganarajpr @contra @gaearon @epeli! |
Released 2.5.0. |
Thank you for getting back to this quickly! |
I think here are some old lessons to be learnt again. I'm gonna enable |
Assuming the existence of window means redux-logger cannot be used in universal applications.
This removes the dependency on window being the global variable.