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

Migrate from google-protobuf #1053

Closed
mysteryven opened this issue Jan 10, 2025 · 1 comment
Closed

Migrate from google-protobuf #1053

mysteryven opened this issue Jan 10, 2025 · 1 comment

Comments

@mysteryven
Copy link

mysteryven commented Jan 10, 2025

When I switched to protobuf-es, some codes broke:

The proto file is:

message User {
  enum Foo {
    Bar = 0;
  }
}

then I use it like

User.Foo.Bar

But now it is:

/**
 * @generated from enum example.User.Foo
 */
export enum User_Foo {
  /**
   * @generated from enum value: Bar = 0;
   */
  Bar = 0,
}

I need to change it to:

import proto from 'my-lib'
User_Foo.Bar

There are many codes in my codebase, Is this possible to keep this behavior same with google-protobuf?

@timostamm
Copy link
Member

ECMAScript does not have namespaces, and while it's possible to emulate them, doing so has various drawbacks and does not work well with tree-shakeable ECMAScript imports.

Because of this, nested types are all generated on the same level, and it is not possible to change this.

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

2 participants