Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
gonzojive wants to merge30 commits intoprotocolbuffers:main
base:main
Choose a base branch
Loading
fromgonzojive:es6

Conversation

@gonzojive
Copy link

There is a long-standing request for ES6 module generation:#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.

kota-yata, god-of-javascript, goulashify, bivens-dev, valentinbreiz, polRk, bsafwen, YehorPytomets, BirknerAlex, chrswk, and 2 more reacted with thumbs up emojiclehene, bsafwen, aaronlin0122, BirknerAlex, and loeffel-io reacted with hooray emojiiamterryclark, BirknerAlex, tkafka, and loeffel-io reacted with heart emoji
gonzojiveand others added26 commitsDecember 4, 2022 14:18
…rated code.The introduction of this type changes the signatures of many generator methodsthat need to know how to print a JavaScript expression that refers to a givenproto message or enum.
…rocessors.The import paths for proto imports don't work with our bazel rules, so wepost-process the protobuf-javascript generator's output to rewrite theimports. This is easier if each import has a comment indicating thecorresponding proto file.
Before this, the parent type would be returned. Now, <parent type>.<child type>is returned.
@goulashify
Copy link

This is awesome!

Enable compilation of protos which use the `extend` keyword. A gRPC-web service broke es6 compilation due to importing [`longrunning/operations.proto`](https://github.com/googleapis/googleapis/blob/master/google/longrunning/operations.proto), which uses annotations, which use extensions.Testing of this is being done in `rules_ts_proto` repo: [PR#9](https://github.com/gonzojive/rules_ts_proto/pull/9/files)
@rinarakaki
Copy link

Any update?

@gonzojive
Copy link
Author

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.

BirknerAlex reacted with eyes emoji

@perezd
Copy link

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.

@stasberkov
Copy link

stasberkov commentedAug 27, 2024
edited
Loading

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

@gonzojive
Copy link
Author

gonzojive commentedAug 27, 2024 via email

In my fork I have been maintaining and improving the ES6 support. I don'tthink the maintainers of the main repo have enough time to review thechange 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 <#156 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AAAUO5Y4AHQE6IAGDHZTMBDZTSKVTAVCNFSM6AAAAAAST6WIB2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMJSHA3DMOBRGE> . You are receiving this because you authored the thread.Message ID: ***@***.***>

meteorcloudy pushed a commit to bazelbuild/bazel-central-registry that referenced this pull requestSep 30, 2024
Checked with `python3 tools/bcr_validation.py--check=protobuf_javascript_esm`.The module in question is my fork of the protobuf-javascript repo. Thechanges in the fork are unlikely to be accepted upstream (seeprotocolbuffers/protobuf-javascript#156).
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

7 participants

@gonzojive@goulashify@rinarakaki@perezd@stasberkov@egormodin@reddaly

[8]ページ先頭

©2009-2025 Movatter.jp