You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by GitBox <gi...@apache.org> on 2021/11/11 11:29:46 UTC

[GitHub] [echarts] LeaVerou opened a new issue #16054: Using SVGRenderer from CDN

LeaVerou opened a new issue #16054:
URL: https://github.com/apache/echarts/issues/16054


   ### What problem does this feature solve?
   I'm not sure if this due to lack of docs around this, but it does not seem possible to use SVGRenderer when using echarts from jsdelivr. Also, it does not seem possible to import individual modules either and let the browser do the tree-shaking, only one large monolithic bundle. 
   
   ### What does the proposed API look like?
   It would be good to have built versions on jsdelivr of all modules one can import via the npm syntax, so that people can do things like [this][1] while using a CDN as well. 
   
   [1]: https://echarts.apache.org/handbook/en/basics/import#importing-required-charts-and-components-to-have-minimal-bundle
   
   <!-- This issue is generated by echarts-issue-helper. DO NOT REMOVE -->
   <!-- This issue is in English. DO NOT REMOVE -->


-- 
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: commits-unsubscribe@echarts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [echarts] pissang edited a comment on issue #16054: Importing specific modules from CDN

Posted by GitBox <gi...@apache.org>.
pissang edited a comment on issue #16054:
URL: https://github.com/apache/echarts/issues/16054#issuecomment-966346256


   Hi, I'm afraid we can only import [the whole bundle](https://cdn.jsdelivr.net/npm/echarts/dist/echarts.esm.js) in the browser now. 
   
   Importing ES module in the browser needs to have `.js` extension explictly. But we don't use `.js` extension in our source code. If we importing modules from 'echarts/core', it will try to load other modules without giving `.js` extension and failed. 
   
   `import-map` seems to be a potential solution, but it don't have wildcard to match all the paths.
   
   I'm not sure if importing specific modules with hundreds of dependency files is better than importing a single large bundled file.  If the scenario exits, I think we can plan to add '.js' extension in our `import` statements to fix this issue. But after this change, we may still need `import-map` to resolve the zrender dependency from npm
   
   @plainheart We put our esm modules in the `lib` folder now


-- 
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: commits-unsubscribe@echarts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [echarts] LeaVerou edited a comment on issue #16054: Importing specific modules from CDN

Posted by GitBox <gi...@apache.org>.
LeaVerou edited a comment on issue #16054:
URL: https://github.com/apache/echarts/issues/16054#issuecomment-966413379


   > Instead of changing the source code, how about handling the `.js` extension name in a build script?
   
   Yup, what @plainheart is saying is exactly what I was suggesting. Keep your source code as-is, just mirror the structure of the `lib` directory in `dist`, with output files that *can* be used in a browser.


-- 
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: commits-unsubscribe@echarts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [echarts] pissang edited a comment on issue #16054: Importing specific modules from CDN

Posted by GitBox <gi...@apache.org>.
pissang edited a comment on issue #16054:
URL: https://github.com/apache/echarts/issues/16054#issuecomment-966346256


   Hi, I'm afraid we can only import [the whole bundle](https://cdn.jsdelivr.net/npm/echarts/dist/echarts.esm.js) in the browser now. 
   
   Importing ES module in the browser needs to have `.js` extension explictly. But we don't use `.js` extension in our source code. If we importing modules from 'echarts/core', it will try to load other modules without giving `.js` extension and failed. 
   
   `import-map` seems to be a potential solution, but it don't have wildcard to match all the paths.
   
   I'm not sure if importing specific modules with hundreds of dependency files has the scenario rather than importing a single large bundled file.  If it exits, I think we can plan to add '.js' extension to fix this issue in our `import` statements. But after this change, we still need `import-map` to resolve the zrender dependency from npm
   
   @plainheart We put our esm modules in the `lib` folder now


-- 
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: commits-unsubscribe@echarts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [echarts] echarts-bot[bot] closed issue #16054: Importing specific modules from CDN

Posted by GitBox <gi...@apache.org>.
echarts-bot[bot] closed issue #16054:
URL: https://github.com/apache/echarts/issues/16054


   


-- 
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: commits-unsubscribe@echarts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [echarts] plainheart commented on issue #16054: Importing specific modules from CDN

