growthbook-react icon indicating copy to clipboard operation
growthbook-react copied to clipboard

Enable dev mode instead of disable

Open AnandChowdhary opened this issue 4 years ago • 2 comments

We have a use case where we use Vercel for staging environment deployments. Here, the build is very much like a production build in that the NODE_ENV is production, but we would still like to see the variation switcher from dev mode.

https://github.com/growthbook/growthbook-react/blob/main/src/index.tsx#L60 hardcodes that disableDevMode can only be used when NODE_ENV is not production. Perhaps if we remove this rule and set disableDevMode = process.env.NODE_ENV === "production" as the default value, we will be able to overwrite disableDevMode.

AnandChowdhary avatar Aug 07 '21 10:08 AnandChowdhary

We also would benefit from this exact same scenario. We have production builds on staging, which we would want to enable the devmode for, so we can test out the variations.

matclayton avatar Sep 07 '21 23:09 matclayton

There is now a standalone dev mode npm package that can be used even when NODE_ENV is production. https://www.npmjs.com/package/@growthbook/dev

It's only meant for dev/staging environments so make sure to conditionally render it so it doesn't show up in actual production.

Also, FYI this repo is being deprecated and the react code has moved to the main GrowthBook monorepo at https://github.com/growthbook/growthbook

jdorn avatar Sep 13 '21 14:09 jdorn