react-nativedevelopment-environmentproduction-environmentproductiondev-mode

Whats the difference between development and production mode?


Unfortunately, I am not much aware of these two terms and I have a feeling that I need to know more about these as I am approaching an app release. so, if I am running the app on development mode am I not using exactly the same code as production? Like what does it actually change and whats the purpose of it? If it's in the sense of server than that's understandable, I don't wanna mess with the server that's being used by the users, so I guess i need to connect to a second server - development, however, I am interested to know what does it change in my code? I am still gonna use the same locally stored project right?

Sorry for being so naive!


Solution

  • The development build is used - as the name suggests - for development reasons. You have Source Maps, debugging and often times hot reloading ability in those builds. React Native includes some very useful tools for development: remote JavaScript debugging in Chrome, live reload, hot reloading, and an element inspector similar to the beloved inspector that you use in Chrome.

    The production build, on the other hand, runs in production mode which means this is the code running on your client's side. The production build runs uglify and builds your source files into one or multiple minimized files. There's also no source maps or hot reloading included. Further more , Production mode is most useful for two things. They are Testing your app's performance, as Development slows your app down considerably and Catching bugs that only show up in production.

    Hope this might help

    https://docs.expo.io/versions/latest/workflow/development-mode/