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

Redundant import statement in recursive message codegen #244

Open
ghost opened this issue Sep 6, 2022 · 1 comment
Open

Redundant import statement in recursive message codegen #244

ghost opened this issue Sep 6, 2022 · 1 comment

Comments

@ghost
Copy link

ghost commented Sep 6, 2022

아래 proto 예시와 그에 대한 ts codegen을 보여드리겠습니다.

// proto message
syntax = 'proto3';

message Tree {
  TreeNode root = 1;
}

message TreeNode {
  int32 id = 1;
  repeated TreeNode children = 3;
}
// /messages/TreeNode.ts
import {
  Type as TreeNode_1,
  // ...codec function imports
} from "./TreeNode.ts";
// ... another imports

export declare namespace $ {
  export interface TreeNode {
    id: number;
    children: TreeNode_1[];
  }
}

자기 파일에서 선언한 메세지이기 때문에 자기 자신(./TreeNode.ts) 에서 import해오는 부분은 불필요해 보입니다.
구현 편의상 의도된 부분인지, 아니라면 구현상 중복 제거가 불가능한 이슈인지, 아니라면 개선의 의향이 있으신지 궁금합니다.

@ghost ghost changed the title Handle recursive cases Redundant import statement in recursive message declarations Sep 6, 2022
@ghost ghost changed the title Redundant import statement in recursive message declarations Redundant import statement in recursive message Sep 6, 2022
@ghost ghost changed the title Redundant import statement in recursive message Redundant import statement in recursive message codegen Sep 6, 2022
@disjukr
Copy link
Member

disjukr commented Sep 6, 2022

그냥 귀찮아서 처리 안했던 부분인데 말씀하신대로 개선할 수 있으면 더 좋을 것 같습니다.

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

1 participant