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 CommonJS in protoc-gen-connect-es #956

Merged
merged 7 commits into from Dec 13, 2023
Merged

Conversation

timostamm
Copy link
Member

@timostamm timostamm commented Dec 7, 2023

Update to @bufbuild/protoplugin v1.6.0 and support CommonJS with the new plugin option:

js_import_style

By default, protoc-gen-connect-es (and all other plugins based on @bufbuild/protoplugin) generate ECMAScript import and export statements. For use cases where CommonJS is difficult to avoid, this option can be used to generate CommonJS require() calls.

Possible values:

  • js_import_style=module generate ECMAScript import / export statements - the default behavior.
  • js_import_style=legacy_commonjs generate CommonJS require() calls.

@timostamm timostamm marked this pull request as ready for review December 13, 2023 13:20
@timostamm timostamm requested review from smaye81 and a team and removed request for a team December 13, 2023 13:21
@timostamm timostamm merged commit 8dde71e into main Dec 13, 2023
4 checks passed
@timostamm timostamm deleted the tstamm/plugin-cjs branch December 13, 2023 15:12
@smaye81 smaye81 mentioned this pull request Dec 13, 2023
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.

None yet

2 participants