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

V2: Change default value of plugin option import_extension to none #832

Merged
merged 4 commits into from
May 9, 2024

Conversation

srikrsna-buf
Copy link
Member

Change default value of import_extension to none from .js.

In v1, we generate code using .js extension which is the spec compliant way (and has been for sometime) of importing js files. Node, TS, and browsers support this but bundlers still haven't caught up with it. Users filed several issues related to this.

With this change, the default will work in most places and where users do need them it can be configured using the import_extension=.js plugin option.

Important

This change affects all plugins written using protoplugin when they upgrade to v2.

Copy link
Member

@timostamm timostamm left a comment

Choose a reason for hiding this comment

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

Looks good to me, but can you update packages/protoc-gen-es/README.md ?

packages/protobuf-bench/buf.gen.yaml Outdated Show resolved Hide resolved
@@ -36,7 +36,7 @@ export function parseParameter(
let bootstrapWkt = false;
let keepEmptyFiles = false;
const rewriteImports: RewriteImports = [];
let importExtension = ".js";
let importExtension = "";
Copy link
Member

Choose a reason for hiding this comment

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

💥 🤓

@timostamm timostamm changed the title Change default value of import_extension to none V2: Change default value of import_extension to none May 9, 2024
packages/protoc-gen-es/README.md Outdated Show resolved Hide resolved
packages/protoc-gen-es/README.md Outdated Show resolved Hide resolved
@srikrsna-buf srikrsna-buf merged commit 9213d8c into v2 May 9, 2024
6 checks passed
@srikrsna-buf srikrsna-buf deleted the sk/import_extension branch May 9, 2024 13:02
@timostamm timostamm changed the title V2: Change default value of import_extension to none V2: Change default value of plugin option import_extension to none May 13, 2024
@timostamm timostamm mentioned this pull request May 13, 2024
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.

2 participants