Feature Request: make type parameters use consistent lowerCamelCase
spennyp opened this issue · comments
Describe the solution you'd like
A nit, but currently type parameters mix snake_case and lowerCamelCase.
For example:
snake_case (post_url, refresh_period):
export type FrameMetadataType = {
buttons?: [FrameButtonMetadata, ...FrameButtonMetadata[]];
image: string;
input?: FrameInputMetadata;
post_url?: string;
refresh_period?: number;
};
lowerCamelCase (isValid):
export type FrameValidationResponse = {
isValid: true;
message: FrameValidationData;
} | {
isValid: false;
message: undefined;
};
Typescript generally uses lowerCamelCase here:
- https://www.typescriptlang.org/docs/handbook/typescript-tooling-in-5-minutes.html#interfaces
- https://google.github.io/styleguide/tsguide.html#naming-rules-by-identifier-type
Describe alternatives you've considered.
No response
Yeah, that's a big miss from my side! you right!
I wonder when we should do this breaking changes, if today or in a few weeks when things cool down.
@spennyp thoughts?
Probably wait to bundle it with other breaking changes in a major release makes sense
Yeah, right a lot of people are shipping some cool Frames, so I think this can be a nice breaking changes to do on Monday next week.
@Zizzamia In the meantime, this would be backwards compatible:
export type FrameMetadataType = {
buttons?: [FrameButtonMetadata, ...FrameButtonMetadata[]];
image: string;
input?: FrameInputMetadata;
/** @deprecated Prefer `postUrl` */
post_url?: string;
postUrl?: string;
/** @deprecated Prefer `refreshPeriod` */
refresh_period?: number;
refreshPeriod?: number;
};
![image](https://private-user-images.githubusercontent.com/9300702/303471373-49a6486d-ebe9-4788-a897-ffd0a686942f.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTg1NTIzNTAsIm5iZiI6MTcxODU1MjA1MCwicGF0aCI6Ii85MzAwNzAyLzMwMzQ3MTM3My00OWE2NDg2ZC1lYmU5LTQ3ODgtYTg5Ny1mZmQwYTY4Njk0MmYucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDYxNiUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA2MTZUMTUzNDEwWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9NmJmNDcxYWQxMzQ3N2I1MjVhOTZiMjlkNzJkMjBkMWQ5NzAwMWU5NjI5N2M1MDUyODM0ZmMzMmZjODM0OWZhNCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.XAI6Y7KB2i3ODEbcXnSvgcpH87JbUyC9kPVuc0zhEy8)
@spennyp check v0.5.3
https://github.com/coinbase/onchainkit/releases/tag/v0.5.3
Has a couple of things you requested.