Check self.process before reading for browser compatibility#2910
Check self.process before reading for browser compatibility#2910keanulee wants to merge 1 commit intoreduxjs:masterfrom
Conversation
|
Thanks for this. I think it looks good, but anyone else want to chime in? |
|
@timdorr The thing to verify is that those blocks still get removed in the prod build. I suppose comparing the prod build size before and after this change would work. |
|
Yep, I'll want to verify locally to be sure. I'll try to run that through tonight or tomorrow at some point. |
|
@jimbolla @timdorr the way react does this check is by defining a |
|
@kaushik94 That's transformed into a NODE_ENV check during the build process. They use it as a shorthand while coding, but it's not how the build comes out compiled. |
|
I checked against the production build, and they are still sticking around in the UMD build, unfortunately. I'm not sure there is a good way to fix this internally at the moment. I would instead either use the UMD version or "polyfill" with |
With this patch, browsers can directly run the ES module build of Redux from https://unpkg.com/[email protected]/es/redux.js?module and other tools that converts package names to paths.
Fixes #2907