protobuf-javascript icon indicating copy to clipboard operation
protobuf-javascript copied to clipboard

Generate ES6-style code (classes, exports, imports)

Open gonzojive opened this issue 3 years ago • 6 comments

There is a long-standing request for ES6 module generation: https://github.com/protocolbuffers/protobuf-javascript/issues/75. This PR mostly adds such support, though it needs to be cleaned up, fixed and tested.

The code generator should still produce the same output for previously supported inputs. The es6 option changes the output style significantly.

gonzojive avatar Dec 05 '22 08:12 gonzojive

This is awesome!

goulashify avatar May 02 '23 14:05 goulashify

Any update?

rinarakaki avatar Jan 19 '24 03:01 rinarakaki

The branch works and has been updated with many fixes. We use it in web apps at work. However, last I checked, it will not be accepted upstream because the change is so large.

gonzojive avatar Jan 19 '24 04:01 gonzojive

Shameless plug, you might be interested in checking out protobuf-es: https://github.com/bufbuild/protobuf-es

It fully supports TypeScript and ESM and is completely conformant and compatible with the Protobuf format.

perezd avatar Aug 03 '24 18:08 perezd

Guys, can you make this thing moving forward? I would really like to have ESM module instead of CJS modules.

stasberkov avatar Aug 27 '24 15:08 stasberkov

In my fork I have been maintaining and improving the ES6 support. I don't think the maintainers of the main repo have enough time to review the change and get it into shape to submit.

On Tue, Aug 27, 2024, 8:23 AM Stanislav Berkov @.***> wrote:

Guys, can you make this thing moving forward? I would really like to have ESM module instead of CJS modules.

— Reply to this email directly, view it on GitHub https://github.com/protocolbuffers/protobuf-javascript/pull/156#issuecomment-2312866811, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAUO5Y4AHQE6IAGDHZTMBDZTSKVTAVCNFSM6AAAAAAST6WIB2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMJSHA3DMOBRGE . You are receiving this because you authored the thread.Message ID: @.***>

gonzojive avatar Aug 27 '24 16:08 gonzojive