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

DevTools supports ENV-injected version for better internal bug reports #22635

Merged
merged 1 commit into from
Oct 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions packages/react-devtools-extensions/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
2 changes: 1 addition & 1 deletion packages/react-devtools-extensions/webpack.backend.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
2 changes: 1 addition & 1 deletion packages/react-devtools-extensions/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down