React production build in a meteor app - reactjs

i have developped an application React/Redux with the Meteor JS framework.
The installation of React in meteor is class (npm command) :
meteor npm install --save react
But when i check with the react-devtools extension, i see that React Version is the development build instead of production build.
(the message is "This page is using the development build of React. 🚧 ")
What have i to do to use the react production build instead in my meteor app ?
i already tried to set environnement variables :
export NODE_ENV='production'
but the result is the same.

Running the meteor with production flag e.g. meteor --production should mimic how the meteor app builds for production. To learn more about the deployment of the meteor apps read the meteor guide about deployment and monitoring.

this issue is solved with the Meteor version 1.5.1 (using the --production flag)
now i obtain this message : This page is using the production build of React. ✅

Related

If I run npm build on a react app with unnecessary dependencies, will it still bundle those dependencies?

Let's say that I have a react app that I've created with create-react-app.
I've installed useless-dependency, but I haven't called it anywhere in my app. I didn't install it as a dev dependency, just as a regular dependency.
Then I run npm build on my app. Will useless-dependency be bundled in with my app, or will the final build be clever enough to ignore it?

How to setup Storybook with Expo and Web

I am trying to setup react native stories on expo which is working fine on the device but I am unable to set it up for the web. I want the components to render on the Web too. Can you please suggest any guide or configuration for that?
This is my storybook configuration: https://github.com/iamshadmirza/RNDSDemo
You should just follow this tutorial : https://www.learnstorybook.com/intro-to-storybook/react-native/en/get-started/
After expo init, you should run npx sb init, then install #storybook/react-native-server (as a devDependency).
Once you're here, just install Jest as seen in the previous link, and run yarn storybook. You'll get Storybook running on localhost:7007

How to upgrade a React project built with create-react-app to the next create-react-app version?

I have a React project built with create-react-app 1.5. I would like to get the features of create-react-app 2.0 for my React project.
Specifically I would like to use this: https://github.com/facebook/create-react-app/pull/3909
Basically, to upgrade a create-react-app project, all you need to do is update the react-scripts module to the latest version and update your app to be compatible with any breaking changes in react-scripts.
Run yarn upgrade --latest react-scripts, rebuild your app, and everything should more-or-less work, barring any breaking changes.

Isomorphic/Universal React app dependencies

I'm developing my first big react app, which will be served dynamically by Express, so it came to my mind, that dependencies (not devDependencies) are just Express and maybe some deployment keep-running-eternally package, but not react, redux, react-router etc, which are conventionally mentioned in package.json deps. All my app is bundled and cooked before deployment, so how correct is it to mention react related deps as dependencies in config.json?
This library is, after I have tried several boiler plates for react server-side-rendering, the simplest! Unlike other libraries which consist a lot of complicated things at first (redux, relay, graphQL etc.,) this library gives detailed explanation on how to do isomorphic react app with the minimum set of only react express and few other necessary ones: (or course in ES6, too)
https://medium.com/front-end-hacking/server-side-rendering-with-react-and-express-382591bfc77c
You just need to install it:
npm install react-server-boilerplate --save
After that, build and start
cd react-server-boilerplate
npm install
npm run build
npm start
Then, use curl in your command line's terminal so check if it truly returns data for SSR or not :
curl http://localhost:8080
The github of that library: https://github.com/Roilan/react-server-boilerplate

Unknown module "Firebase" in React native

I am working on some sample apps using react native. I am trying to integrate Firebase plugin followed by firebase tutorial.
I can able to add firebase plugin using
npm install firebase --save
It gets added to node_modules, when i try to require the plugin
var Firebase = require('firebase');
It throws an exceptions "Requiring unknown module 'firebase'...."
First, make sure you've installed the dependency with:
npm install firebase --save
(make sure you are in your project folder)
Then end the NPM process and restart by running react-native start. That should do the trick.

Resources