Skip to content

Commit

Permalink
Disable deadcode minify until upstream issue fixed (#676)
Browse files Browse the repository at this point in the history
* Add e2e case for ensure haven't any logs in renderer process

* Disable deadcode minify until upstream issue fixed

also bump babili-webpack-plugin to 0.0.8
  • Loading branch information
jhen0409 authored Jan 25, 2017
1 parent 233bbee commit 311eff8
Show file tree
Hide file tree
Showing 5 changed files with 124 additions and 71 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
"babel-preset-react-optimize": "^1.0.1",
"babel-preset-stage-0": "^6.22.0",
"babel-register": "^6.22.0",
"babili-webpack-plugin": "^0.0.7",
"babili-webpack-plugin": "^0.0.8",
"boiler-room-custodian": "^0.6.1",
"chai": "^3.5.0",
"concurrently": "^3.1.0",
Expand Down
12 changes: 12 additions & 0 deletions test/e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,18 @@ describe('main window', function spec() {
expect(title).to.equal('Hello Electron React!');
});

it('should haven\'t any logs in console of main window', async () => {
const { client } = this.app;
const logs = await client.getRenderProcessLogs();
// Print renderer process logs
logs.forEach(log => {
console.log(log.message);
console.log(log.source);
console.log(log.level);
});
expect(logs).to.be.empty;
});

it('should to Counter with click "to Counter" link', async () => {
const { client } = this.app;

Expand Down
5 changes: 4 additions & 1 deletion webpack.config.electron.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ export default validate(merge(baseConfig, {
/**
* Babli is an ES6+ aware minifier based on the Babel toolchain (beta)
*/
new BabiliPlugin(),
new BabiliPlugin({
// Disable deadcode until https://github.com/babel/babili/issues/385 fixed
babili: ['babel-preset-babili', { deadcode: false }],
}),

/**
* Create global constants which can be configured at compile time.
Expand Down
5 changes: 4 additions & 1 deletion webpack.config.production.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,10 @@ export default validate(merge(baseConfig, {
/**
* Babli is an ES6+ aware minifier based on the Babel toolchain (beta)
*/
new BabiliPlugin(),
new BabiliPlugin({
// Disable deadcode until https://github.com/babel/babili/issues/385 fixed
babili: ['babel-preset-babili', { deadcode: false }],
}),

new ExtractTextPlugin('style.css', { allChunks: true }),

Expand Down
171 changes: 103 additions & 68 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ babel-code-frame@^6.11.0, babel-code-frame@^6.16.0, babel-code-frame@^6.22.0:
esutils "^2.0.2"
js-tokens "^3.0.0"

babel-core@^6.18.0, babel-core@^6.22.0, babel-core@^6.22.1, babel-core@^6.7.2:
babel-core@^6.22.0, babel-core@^6.22.1, babel-core@^6.7.2:
version "6.22.1"
resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.22.1.tgz#9c5fd658ba1772d28d721f6d25d968fc7ae21648"
dependencies:
Expand Down Expand Up @@ -448,6 +448,10 @@ babel-helper-define-map@^6.22.0:
babel-types "^6.22.0"
lodash "^4.2.0"

babel-helper-evaluate-path@^0.0.3:
version "0.0.3"
resolved "https://registry.yarnpkg.com/babel-helper-evaluate-path/-/babel-helper-evaluate-path-0.0.3.tgz#1d103ac9d4a59e5d431842212f151785f7ac547b"

babel-helper-explode-assignable-expression@^6.22.0:
version "6.22.0"
resolved "https://registry.yarnpkg.com/babel-helper-explode-assignable-expression/-/babel-helper-explode-assignable-expression-6.22.0.tgz#c97bf76eed3e0bae4048121f2b9dae1a4e7d0478"
Expand All @@ -465,9 +469,9 @@ babel-helper-explode-class@^6.22.0:
babel-traverse "^6.22.0"
babel-types "^6.22.0"

babel-helper-flip-expressions@^0.0.1:
version "0.0.1"
resolved "https://registry.yarnpkg.com/babel-helper-flip-expressions/-/babel-helper-flip-expressions-0.0.1.tgz#c2ba1599426e7928333fd5c08eee6cdf8328c848"
babel-helper-flip-expressions@^0.0.2:
version "0.0.2"
resolved "https://registry.yarnpkg.com/babel-helper-flip-expressions/-/babel-helper-flip-expressions-0.0.2.tgz#7bab2cf61162bc92703e9b298ef512bcf77d6787"

babel-helper-function-name@^6.22.0:
version "6.22.0"
Expand Down Expand Up @@ -545,9 +549,9 @@ babel-helper-replace-supers@^6.22.0:
babel-traverse "^6.22.0"
babel-types "^6.22.0"

babel-helper-to-multiple-sequence-expressions@^0.0.2:
version "0.0.2"
resolved "https://registry.yarnpkg.com/babel-helper-to-multiple-sequence-expressions/-/babel-helper-to-multiple-sequence-expressions-0.0.2.tgz#07d5d2e674aa62962ac9e0000b539920c301c4b9"
babel-helper-to-multiple-sequence-expressions@^0.0.3:
version "0.0.3"
resolved "https://registry.yarnpkg.com/babel-helper-to-multiple-sequence-expressions/-/babel-helper-to-multiple-sequence-expressions-0.0.3.tgz#c789a0faccd2669c51234be2cea7a3e5a0573c25"

babel-helpers@^6.22.0:
version "6.22.0"
Expand Down Expand Up @@ -585,36 +589,38 @@ babel-plugin-dev-expression@^0.2.1:
version "0.2.1"
resolved "https://registry.yarnpkg.com/babel-plugin-dev-expression/-/babel-plugin-dev-expression-0.2.1.tgz#d4a7beefefbb50e3f2734990a82a2486cf9eb9ee"

babel-plugin-minify-constant-folding@^0.0.1:
version "0.0.1"
resolved "https://registry.yarnpkg.com/babel-plugin-minify-constant-folding/-/babel-plugin-minify-constant-folding-0.0.1.tgz#d4abb5b62ccfc094bdce2a318b2f94fda5a73e29"
babel-plugin-minify-constant-folding@^0.0.3:
version "0.0.3"
resolved "https://registry.yarnpkg.com/babel-plugin-minify-constant-folding/-/babel-plugin-minify-constant-folding-0.0.3.tgz#a511e839562489811987a7a503c43c312c40138a"
dependencies:
babel-helper-evaluate-path "^0.0.3"

babel-plugin-minify-dead-code-elimination@^0.1.0:
babel-plugin-minify-dead-code-elimination@^0.1.2:
version "0.1.2"
resolved "https://registry.yarnpkg.com/babel-plugin-minify-dead-code-elimination/-/babel-plugin-minify-dead-code-elimination-0.1.2.tgz#b50471bd510e3452a3c7964e6092b29003696020"
dependencies:
babel-helper-remove-or-void "^0.0.1"
lodash.some "^4.6.0"

babel-plugin-minify-flip-comparisons@^0.0.1:
version "0.0.1"
resolved "https://registry.yarnpkg.com/babel-plugin-minify-flip-comparisons/-/babel-plugin-minify-flip-comparisons-0.0.1.tgz#679f4493a692afc705c4b79fde1dadb535c4eb08"
babel-plugin-minify-flip-comparisons@^0.0.2:
version "0.0.2"
resolved "https://registry.yarnpkg.com/babel-plugin-minify-flip-comparisons/-/babel-plugin-minify-flip-comparisons-0.0.2.tgz#7d0953aa5876ede6118966bda9edecc63bf346ab"
dependencies:
babel-helper-is-void-0 "^0.0.1"

babel-plugin-minify-guarded-expressions@^0.0.3:
version "0.0.3"
resolved "https://registry.yarnpkg.com/babel-plugin-minify-guarded-expressions/-/babel-plugin-minify-guarded-expressions-0.0.3.tgz#6da1caa0b6abda964647377bd5e19afdbf91cae8"
babel-plugin-minify-guarded-expressions@^0.0.4:
version "0.0.4"
resolved "https://registry.yarnpkg.com/babel-plugin-minify-guarded-expressions/-/babel-plugin-minify-guarded-expressions-0.0.4.tgz#957104a760e6a7ffd967005a7a11621bb42fd11c"
dependencies:
babel-helper-flip-expressions "^0.0.1"
babel-helper-flip-expressions "^0.0.2"

babel-plugin-minify-infinity@^0.0.1:
version "0.0.1"
resolved "https://registry.yarnpkg.com/babel-plugin-minify-infinity/-/babel-plugin-minify-infinity-0.0.1.tgz#9394a4defc9db56da76f13fedd5d5e2d486a4299"
babel-plugin-minify-infinity@^0.0.3:
version "0.0.3"
resolved "https://registry.yarnpkg.com/babel-plugin-minify-infinity/-/babel-plugin-minify-infinity-0.0.3.tgz#4cc99b61d12b434ce80ad675103335c589cba9a1"

babel-plugin-minify-mangle-names@^0.0.4:
version "0.0.4"
resolved "https://registry.yarnpkg.com/babel-plugin-minify-mangle-names/-/babel-plugin-minify-mangle-names-0.0.4.tgz#94812c0c82320f7af97511b7d598527933973197"
babel-plugin-minify-mangle-names@^0.0.6:
version "0.0.6"
resolved "https://registry.yarnpkg.com/babel-plugin-minify-mangle-names/-/babel-plugin-minify-mangle-names-0.0.6.tgz#7311e82292d5add93ca80c4ecfbde9e8a9730a43"

babel-plugin-minify-numeric-literals@^0.0.1:
version "0.0.1"
Expand All @@ -624,17 +630,17 @@ babel-plugin-minify-replace@^0.0.1:
version "0.0.1"
resolved "https://registry.yarnpkg.com/babel-plugin-minify-replace/-/babel-plugin-minify-replace-0.0.1.tgz#5d5aea7cb9899245248d1ee9ce7a2fe556a8facc"

babel-plugin-minify-simplify@^0.0.4:
version "0.0.4"
resolved "https://registry.yarnpkg.com/babel-plugin-minify-simplify/-/babel-plugin-minify-simplify-0.0.4.tgz#940d0dd0db6d4c4c1c51fc34c3c6e0d0ee1d67e9"
babel-plugin-minify-simplify@^0.0.6:
version "0.0.6"
resolved "https://registry.yarnpkg.com/babel-plugin-minify-simplify/-/babel-plugin-minify-simplify-0.0.6.tgz#1d50899b29c3c4503eaefb98365cc5f7a84aedfe"
dependencies:
babel-helper-flip-expressions "^0.0.1"
babel-helper-flip-expressions "^0.0.2"
babel-helper-is-nodes-equiv "^0.0.1"
babel-helper-to-multiple-sequence-expressions "^0.0.2"
babel-helper-to-multiple-sequence-expressions "^0.0.3"

babel-plugin-minify-type-constructors@^0.0.2:
version "0.0.2"
resolved "https://registry.yarnpkg.com/babel-plugin-minify-type-constructors/-/babel-plugin-minify-type-constructors-0.0.2.tgz#4f9a28951e776f31ac11a29cd58cf9eef8b2e292"
babel-plugin-minify-type-constructors@^0.0.3:
version "0.0.3"
resolved "https://registry.yarnpkg.com/babel-plugin-minify-type-constructors/-/babel-plugin-minify-type-constructors-0.0.3.tgz#ab59c1ad835b6b6e8e932b875d4df4dc393d9d26"
dependencies:
babel-helper-is-void-0 "^0.0.1"

Expand Down Expand Up @@ -965,11 +971,15 @@ babel-plugin-transform-function-bind@^6.22.0:
babel-plugin-syntax-function-bind "^6.8.0"
babel-runtime "^6.22.0"

babel-plugin-transform-member-expression-literals@^6.8.0:
babel-plugin-transform-inline-consecutive-adds@^0.0.2:
version "0.0.2"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-inline-consecutive-adds/-/babel-plugin-transform-inline-consecutive-adds-0.0.2.tgz#a58fcecfc09c08fbf9373a5a3e70746c03d01fc1"

babel-plugin-transform-member-expression-literals@^6.8.1:
version "6.8.1"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-member-expression-literals/-/babel-plugin-transform-member-expression-literals-6.8.1.tgz#60b78cb2b814ac71dd6104ef51c496c62e877337"

babel-plugin-transform-merge-sibling-variables@^6.8.0:
babel-plugin-transform-merge-sibling-variables@^6.8.1:
version "6.8.1"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-merge-sibling-variables/-/babel-plugin-transform-merge-sibling-variables-6.8.1.tgz#3211910fd85405a97aee51f1539e3a61b1fa4c61"

Expand All @@ -986,7 +996,7 @@ babel-plugin-transform-object-rest-spread@^6.22.0, babel-plugin-transform-object
babel-plugin-syntax-object-rest-spread "^6.8.0"
babel-runtime "^6.22.0"

babel-plugin-transform-property-literals@^6.8.0:
babel-plugin-transform-property-literals@^6.8.1:
version "6.8.1"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-property-literals/-/babel-plugin-transform-property-literals-6.8.1.tgz#05ed01f6024820b18f1d0495c80fe287176bccd9"

Expand Down Expand Up @@ -1046,17 +1056,33 @@ babel-plugin-transform-regenerator@^6.22.0, babel-plugin-transform-regenerator@^
dependencies:
regenerator-transform "0.9.8"

babel-plugin-transform-regexp-constructors@^0.0.1:
version "0.0.1"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-regexp-constructors/-/babel-plugin-transform-regexp-constructors-0.0.1.tgz#c5878cc4d78437e99d02790d325f163741741ff5"
babel-plugin-transform-regexp-constructors@^0.0.5:
version "0.0.5"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-regexp-constructors/-/babel-plugin-transform-regexp-constructors-0.0.5.tgz#74d95e0c567e6fc1d9c699a084894d40de8e581d"

babel-plugin-transform-remove-console@^6.8.0:
version "6.8.0"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-remove-console/-/babel-plugin-transform-remove-console-6.8.0.tgz#c4162f01ee169491776e64093f4dad8d61125a90"
dependencies:
babel-runtime "^6.0.0"

babel-plugin-transform-remove-debugger@^6.8.0:
version "6.8.0"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-remove-debugger/-/babel-plugin-transform-remove-debugger-6.8.0.tgz#d3ece7d8400473f7a706177ba22fd3026ad7e020"
dependencies:
babel-runtime "^6.0.0"

babel-plugin-transform-remove-undefined@^0.0.4:
version "0.0.4"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-remove-undefined/-/babel-plugin-transform-remove-undefined-0.0.4.tgz#cc75be04b9bbd7bb2005272cc160b4d08692d77c"

babel-plugin-transform-runtime@^6.15.0:
version "6.22.0"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-runtime/-/babel-plugin-transform-runtime-6.22.0.tgz#10968d760bbf6517243081eec778e10fa828551c"
dependencies:
babel-runtime "^6.22.0"

babel-plugin-transform-simplify-comparison-operators@^6.8.0:
babel-plugin-transform-simplify-comparison-operators@^6.8.1:
version "6.8.1"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-simplify-comparison-operators/-/babel-plugin-transform-simplify-comparison-operators-6.8.1.tgz#a307088e0d1c728081777fba568f4107396ab25c"

Expand Down Expand Up @@ -1096,27 +1122,32 @@ babel-polyfill@^6.22.0, babel-polyfill@^6.6.1:
core-js "^2.4.0"
regenerator-runtime "^0.10.0"

babel-preset-babili@^0.0.8:
version "0.0.8"
resolved "https://registry.yarnpkg.com/babel-preset-babili/-/babel-preset-babili-0.0.8.tgz#aeba08a21171166e448fd4226c3cf03bcf682122"
dependencies:
babel-plugin-minify-constant-folding "^0.0.1"
babel-plugin-minify-dead-code-elimination "^0.1.0"
babel-plugin-minify-flip-comparisons "^0.0.1"
babel-plugin-minify-guarded-expressions "^0.0.3"
babel-plugin-minify-infinity "^0.0.1"
babel-plugin-minify-mangle-names "^0.0.4"
babel-preset-babili@^0.0.10:
version "0.0.10"
resolved "https://registry.yarnpkg.com/babel-preset-babili/-/babel-preset-babili-0.0.10.tgz#59118924b77b898eecd8f75a5b97d694719443ff"
dependencies:
babel-plugin-minify-constant-folding "^0.0.3"
babel-plugin-minify-dead-code-elimination "^0.1.2"
babel-plugin-minify-flip-comparisons "^0.0.2"
babel-plugin-minify-guarded-expressions "^0.0.4"
babel-plugin-minify-infinity "^0.0.3"
babel-plugin-minify-mangle-names "^0.0.6"
babel-plugin-minify-numeric-literals "^0.0.1"
babel-plugin-minify-replace "^0.0.1"
babel-plugin-minify-simplify "^0.0.4"
babel-plugin-minify-type-constructors "^0.0.2"
babel-plugin-transform-member-expression-literals "^6.8.0"
babel-plugin-transform-merge-sibling-variables "^6.8.0"
babel-plugin-minify-simplify "^0.0.6"
babel-plugin-minify-type-constructors "^0.0.3"
babel-plugin-transform-inline-consecutive-adds "^0.0.2"
babel-plugin-transform-member-expression-literals "^6.8.1"
babel-plugin-transform-merge-sibling-variables "^6.8.1"
babel-plugin-transform-minify-booleans "^6.8.0"
babel-plugin-transform-property-literals "^6.8.0"
babel-plugin-transform-regexp-constructors "^0.0.1"
babel-plugin-transform-simplify-comparison-operators "^6.8.0"
babel-plugin-transform-property-literals "^6.8.1"
babel-plugin-transform-regexp-constructors "^0.0.5"
babel-plugin-transform-remove-console "^6.8.0"
babel-plugin-transform-remove-debugger "^6.8.0"
babel-plugin-transform-remove-undefined "^0.0.4"
babel-plugin-transform-simplify-comparison-operators "^6.8.1"
babel-plugin-transform-undefined-to-void "^6.8.0"
lodash.isplainobject "^4.0.6"

babel-preset-env@^1.1.8:
version "1.1.8"
Expand Down Expand Up @@ -1332,13 +1363,13 @@ babel-types@^6.15.0, babel-types@^6.19.0, babel-types@^6.22.0, babel-types@^6.3.
lodash "^4.2.0"
to-fast-properties "^1.0.1"

babili-webpack-plugin@^0.0.7:
version "0.0.7"
resolved "https://registry.yarnpkg.com/babili-webpack-plugin/-/babili-webpack-plugin-0.0.7.tgz#763c8de622a270572d0f5804fd6c7f16e9b974be"
babili-webpack-plugin@^0.0.8:
version "0.0.8"
resolved "https://registry.yarnpkg.com/babili-webpack-plugin/-/babili-webpack-plugin-0.0.8.tgz#6c6ef2624320d324014edc4265c6f810d91d013e"
dependencies:
babel-core "^6.18.0"
babel-preset-babili "^0.0.8"
webpack-sources "^0.1.2"
babel-core "^6.22.1"
babel-preset-babili "^0.0.10"
webpack-sources "^0.1.4"

babylon@^6.11.0, babylon@^6.13.0, babylon@^6.15.0, babylon@^6.3.26:
version "6.15.0"
Expand Down Expand Up @@ -1421,9 +1452,9 @@ bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.1.1, bn.js@^4.4.0:
version "4.11.6"
resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.6.tgz#53344adb14617a13f6e8dd2ce28905d1c0ba3215"

boiler-room-custodian@^0.5.0:
version "0.5.0"
resolved "https://registry.yarnpkg.com/boiler-room-custodian/-/boiler-room-custodian-0.5.0.tgz#3caa8df21908d0dfca184019036c260cec0a13f2"
boiler-room-custodian@^0.6.1:
version "0.6.1"
resolved "https://registry.yarnpkg.com/boiler-room-custodian/-/boiler-room-custodian-0.6.1.tgz#253db19d601d32ca442d4b0f2f5e48e3e307c85d"
dependencies:
chalk "^1.1.3"
commander "^2.9.0"
Expand Down Expand Up @@ -4542,6 +4573,10 @@ lodash.isarray@^3.0.0:
version "3.0.4"
resolved "https://registry.yarnpkg.com/lodash.isarray/-/lodash.isarray-3.0.4.tgz#79e4eb88c36a8122af86f844aa9bcd851b5fbb55"

lodash.isplainobject@^4.0.6:
version "4.0.6"
resolved "https://registry.yarnpkg.com/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz#7c526a52d89b45c45cc690b88163be0497f550cb"

lodash.keys@^3.0.0:
version "3.1.2"
resolved "https://registry.yarnpkg.com/lodash.keys/-/lodash.keys-3.1.2.tgz#4dbc0472b156be50a0b286855d1bd0b0c656098a"
Expand Down Expand Up @@ -6623,7 +6658,7 @@ sumchecker@^1.2.0:
debug "^2.2.0"
es6-promise "^4.0.5"

[email protected]:
[email protected], supports-color@^3.1.0:
version "3.1.2"
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-3.1.2.tgz#72a262894d9d408b956ca05ff37b2ed8a6e2a2d5"
dependencies:
Expand All @@ -6637,7 +6672,7 @@ supports-color@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7"

supports-color@^3.1.0, supports-color@^3.1.2, supports-color@^3.2.3:
supports-color@^3.1.2, supports-color@^3.2.3:
version "3.2.3"
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-3.2.3.tgz#65ac0504b3954171d8a64946b2ae3cbb8a5f54f6"
dependencies:
Expand Down Expand Up @@ -7142,7 +7177,7 @@ webpack-merge@^2.4.0:
dependencies:
lodash "^4.17.4"

webpack-sources@^0.1.0, webpack-sources@^0.1.2:
webpack-sources@^0.1.0, webpack-sources@^0.1.4:
version "0.1.4"
resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-0.1.4.tgz#ccc2c817e08e5fa393239412690bb481821393cd"
dependencies:
Expand Down

0 comments on commit 311eff8

Please sign in to comment.