mirror of
https://github.com/zebrajr/react.git
synced 2026-01-15 12:15:22 +00:00
DevTools supports ENV-injected version for better internal bug reports (#22635)
This commit is contained in:
14
packages/react-devtools-extensions/utils.js
vendored
14
packages/react-devtools-extensions/utils.js
vendored
@@ -30,12 +30,14 @@ function getGitCommit() {
|
||||
}
|
||||
}
|
||||
|
||||
function getVersionString() {
|
||||
const packageVersion = JSON.parse(
|
||||
readFileSync(
|
||||
resolve(__dirname, '..', 'react-devtools-core', './package.json'),
|
||||
),
|
||||
).version;
|
||||
function getVersionString(packageVersion = null) {
|
||||
if (packageVersion == null) {
|
||||
packageVersion = JSON.parse(
|
||||
readFileSync(
|
||||
resolve(__dirname, '..', 'react-devtools-core', './package.json'),
|
||||
),
|
||||
).version;
|
||||
}
|
||||
|
||||
const commit = getGitCommit();
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ const builtModulesDir = resolve(
|
||||
|
||||
const __DEV__ = NODE_ENV === 'development';
|
||||
|
||||
const DEVTOOLS_VERSION = getVersionString();
|
||||
const DEVTOOLS_VERSION = getVersionString(process.env.DEVTOOLS_VERSION);
|
||||
|
||||
const featureFlagTarget = process.env.FEATURE_FLAG_TARGET || 'extension-oss';
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ const builtModulesDir = resolve(
|
||||
|
||||
const __DEV__ = NODE_ENV === 'development';
|
||||
|
||||
const DEVTOOLS_VERSION = getVersionString();
|
||||
const DEVTOOLS_VERSION = getVersionString(process.env.DEVTOOLS_VERSION);
|
||||
|
||||
const LOGGING_URL = process.env.LOGGING_URL || null;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user