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

Support ES6 Module Format? #434

Closed
MeirionHughes opened this issue May 24, 2016 · 4 comments
Closed

Support ES6 Module Format? #434

MeirionHughes opened this issue May 24, 2016 · 4 comments

Comments

@MeirionHughes
Copy link

MeirionHughes commented May 24, 2016

The current exports are proving to be a little difficult to use within TypeScript + System.js module loader. Specifically, the way dcodeIO/* export a default function seem to make it problematic (both when typed out in TypeScript and then when you try to use it in System.JS). (I think this is the relevant issue: microsoft/TypeScript#5073)

Would it be possible to have a separate es6-module format library?

@tmc
Copy link

tmc commented Jun 4, 2016

@MeirionHughes why close this?

@MeirionHughes
Copy link
Author

Well its something I suggested while struggling to get this working via JSPM, system.js and TypeScript, I fixed the import issue in the end though; (typings on dt are wrong). I'll reopen if its useful.

@MeirionHughes MeirionHughes reopened this Jun 5, 2016
@backspaces
Copy link

backspaces commented Jul 14, 2016

TL;DR: Does protobuf work with es6 modules via system.js?

Details:
I can see JSPM would be over-kill. Ditto webpack, browserify and the others. God, we spend way too much effort on workflow!

I've converted to using just system.js and, alas, babel-cli with transform-es2015-modules-systemjs. The latter only transforms import/export for system.js. Hopefully <script type="module"... will land soon!

I use package.json for my build tool .. yup I really do hate workflow! The two sets of transformations, src/ and test/apps/ are built via:

"build:as": "babel --plugins transform-es2015-modules-systemjs src -d lib",
"build:test": "babel --plugins transform-es2015-modules-systemjs test/apps -d test/lib",
"build": "npm run build:as && npm run build:test",

All this leads to the question: Does protobuf work with es6 modules via system.js? I've successfully used lots of non-es6 libraries using import.

@dcodeIO
Copy link
Member

dcodeIO commented Nov 28, 2016

Closing this for now.

protobuf.js 6.0.0

Feel free to send a pull request if this is still a requirement.

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

No branches or pull requests

4 participants