Skip to content

Commit c237f25

Browse files
committed
Introduce React.Perf in all non-production builds.
1 parent 8633372 commit c237f25

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
"promise-worker": "^1.1.1",
5050
"prop-types": "^15.5.10",
5151
"react": "^15.4.0",
52-
"react-addons-perf": "0.14.8",
52+
"react-addons-perf": "15.4.2",
5353
"react-addons-shallow-compare": "0.14.8",
5454
"react-addons-test-utils": "^15.4.0",
5555
"react-collapse": "2.3.1",

src/core/index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ import ApisPreset from "core/presets/apis"
66
import * as AllPlugins from "core/plugins/all"
77
import { parseSearch } from "core/utils"
88

9+
if (process.env.NODE_ENV !== "production") {
10+
const Perf = require("react-addons-perf")
11+
window.Perf = Perf
12+
}
13+
914
// eslint-disable-next-line no-undef
1015
const { GIT_DIRTY, GIT_COMMIT, PACKAGE_VERSION, HOSTNAME, BUILD_TIME } = buildInfo
1116

0 commit comments

Comments
 (0)