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] Generate export with @:expose and -D js-es=6 #10003

Open
wants to merge 2 commits into
base: development
Choose a base branch
from

Conversation

kLabz
Copy link
Contributor

@kLabz kLabz commented Dec 19, 2020

Closes #8033

Edit: hmm this doesn't work with the closure

  • Only with -D js-classic?
  • Allow to expose default?

@kLabz kLabz changed the title [js] Generate export with @:expose and -D js-es=6 [WIP] [js] Generate export with @:expose and -D js-es=6 Dec 19, 2020
Also add support for export default
@kLabz kLabz changed the title [WIP] [js] Generate export with @:expose and -D js-es=6 [js] Generate export with @:expose and -D js-es=6 Dec 19, 2020
match args with
| [ EConst (String("default",_)), _ ] -> print ctx "export default ";
| [] -> print ctx "export ";
| _ -> abort "Invalid @:expose parameters" pos
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what to do in this case, since @:export('something') was valid until now and still has some use here.
Maybe this feature would be better with a @:export meta instead?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think @:expose('CustomName') class Test{} should be generated as class Test {}; export {Test as CustomName}

@nadako
Copy link
Member

nadako commented Dec 20, 2020

This js-classic stuff is a bit confusing. Surely es6 exports are modern, not classic ^^

I guess what we want nowadays is something like -D js-module-kind=classic|closure|es6?

@skial skial mentioned this pull request Dec 23, 2020
1 task
@cambiata
Copy link

Glad that things are moving here..! :-)

@aisebastian
Copy link

Hello all, I'd like to contribute to moving this forward. It's not clear to me from this message thread what this PR is missing to be merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[js][es6] add ES6 module exports
7 participants