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

Experiment with lebab (transpiling *to* ES6) #180

Closed
Fil opened this issue Nov 12, 2019 · 4 comments
Closed

Experiment with lebab (transpiling *to* ES6) #180

Fil opened this issue Nov 12, 2019 · 4 comments

Comments

@Fil
Copy link
Member

Fil commented Nov 12, 2019

As an experiment (prompted by #179), I applied lebab to d3-geo, which resulted in the branch es6 in https://github.com/Fil/d3-geo/commits/es6

I've used a private fork because I don't think we want this for d3-geo.

Fun results though: the build loses 2.1% & minified build loses 2.9%.

ES5:

  • 88441 d3-geo.js
  • 35626 d3-geo.min.js

ES6:

  • 86528 d3-geo.js
  • 34590 d3-geo.min.js

log

for rule in arrow arrow-return for-of for-each arg-rest arg-spread obj-method obj-shorthand no-strict let; do
  lebab --replace 'src/**/*.js' --transform $rule
  yarn test && git commit -a -m"lebab --replace 'src/**/*.js' --transform $rule"
done

patch for the rule let
ignore the rule class

for rule in commonjs template ; do
  lebab --replace 'src/**/*.js' --transform $rule
  yarn test && git commit -a -m"lebab --replace 'src/**/*.js' --transform $rule"
done

rule default-param needs a fix for src/clip/rectangle.js
ignore rule destruct-param (same issue as rule default-param)

for rule in  includes ; do
  lebab --replace 'src/**/*.js' --transform $rule
  yarn test && git commit -a -m"lebab --replace 'src/**/*.js' --transform $rule"
done
@mbostock
Copy link
Member

I am strongly opposed to shipping transpiled-to-ES5 code. This will not be reliable, and not something that I want to spend effort supporting.

@gordonwoodhull
Copy link

gordonwoodhull commented Nov 12, 2019

@Fil transpiled d3-geo to ES6!

@mbostock
Copy link
Member

Oh, I totally misread, sorry!

@Fil
Copy link
Member Author

Fil commented Jan 11, 2020

(no need to keep this open)

@Fil Fil closed this as completed Jan 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants