coinbase / onchainkit

React components and TypeScript utilities to help you build top-tier onchain apps.

Home Page:https://onchainkit.xyz

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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:

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