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

[js][es6] add ES6 module exports #8033

Open
zhaoterryy opened this issue Mar 21, 2019 · 2 comments · May be fixed by #10003
Open

[js][es6] add ES6 module exports #8033

zhaoterryy opened this issue Mar 21, 2019 · 2 comments · May be fixed by #10003
Labels
feature-es6 ES6 platform-javascript Everything related to JS / JavaScript
Milestone

Comments

@zhaoterryy
Copy link

Add a way to export classes and functions as an ES6 module. Maybe overriding the @:expose behavior when -D js_es=6? Or introducing a new metadata?

i.e.

@:expose
class Test {
    function new() {
    }
}

would produce

export class Test {
    constructor() {
    }
}
@markknol markknol added platform-javascript Everything related to JS / JavaScript feature-es6 ES6 labels Mar 21, 2019
@back2dos
Copy link
Member

Related: It would also be good if there were a @:jsRequire equivalent for es6 import.

@impaler
Copy link
Contributor

impaler commented May 12, 2019

One advantage to the javascript target having support for es6 modules is the "tree-shaking" feature most popular js blunders are now providing. So they can include only the modules that are being used, it doesn't seem possible for these blunders to optimize a Haxe compiled js project without it.

@Simn Simn added this to the Backlog milestone May 22, 2019
kLabz added a commit to kLabz/haxe that referenced this issue Dec 19, 2020
@kLabz kLabz linked a pull request Dec 19, 2020 that will close this issue
2 tasks
@Simn Simn modified the milestones: Backlog, Later Mar 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-es6 ES6 platform-javascript Everything related to JS / JavaScript
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants