-
Notifications
You must be signed in to change notification settings - Fork 11.9k
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
[2.8.0] Bundle & non bundle #6155
Comments
See #6153 |
Well, it answers my question but does not fix the issue described here. https://www.chartjs.org/docs/latest/getting-started/installation.html?h=bundle
in 2.8.0, the Chart.bundle.js does not seem to include moment (but stand-alone do) That change should be on a major version. |
For What bundler are you using? |
I think Did you try: https://webpack.js.org/configuration/externals/ // webpack.config.js
module.exports = {
//...
externals: {
moment: 'moment'
}
}; |
@simonbrunel Yes, I tried with I had this case on another library recently, they fixed a 2,5 years old issue and considered it a bug fix but in the usage it was a breaking change. |
The previous behavior was a bug, and until v3, moment needs to be a dependency (instead of a peer-dependency), so that's currently the proper/official way to do it. I'm glad that it works for you now!
2.8.0 introduces adapters to allow users to pick whatever lib they want but until v3, we can't remove Moment.js from the core build. In v3, moment will be an external adapter if still supported.
No, we don't want to implement ourselves the date logic, so the time scale will still rely on a 3rd party lib.
That was a bug, not a feature, and you relied on it to exclude moment from your build instead of using the webpack I don't think anyone realized that the behavior of |
It's the question here and sure it's not easy to evaluate. It's not a big deal in my case, but it can be for others.
Glad to hear it, can't wait for v3! Thanks for your time & your work on this lib! |
Expected Behavior
Chart.js -> should not import moment
Chart.bundle.js -> should import moment
Current Behavior
Chart.js -> import moment
Chart.bundle.js -> does not import moment
Possible Solution
Remove moment and use native Date :D
Context
from 155ko (v2.7.x) to 413ko (v2.8.x) for my chartjs chunk.
205ko after replacing Chart.js by Chart.bundle.js which is +50ko minified comparing to the v2.7.0
Pluginable approach should be a must-have
Environment
The text was updated successfully, but these errors were encountered: