100pah commented on PR #20485: URL: https://github.com/apache/echarts/pull/20485#issuecomment-2472880033
Some monos: + Found that at present echarts only uses `__extends` function of tslib. (by searching `from "tslib` in echarts/lib.). + About bundle size: After tree shaking (tested in [email protected], `tsc -b && vite build`), only used functions of tslib will be included in bundle. That is only `__extends` (and `extendStatics`, which is called by `__extends` internally) is included. So the bundle size is probably not a concern till now. + Compatibility if changing to `"tslib": "^x.x.x"`: Checked the commit log of `__extends` on git, there's no breaking. Thus this change does not break echarts. + Use different versions of tslib in one JS context: (tested in [email protected], `tsc -b && vite build`) , the build bundle is like this : ```js // At the top scope of the bundle file dist/assets/index-JsGP8STl.js // Two tslib are included but the name are modified to avoid conflict. var extendStatics$1 = function(d, b) { /* ... */ }; function __extends$1(d, b) { /* ... */ } /* ... */ var extendStatics = function(d, b) { /* ... */ }; function __extends(d, b) { /* ... */ } ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
