Browse Source

Revert "initial perf, which gets stripped out in production (#4131)" (#4636)

This reverts commit 5ea2150ae7.
bubble
kyle 6 years ago
committed by GitHub
parent
commit
a2015ee08b
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 8 additions and 61 deletions
  1. +1
    -1
      make-webpack-config.js
  2. +1
    -2
      package.json
  3. +0
    -7
      src/core/plugins/spec/actions.js
  4. +1
    -9
      src/core/plugins/spec/reducers.js
  5. +3
    -9
      src/core/system.js
  6. +0
    -16
      src/perf.js
  7. +1
    -11
      webpack-dist.config.js
  8. +1
    -1
      webpack-hot-dev-server.config.js
  9. +0
    -5
      webpack-watch.config.js

+ 1
- 1
make-webpack-config.js View File

@@ -41,7 +41,7 @@ var commonRules = [
{ test: /\.(woff|woff2)(\?.*)?$/,
loader: "url-loader?limit=100000" },
{ test: /\.(ttf|eot)(\?.*)?$/,
loader: "file-loader" },
loader: "file-loader" }
]

module.exports = function(rules, options) {


+ 1
- 2
package.json View File

@@ -154,8 +154,7 @@
"uglifyjs-webpack-plugin": "^1.2.5",
"url-loader": "0.5.9",
"webpack": "^2.6.1",
"webpack-bundle-size-analyzer": "^2.5.0",
"webpack-strip-block": "^0.2.0"
"webpack-bundle-size-analyzer": "^2.5.0"
},
"config": {
"deps_check_dir": ".deps_check"


+ 0
- 7
src/core/plugins/spec/actions.js View File

@@ -104,10 +104,6 @@ export const resolveSpec = (json, url) => ({specActions, specSelectors, errActio

let specStr = specSelectors.specStr()

/* develblock:start */
require("root/src/perf").start("resolve")
/* develblock:end */

return resolve({
fetch,
spec: json,
@@ -135,9 +131,6 @@ export const resolveSpec = (json, url) => ({specActions, specSelectors, errActio
errActions.newThrownErrBatch(preparedErrors)
}

/* develblock:start */
require("root/src/perf").stop("resolve")
/* develblock:end */
return specActions.updateResolved(spec)
})
}


+ 1
- 9
src/core/plugins/spec/reducers.js View File

@@ -42,15 +42,7 @@ export default {
},

[UPDATE_RESOLVED]: (state, action) => {
/* develblock:start */
require("root/src/perf").start("UPDATE_RESOLVED")
/* develblock:end */
const resolved = fromJSOrdered(action.payload)

/* develblock:start */
require("root/src/perf").stop("UPDATE_RESOLVED")
/* develblock:end */
return state.setIn(["resolved"], resolved)
return state.setIn(["resolved"], fromJSOrdered(action.payload))
},

[UPDATE_RESOLVED_SUBTREE]: (state, action) => {


+ 3
- 9
src/core/system.js View File

@@ -15,15 +15,9 @@ const idFn = a => a
function createStoreWithMiddleware(rootReducer, initialState, getSystem) {

let middlwares = [
/* develblock:start */
// Measure actions
() => next => action => {
require("root/src/perf").start("action:"+action.type)
const res = next(action)
require("root/src/perf").stop("action:"+action.type)
return res
},
/* develblock:end */
// createLogger( {
// stateTransformer: state => state && state.toJS()
// } ),
systemThunkMiddleware( getSystem )
]



+ 0
- 16
src/perf.js View File

@@ -1,16 +0,0 @@
// This uses experimental console methods, to track performance

module.exports = {
start(str) {
/* develblock:start */
// eslint-disable-next-line no-console
console.time(str)
/* develblock:end */
},
stop(str) {
/* develblock:start */
// eslint-disable-next-line no-console
console.timeEnd(str)
/* develblock:end */
}
}

+ 1
- 11
webpack-dist.config.js View File

@@ -15,17 +15,7 @@ let rules = [
},
{ loader: "babel-loader?retainLines=true" }
]
},
// This will strip out blocks of code that start with:
/* develblock:start */
// And end with
/* develblock:end */
{
test: /\.jsx?$/,
enforce: "pre",
exclude: /(node_modules|\.spec\.js)/,
loader: "webpack-strip-block"
},
}
]
rules = rules.concat(styleRules)



+ 1
- 1
webpack-hot-dev-server.config.js View File

@@ -35,7 +35,7 @@ const rules = [
}
}
]
},
}
]

module.exports = require("./make-webpack-config")(rules, {


+ 0
- 5
webpack-watch.config.js View File

@@ -5,9 +5,4 @@ config.plugins = config.plugins.filter(plugin => {
return plugin.constructor.name !== "UglifyJsPlugin"
})

config.module.rules = config.module.rules.filter(rule => {
// Disable minification
return rule.loader != "webpack-strip-block"
})

module.exports = config

Loading…
Cancel
Save