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

Rename babel-plugin-minify-computed-member-expressions to the existin… #33

Merged
merged 12 commits into from
Jun 29, 2016

Conversation

hzoo
Copy link
Member

@hzoo hzoo commented Jun 27, 2016

…g babel-plugin-transform-member-expression-literals

Ref #19 (comment)

Should all of the plugins be namespaced under minify-? or should we reuse the old ones and move them over?

After this PR/Release

  • Remove plugins from babel
  • Move plugins into minify section/preset on babeljs.io

@hzoo hzoo force-pushed the move-babel-minify-plugins branch from 072490a to 123f37e Compare June 27, 2016 18:24
@hzoo
Copy link
Member Author

hzoo commented Jun 27, 2016

fixup minify-type-constructors and rm from minify-simplify (be75675) - it looks like the changes from https://github.com/amasad/babel-minify/pull/17/files were lost in the split up pr b510d6e

@hzoo hzoo force-pushed the move-babel-minify-plugins branch from 111085e to b2ec0f8 Compare June 27, 2016 20:46
@hzoo hzoo mentioned this pull request Jun 27, 2016
13 tasks
@hzoo hzoo force-pushed the move-babel-minify-plugins branch from b2ec0f8 to f77b281 Compare June 27, 2016 21:59
@hzoo hzoo force-pushed the move-babel-minify-plugins branch from f77b281 to beced12 Compare June 27, 2016 22:04
@amasad
Copy link
Member

amasad commented Jun 28, 2016

LGTM -- merge whenever you're ready (make sure tests pass and no regression in benchmarks)

@hzoo
Copy link
Member Author

hzoo commented Jun 28, 2016

I might as well move over node-env-inline and inline-environment-variables and we can decide to deprecate or move them again

npm t

> @ test /Users/hzhu/dev/babel-minify
> eslint src/ && jest

Using Jest CLI v0.6.1
 PASS  packages/babel-helper-is-nodes-equiv/__tests__/is-nodes-equiv-test.js (1.764s)
 PASS  packages/babel-plugin-minify-empty-function/__tests__/empty-function-test.js (1.826s)
 PASS  packages/babel-plugin-minify-replace/__tests__/replace-test.js (1.864s)
 PASS  packages/babel-plugin-minify-flip-comparisons/__tests__/flip-comparisons-test.js (1.846s)
 PASS  packages/babel-plugin-minify-infinity/__tests__/infinity-test.js (1.891s)
 PASS  packages/babel-plugin-minify-mangle-names/__tests__/mangle-names-test.js (2.382s)
 PASS  packages/babel-plugin-minify-simplify/__tests__/simplify-test.js (2.932s)
 PASS  packages/babel-plugin-minify-guarded-expressions/__tests__/guarded-expressions-test.js (1.114s)
 PASS  packages/babel-plugin-minify-constant-folding/__tests__/constant-folding-test.js (1.076s)
 PASS  packages/babel-plugin-transform-merge-sibling-variables/__tests__/transform-merge-sibling-variables-test.js (1.134s)
 PASS  packages/babel-plugin-transform-simplify-comparison-operators/__tests__/strict-equals-test.js (1.088s)
 PASS  packages/babel-plugin-transform-remove-debugger/__tests__/remove-debugger-test.js (1.046s)
 PASS  packages/babel-plugin-transform-member-expression-literals/__tests__/transform-member-expression-literals-test.js (1.055s)
 PASS  packages/babel-plugin-transform-property-literals/__tests__/transform-property-literals-test.js (0.877s)
 PASS  packages/babel-plugin-minify-type-constructors/__tests__/type-constructors-test.js (0.802s)
 PASS  packages/babel-plugin-transform-undefined-to-void/__tests__/undefined-test.js (0.854s)
 PASS  packages/babel-plugin-transform-minify-booleans/__tests__/booleans-test.js (0.841s)
 PASS  packages/babel-plugin-transform-remove-console/__tests__/remove-console-test.js (1.1s)
 PASS  packages/babel-plugin-minify-dead-code-elimination/__tests__/dead-code-elimination-test.js (4.479s)