Posted by GitBox <gi...@apache.org>.
plainheart commented on issue #16054:
URL: https://github.com/apache/echarts/issues/16054#issuecomment-966345411


   I remember we ever built ES modules into the `esm` directory in several previous versions since [v5.0.0](https://www.jsdelivr.com/package/npm/echarts?version=5.0.2). But it seems only a minimized version remained since [v5.0.2](https://www.jsdelivr.com/package/npm/echarts?version=5.0.2). It would be great if we provide such a feature like the [uuid](https://www.jsdelivr.com/package/npm/uuid?path=dist) package, which provides ESM support for both browser and Node.


-- 
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: commits-unsubscribe@echarts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [echarts] pissang edited a comment on issue #16054: Importing specific modules from CDN

Posted by GitBox <gi...@apache.org>.
pissang edited a comment on issue #16054:
URL: https://github.com/apache/echarts/issues/16054#issuecomment-966346256


   Hi, I'm afraid we can only import [the whole bundle](https://cdn.jsdelivr.net/npm/echarts/dist/echarts.esm.js) in the browser now. 
   
   Importing ES module in the browser needs to have `.js` extension explictly. But we don't use `.js` extension in our source code. If we importing modules from 'echarts/core', it will try to load other modules without giving `.js` extension and failed. 
   
   `import-map` seems to be a potential solution, but it don't have wildcard to match all the paths.
   
   I'm not sure if importing specific modules with hundreds of dependency files has the scenario rather than importing a single large bundled file.  If it exits, I think we can plan to add '.js' extension in our `import` statements to fix this issue. But after this change, we may still need `import-map` to resolve the zrender dependency from npm
   
   @plainheart We put our esm modules in the `lib` folder now


-- 
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: commits-unsubscribe@echarts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [echarts] pissang commented on issue #16054: Importing specific modules from CDN

Posted by GitBox <gi...@apache.org>.
pissang commented on issue #16054:
URL: https://github.com/apache/echarts/issues/16054#issuecomment-966346256


   Hi, I'm afraid we can only import [the whole bundle](https://cdn.jsdelivr.net/npm/echarts/dist/echarts.esm.js) in the browser now. 
   
   Importing ES module in the browser needs to have `.js` extension explictly. But we don't use `.js extension in our source code. If we importing modules from 'echarts/core', it will try to load other modules without giving `.js` extension and failed. 
   
   `import-map` seems to be a potential solution, but it don't have wildcard to match all the paths.
   
   I'm not sure if importing specific modules with hundreds of dependency files has the scenario rather than importing a single large bundled file.  If there is a scenario, I think we can plan to add '.js' extension to fix this issue in our `import` statements.


-- 
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: commits-unsubscribe@echarts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [echarts] pissang edited a comment on issue #16054: Importing specific modules from CDN

Posted by GitBox <gi...@apache.org>.
pissang edited a comment on issue #16054:
URL: https://github.com/apache/echarts/issues/16054#issuecomment-966346256


   Hi, I'm afraid we can only import [the whole bundle](https://cdn.jsdelivr.net/npm/echarts/dist/echarts.esm.js) in the browser now. 
   
   Importing ES module in the browser needs to have `.js` extension explictly. But we don't use `.js` extension in our source code. If we importing modules from 'echarts/core', it will try to load other modules without giving `.js` extension and failed. 
   
   `import-map` seems to be a potential solution, but it don't have wildcard to match all the paths.
   
   I'm not sure if importing specific modules with hundreds of dependency files is better than importing a single large bundled file.  If it exits, I think we can plan to add '.js' extension in our `import` statements to fix this issue. But after this change, we may still need `import-map` to resolve the zrender dependency from npm
   
   @plainheart We put our esm modules in the `lib` folder now


-- 
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: commits-unsubscribe@echarts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [echarts] pissang edited a comment on issue #16054: Importing specific modules from CDN

Posted by GitBox <gi...@apache.org>.
pissang edited a comment on issue #16054:
URL: https://github.com/apache/echarts/issues/16054#issuecomment-966346256


   Hi, I'm afraid we can only import [the whole bundle](https://cdn.jsdelivr.net/npm/echarts/dist/echarts.esm.js) in the browser now. 
   
   Importing ES module in the browser needs to have `.js` extension explictly. But we don't use `.js extension in our source code. If we importing modules from 'echarts/core', it will try to load other modules without giving `.js` extension and failed. 
   
   `import-map` seems to be a potential solution, but it don't have wildcard to match all the paths.
   
   I'm not sure if importing specific modules with hundreds of dependency files has the scenario rather than importing a single large bundled file.  If there is a scenario, I think we can plan to add '.js' extension to fix this issue in our `import` statements. But after this change, we still need `import-map` to resolve the zrender dependency in node_modules


-- 
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: commits-unsubscribe@echarts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [echarts] echarts-bot[bot] commented on issue #16054: Using SVGRenderer from CDN

Posted by GitBox <gi...@apache.org>.
echarts-bot[bot] commented on issue #16054:
URL: https://github.com/apache/echarts/issues/16054#issuecomment-966227243


   Hi! We've received your issue and please be patient to get responded. 🎉
   The average response time is expected to be within one day for weekdays.
   
   In the meanwhile, please make sure that it contains **a minimum reproducible demo** and necessary **images** to illustrate. Otherwise, our committers will ask you to do so.
   
   *A minimum reproducible demo* should contain as little data and components as possible but can still illustrate your problem. This is the best way for us to reproduce it and solve the problem faster.
   
   You may also check out the [API](https://echarts.apache.org/api.html) and [chart option](https://echarts.apache.org/option.html) to get the answer.
   
   If you don't get helped for a long time (over a week) or have an urgent question to ask, you may also send an email to dev@echarts.apache.org. Please attach the issue link if it's a technical question.
   
   If you are interested in the project, you may also subscribe to our [mailing list](https://echarts.apache.org/maillist.html).
   
   Have a nice day! 🍵


-- 
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: commits-unsubscribe@echarts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [echarts] plainheart commented on issue #16054: Importing specific modules from CDN

Posted by GitBox <gi...@apache.org>.
plainheart commented on issue #16054:
URL: https://github.com/apache/echarts/issues/16054#issuecomment-966353872


   Instead of changing the source code, how about handling the `.js` extension name in a build script?


-- 
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: commits-unsubscribe@echarts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [echarts] plainheart edited a comment on issue #16054: Importing specific modules from CDN

Posted by GitBox <gi...@apache.org>.
plainheart edited a comment on issue #16054:
URL: https://github.com/apache/echarts/issues/16054#issuecomment-966345411


   I remember we ever built ES modules into the `esm` directory in several previous versions since [v5.0.0](https://www.jsdelivr.com/package/npm/echarts?version=5.0.2). But it seems only a minimized version remained since [v5.0.2](https://www.jsdelivr.com/package/npm/echarts?version=5.0.2). It would be great if we provide such a feature like the [uuid](https://www.jsdelivr.com/package/npm/uuid?path=dist) package, which provides ESM support for both browser and Node.
   
   ping @pissang


-- 
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: commits-unsubscribe@echarts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [echarts] pissang edited a comment on issue #16054: Importing specific modules from CDN

Posted by GitBox <gi...@apache.org>.
pissang edited a comment on issue #16054:
URL: https://github.com/apache/echarts/issues/16054#issuecomment-966346256


   Hi, I'm afraid we can only import [the whole bundle](https://cdn.jsdelivr.net/npm/echarts/dist/echarts.esm.js) in the browser now. 
   
   Importing ES module in the browser needs to have `.js` extension explictly. But we don't use `.js extension in our source code. If we importing modules from 'echarts/core', it will try to load other modules without giving `.js` extension and failed. 
   
   `import-map` seems to be a potential solution, but it don't have wildcard to match all the paths.
   
   I'm not sure if importing specific modules with hundreds of dependency files has the scenario rather than importing a single large bundled file.  If there is a scenario, I think we can plan to add '.js' extension to fix this issue in our `import` statements. But after this change, we still need `import-map` to resolve the zrender dependency from npm


-- 
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: commits-unsubscribe@echarts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [echarts] LeaVerou commented on issue #16054: Importing specific modules from CDN

Posted by GitBox <gi...@apache.org>.
LeaVerou commented on issue #16054:
URL: https://github.com/apache/echarts/issues/16054#issuecomment-966413379


   > Instead of changing the source code, how about handling the `.js` extension name in a build script?
   
   Yeah, that's what I was suggesting. Keep your source code as-is, just mirror the structure of the `lib` directory in `dist`, with output files that *can* be used in a browser.


-- 
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: commits-unsubscribe@echarts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [echarts] pissang edited a comment on issue #16054: Importing specific modules from CDN

Posted by GitBox <gi...@apache.org>.
pissang edited a comment on issue #16054:
URL: https://github.com/apache/echarts/issues/16054#issuecomment-966346256


   Hi, I'm afraid we can only import [the whole bundle](https://cdn.jsdelivr.net/npm/echarts/dist/echarts.esm.js) in the browser now. 
   
   Importing ES module in the browser needs to have `.js` extension explictly. But we don't use `.js` extension in our source code. If we importing modules from 'echarts/core', it will try to load other modules without giving `.js` extension and failed. 
   
   `import-map` seems to be a potential solution, but it don't have wildcard to match all the paths.
   
   I'm not sure if importing specific modules with hundreds of dependency files has the scenario rather than importing a single large bundled file.  If there is a scenario, I think we can plan to add '.js' extension to fix this issue in our `import` statements. But after this change, we still need `import-map` to resolve the zrender dependency from npm
   
   @plainheart We put our esm modules in the `lib` folder now


-- 
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: commits-unsubscribe@echarts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [echarts] pissang edited a comment on issue #16054: Importing specific modules from CDN

Posted by GitBox <gi...@apache.org>.
pissang edited a comment on issue #16054:
URL: https://github.com/apache/echarts/issues/16054#issuecomment-966346256


   Hi, I'm afraid we can only import [the whole bundle](https://cdn.jsdelivr.net/npm/echarts/dist/echarts.esm.js) in the browser now. 
   
   Importing ES module in the browser needs to have `.js` extension explictly. But we don't use `.js` extension in our source code. If we importing modules from 'echarts/core', it will try to load other modules without giving `.js` extension and failed. 
   
   `import-map` seems to be a potential solution, but it don't have wildcard to match all the paths.
   
   I'm not sure if importing specific modules with hundreds of dependency files has the scenario rather than importing a single large bundled file.  If it exits, I think we can plan to add '.js' extension in our `import` statements to fix this issue. But after this change, we still need `import-map` to resolve the zrender dependency from npm
   
   @plainheart We put our esm modules in the `lib` folder now


-- 
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: commits-unsubscribe@echarts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org