Skip to content
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

where development or production mode should be specified? #2111

Closed
1 task
michael-freidgeim-webjet opened this issue Jan 4, 2024 · 7 comments
Closed
1 task

Comments

@michael-freidgeim-webjet

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?

  • Yes
@markerikson
Copy link
Contributor

markerikson commented Jan 4, 2024

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.

@michael-freidgeim-webjet
Copy link
Author

@markerikson

  1. Could you please add a link to this explanation to the documentation page(s)?
  2. Do you experience the same broken search or it doesn’t work only for me?

@michael-freidgeim-webjet
Copy link
Author

michael-freidgeim-webjet commented Jan 7, 2024

@markerikson another place where link explaining dev/prods mode should be added
https://redux-toolkit.js.org/api/getDefaultMiddleware#development

@markerikson
Copy link
Contributor

@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.

@michael-freidgeim-webjet
Copy link
Author

michael-freidgeim-webjet commented Jan 7, 2024 via email

@phryneas
Copy link
Member

phryneas commented Jan 7, 2024

"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.

@timdorr
Copy link
Member

timdorr commented Jan 7, 2024

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:

image

My best guess is a browser extension or something on your network is blocking access to Algolia and preventing it from showing up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants