The Wayback Machine - https://web.archive.org/web/20200606062607/https://github.com/chartjs/Chart.js/pull/7452
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

Babel loose #7452

Merged
merged 4 commits into from Jun 5, 2020
Merged

Babel loose #7452

merged 4 commits into from Jun 5, 2020

Conversation

@kurkle
Copy link
Collaborator

kurkle commented Jun 1, 2020

  • Use loose mode for babel
  • Stop using Set, because its not handled properly in loose mode

Closes: #7448

Babel issue

kurkle added 3 commits Jun 1, 2020
@benmccann
Copy link
Collaborator

benmccann commented Jun 5, 2020

It'd be helpful to document in the performance section that if you're using Babble with the ES6 build then you should use loose mode

@kurkle kurkle force-pushed the kurkle:babel-loose branch from 57187c6 to 57ca9af Jun 5, 2020
@leeoniya
Copy link

leeoniya commented Jun 5, 2020

Stop using Set, because its not handled properly in loose mode

that's too bad. are you sure it's the use of Set rather than your spreading of it into an array? IE11 has Set support. you'd just need to forEach over it.

have you guys considered composition in lieu of classes (even without prototype or this). or something like:

function extend(parent, child, props) {
  child.__proto__ = parent;
  var proto = child.prototype = Object.create(parent.prototype);
  proto.constructor = child;
  for (var p in props)
    proto[p] = props[p];
  return child;
}

in uPlot i just stick to functions (most of them in a large instance closure) and have no issues with using Buble and the bundles are extremely compact. you have to avoid for..of and occasionally spreads, but those are really not on the usefulness level of e.g. async/await vs promises.

@kurkle
Copy link
Collaborator Author

kurkle commented Jun 5, 2020

@leeoniya its the spread, but doing forEach with it removes the small speed gain it provides compared to simple object.

We've just about finished to conversion to classes, I doubt there are many volunteers to reverse that now. I testet buble and it created about the same code compared to babel loose, only 5kb bigger, because it did not alias this etc.

@etimberg etimberg merged commit 3c02846 into chartjs:master Jun 5, 2020
5 checks passed
5 checks passed
build (ubuntu-latest) build (ubuntu-latest)
Details
build (windows-latest) build (windows-latest)
Details
codeclimate All good!
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage increased (+0.03%) to 92.034%
Details
@etimberg etimberg added this to the Version 3.0 milestone Jun 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
4 participants
You can’t perform that action at this time.