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

Publish native ES6 modules #7186

Closed
dandv opened this Issue Sep 25, 2017 · 10 comments

Comments

Projects
None yet
5 participants
@dandv
Contributor

dandv commented Sep 25, 2017

With native ES6 imports support having landed in Chrome and Safari a few months ago, and Node v8.5.0 adding experimental support for ES6 modules last week, it would be great to publish native ES6 modules for HighCharts and HighStock.

Publishing them at https://code.highcharts.com/ would make it very easy to use from browsers without any bundlers, solving (at least for compatible browsers) long-standing issues like #4994.

@jon-a-nygaard

This comment has been minimized.

Collaborator

jon-a-nygaard commented Sep 28, 2017

@TorsteinHonsi This has been technically ready for a while through our build script. What we need to discuss first is a good location for the files. E.g code.highcharts.com/es6 and code.highcharts.com/js/es6, could be an option.

Also quality check that the final structure works for all our distribution platforms, code.highcharts.com, zip folders, and highcharts-dist.

@jon-a-nygaard

This comment has been minimized.

Collaborator

jon-a-nygaard commented Nov 7, 2017

Internal Note: Landed on url structure code.highcharts.com/es-modules and code.highcharts.com/js/es-modules

@jon-a-nygaard

This comment has been minimized.

Collaborator

jon-a-nygaard commented Feb 20, 2018

The ES modules will be published in the next maintenance release v6.0.8.

@netaisllc

This comment has been minimized.

netaisllc commented Aug 7, 2018

@jon-a-nygaard Hi, it seems like this release has landed (and been surpassed), but I can't find release notes that confirm the availability of native ES modules.

Did I miss it, or did you guys have a change of mind?

Thanks in advance for a hint!

@jon-a-nygaard

This comment has been minimized.

Collaborator

jon-a-nygaard commented Aug 22, 2018

Hi @netaisllc,

Apologies for the late reply.

The ES-modules is released since v6.1.0, release v6.0.8 was bumped to v6.1.0.
You can find the es-modules located at /es-modules for classic mode, and the styled mode under /js/es-modules.
For instance the highcharts master file can be found on our DNS at https://code.highcharts.com/es-modules/masters/highcharts.src.js

The publish of our ES modules was not mentioned in the release article, only briefly in the changelog of v6.1.0.

Best regards
Jon

@dandv

This comment has been minimized.

Contributor

dandv commented Aug 22, 2018

@ljharb

This comment has been minimized.

ljharb commented Aug 22, 2018

export default should be preferred, not avoided.

@jon-a-nygaard

This comment has been minimized.

Collaborator

jon-a-nygaard commented Aug 23, 2018

@dandv Currently we only export to default, and I do not know a way to get around it with our latest version.
I do agree that we should provide named exports as well, and this should not conflict with those using the default export since we can provide both. So I believe this part should be fairly simple to achieve.

However we might need to do some work on our highcharts-assembler should the support of named exports extend to our UMD pattern used in our ES5 distributed files (non ES modules, e.g http://code.highcharts.com/highcharts.src.js).

@chriszrc

This comment has been minimized.

chriszrc commented Sep 25, 2018

Just double checking, with the new es6 modules in highcharts/es-modules, should we be using this for importing? (In this case, I just want highmaps)

import Highcharts from 'highcharts/es-modules/masters/highmaps.src.js';
@jon-a-nygaard

This comment has been minimized.

Collaborator

jon-a-nygaard commented Sep 26, 2018

@chriszrc Yes, that should be correct when loading Highmaps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment