Repository navigation
[payout] Code generation: update services and models - #1772
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the generated SDK code for the payout service, including updating the generation log and adding dummy void statements to suppress unused import warnings. The feedback suggests updating the generator templates to use TypeScript's import type syntax instead of these void statements. This approach would eliminate runtime overhead, improve tree-shaking, and avoid importing unused types like ServiceError.
| void ServiceError; | ||
| void StoreDetailAndSubmitRequest; | ||
| void StoreDetailAndSubmitResponse; | ||
| void StoreDetailRequest; | ||
| void StoreDetailResponse; | ||
| void SubmitRequest; | ||
| void SubmitResponse; |
There was a problem hiding this comment.
These void <Type> statements are used to suppress unused import warnings. However, since these imports are only used as types in this file, a much cleaner and standard TypeScript approach is to use import type (e.g., import type { StoreDetailRequest } from ...).
Using import type has several benefits:
- No Runtime Overhead: Type-only imports are completely erased during compilation, so there are no runtime references.
- Better Tree-Shaking: It ensures that unused models can be safely tree-shaken by bundlers, reducing the final bundle size for consumers.
- Cleaner Code: It eliminates the need for dummy runtime statements like
void StoreDetailRequest;.
Additionally, ServiceError is imported but completely unused in this file.
Since this is automated code generation, please update the generator templates to:
- Use
import typefor type-only imports. - Avoid importing unused models like
ServiceError. - Remove these
voidstatements entirely.
| void PayoutRequest; | ||
| void PayoutResponse; | ||
| void ServiceError; |
There was a problem hiding this comment.
These void <Type> statements are used to suppress unused import warnings. Since PayoutRequest and PayoutResponse are only used as types in this file, they should be imported using import type (e.g., import type { PayoutRequest } from ...).
This would allow you to:
- Remove these dummy
voidstatements entirely. - Avoid importing
ServiceErrorwhich is completely unused in this file. - Improve tree-shaking and reduce bundle size for SDK consumers, as type-only imports are completely erased at compile time.
Please update the generator templates to adopt import type for type-only imports and remove these unnecessary void statements.
| void ModifyRequest; | ||
| void ModifyResponse; | ||
| void ServiceError; |
There was a problem hiding this comment.
These void <Type> statements are used to suppress unused import warnings. Since ModifyRequest and ModifyResponse are only used as types in this file, they should be imported using import type (e.g., import type { ModifyRequest } from ...).
This would allow you to:
- Remove these dummy
voidstatements entirely. - Avoid importing
ServiceErrorwhich is completely unused in this file. - Improve tree-shaking and reduce bundle size for SDK consumers, as type-only imports are completely erased at compile time.
Please update the generator templates to adopt import type for type-only imports and remove these unnecessary void statements.
4437f0d to
4178c29
Compare
This PR contains the automated changes for the
payoutservice.The commit history of this PR reflects the
adyen-openapicommits that have been applied.