Closed michael-freidgeim-webjet closed 9 months ago
This is standard in all build tools (Webpack, Vite, ESBuild, etc): process.env.NODE_ENV === "production"
(or "development"
), typically as managed by a build tool setting for dev or prod.
Generally you won't set this yourself, it's done automatically.
@markerikson
@markerikson another place where link explaining dev/prods mode should be added https://redux-toolkit.js.org/api/getDefaultMiddleware#development
@michael-freidgeim-webjet I'll be honest, it's not the job of the Redux docs to explain every concept in web development. There are other articles out there that explain what specific behaviors and settings are part of "dev mode" and "prod mode" in each build tool.
It's the same way that it's not the job of the Redux docs to explain JS syntax, HTML, or React. We have to assume that our readers know certain concepts already.
It is a job of every documentation , when using some concept to give a reference where the concept is described/documented. The particular question is not about concept of production and development mode, but where it is defined(which you shouldn’t assume as common knowledge) It is exactly what I am suggesting- give a link/reference to "other articles out there that explain what specific behaviors and settings are part of "dev mode" and "prod mode"
It is especially important when search on documentation site is broken
Regards, Michael Freidgeim
From: Mark Erikson @.> Sent: Sunday, January 7, 2024 11:53:41 AM To: reduxjs/react-redux @.> Cc: Michael Freidgeim @.>; Mention @.> Subject: Re: [reduxjs/react-redux] where development or production mode should be specified? (Issue #2111)
CAUTION: External email. Please exercise caution when opening links or attachments unless you are expecting this email and it is from a known sender.
@michael-freidgeim-webjet I'll be honest, it's not the job of the Redux docs to explain every concept in web development. There are other articles out there that explain what specific behaviors and settings are part of "dev mode" and "prod mode" in each build tool.It's the same w https://uk.report.cybergraph.mimecast.com/alert-details/?dep=%2BUQIDRDk95b3YZNsrlldPw%3D%3D8F6iiSnCN7p5Maq4ty4SZmZ4c9iM23eMXFCXe3%2BnGQttY5SmSiSfFEp1HV%2FBXhvGujQdrm0mx5L0Xr1GaRWuw%2BLTuiygwyRi7KjjVlZZQ8%2FLXsIlimMjeoa9BNHcmZ8L57cs1wHwEUVwqmvzU9Ev0mGyQuuF7W09H79yaGeicbczfr9zluyj4ng24A86BRAlT5JP2PQfaVf%2F7KTs1%2FSSdhUb7OwQIpOkBoDiayVo5mLnYUUdva7CC033UkaOIRdfK%2BMkHIQl25I9VVsbEdduTVjoviUIq%2FfdreXgCe8GCIJoDaUsCC%2F49QBRGRAwl%2B77FCJf771HHUDHWjbGfbuyTCCJz092AOFO37ICgvmg6%2BpohWxJPIT9BnhvffayT%2FNY1ZS78D9mtP54BoKFVvCXXJa7qlQJoTQEhOEhau%2F0ZzfaCLUpLkj5w5O3QINi%2B92KQ%2BYoH00XeiEfkxifndqqBJHbAQdZTZcWzZ0RPQe0uctX8S0RXbJHqTXn%2FgbjpHNBdLURkHMxUYqV8U3ShLrO6RP6u0i6dvng1%2BOOdH5pvh%2FmivI7BNyttfS8zc%2Bf068b9A8digw%2Bmruq%2FTADt%2Fa9HEsxHcqvVSOWtvIaWhImPRNcHHBCuDdEg927d4kHVDQrZO7SSOAIZkDW7NYH9lWGZ1WqnaZrVI2PlP7pJCXKd7uGlAUhN%2FpcB0p5F022JbRO66QN0ie0zmnDtgbEft64KgKcCICxPIA%2F6pUxqmZbQMuXMSBCUBp4BYHkcLVm3Z7JCey%2FPLjCXrCF%2BRQxzr%2FPTDhjY7xKJ1g1StTIfhKH69EdhiUySjBvYyVlPuEU5JrACR8DHuZ1omj0b5qKK%2BORncKclcTSo2gDTXydxA3K1oZ6aZMn1mfOQXL%2ByTYaTaxYNiHAcFzw1a7tACQDkKoCMBrUcwJ84q8kxpCdleMfnSzTLoi3dr7g804U%2BfJHLNywB6TObu344%2FzTqzs7QUK8jcMOlKzpG0d5sS8NnQ4EXOJX%2BPVK2uMhhGNBGVUENoXmoYZQyPpE8%2FIqK9tnfmF5Cg%3D%3D
@michael-freidgeim-webjethttps://github.com/michael-freidgeim-webjet I'll be honest, it's not the job of the Redux docs to explain every concept in web development. There are other articles out there that explain what specific behaviors and settings are part of "dev mode" and "prod mode" in each build tool.
It's the same way that it's not the job of the Redux docs to explain JS syntax, HTML, or React. We have to assume that our readers know certain concepts already.
— Reply to this email directly, view it on GitHubhttps://github.com/reduxjs/react-redux/issues/2111#issuecomment-1879898903, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AC3GYHMBKMOP6NWN66EHK5DYNHWZLAVCNFSM6AAAAABBMVD4D6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNZZHA4TQOJQGM. You are receiving this because you were mentioned.Message ID: @.***>
"dev mode" is not a "Redux" concept, it's a feature of your general application setup - most of the time the framework you are using.
E.g. Next.js, CRA, Vite and many others will provide you with a dev
script that you trigger by typing npm run dev
into your console.
If you skipped this step in the documentation of your framework (and it is most likely already part of the "getting started" section of your framework), you are simply far too late, looking for it in the Redux documentation. It's a concept used by almost every library, and all of them depend on your framework configuration instead of individually documenting this (except if they deviate from ecosystem defaults).
We also cannot link you to any resource about it, since we'd have to link to every possible framework you are using, and each of those probably has different documentation.
Once you start setting up Redux, you are aleady so deep in the game that you should know what "dev mode" is, or at least have a slight idea, based on the fact that you are literally starting your app in "dev mode" 99% of the time you are developing software.
It is especially important when search on documentation site is broken
Just to address this, I'm showing the search as working on my end:
My best guess is a browser extension or something on your network is blocking access to Algolia and preventing it from showing up.
What version of React, ReactDOM/React Native, Redux, and React Redux are you using?
Not applicable - documentation
What is the current behavior?
In The documentation page https://react-redux.js.org/api/hooks#development-mode-checks It is not clear where development or production mode should be specified , hyperlink to appropriate documentation will be appreciated.
btw, it seems that search on the page doesn’t work. When I clicked search on the right top corner and typed development, I’ve got “No results for "development"
What is the expected behavior?
link to appropriate documentation is expected
Which browser and OS are affected by this issue?
iPad safari
Did this work in previous versions of React Redux?