241 tests passed (241 total in 19 test suites, run time 6.467s)

@hzoo
Copy link
Member Author

hzoo commented Jun 28, 2016

Not sure why I'm getting different results from cloning/npm i/bootstrap

Looks like it's a bit bigger/slower but negligible. Might be a good idea to see the diff though

new

./scripts/benchmark.js ./scripts/fixtures/backbone.js
        raw     raw win gzip   gzip win parse time run
babel   21.93kB 219%    7.3kB  169%     2ms        748ms
uglify  21.81kB 221%    7.31kB 169%     1ms        313ms
closure 21.67kB 223%    7.37kB 167%     2ms        2015ms

./scripts/benchmark.js ./scripts/fixtures/react.js
        raw      raw win gzip    gzip win parse time run
closure 171.46kB 265%    52.97kB 168%     12ms       2989ms
uglify  176.39kB 255%    53.17kB 167%     9ms        1473ms
babel   179.17kB 250%    53.28kB 166%     10ms       3176ms

./scripts/benchmark.js ./scripts/fixtures/jquery.js
        raw     raw win gzip    gzip win parse time run
uglify  94.38kB 217%    32.82kB 157%     6ms        1122ms
babel   94.84kB 216%    33.02kB 156%     6ms        3455ms
closure 94.23kB 218%    33.38kB 153%     8ms        2657ms

Ignore: Ok I cloned the repo and was getting different results for some reason: https://gist.github.com/hzoo/3072a8f72f12a8aeb1dc0e91347e00e9

@hzoo hzoo mentioned this pull request Jun 28, 2016
@hzoo
Copy link
Member Author

hzoo commented Jun 29, 2016

Ok just found out the benchmark doesn't run all the plugins

@hzoo
Copy link
Member Author

hzoo commented Jun 29, 2016

./scripts/benchmark.js ./scripts/fixtures/jquery.js
              raw     raw win gzip    gzip win parse time run
uglify        94.38kB 217%    32.82kB 157%     6ms        971ms
minify-preset 93.63kB 220%    32.94kB 156%     6ms        3224ms
babel         94.91kB 216%    33.04kB 156%     6ms        2585ms
closure       94.23kB 218%    33.38kB 153%     7ms        2101ms

./scripts/benchmark.js ./scripts/fixtures/react.js
              raw      raw win gzip    gzip win parse time run
minify-preset 176.03kB 256%    52.8kB  168%     9ms        2872ms
closure       171.46kB 265%    52.97kB 168%     11ms       2455ms
uglify        176.39kB 255%    53.17kB 167%     9ms        1267ms
babel         182.69kB 243%    53.7kB  164%     10ms       2263ms

./scripts/benchmark.js ./scripts/fixtures/backbone.js
              raw     raw win gzip   gzip win parse time run
minify-preset 21.74kB 222%    7.28kB 170%     1ms        725ms
uglify        21.81kB 221%    7.31kB 169%     2ms        278ms
babel         22.17kB 215%    7.32kB 169%     1ms        414ms
closure       21.67kB 223%    7.37kB 167%     2ms        1411ms

@@ -73,6 +73,14 @@ function test(name, callback) {
});
}

test('minify-preset', function (code, callback) {
Copy link
Member Author

@hzoo hzoo Jun 29, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can just replace below one with this (wasn't sure if that was specifically needed) @amasad

@hzoo hzoo merged commit 66794df into master Jun 29, 2016
@hzoo hzoo deleted the move-babel-minify-plugins branch June 29, 2016 01:12
@hzoo
Copy link
Member Author

hzoo commented Jun 29, 2016

Oops.. mean't to do a regular merge commit (oh well)

Will do

in another pr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants