Skip to content

Add deprecated flag to RPCs#5244

Merged
polkadot-js-bot merged 2 commits intomasterfrom
jg-rpc-deprecated
Sep 28, 2022
Merged

Add deprecated flag to RPCs#5244
polkadot-js-bot merged 2 commits intomasterfrom
jg-rpc-deprecated

Conversation

@jacogr
Copy link
Copy Markdown
Member

@jacogr jacogr commented Sep 28, 2022

Closes #5241

Adds the @deprecated flag to both the metadata generation as well as the TS interfaces.

However with TS augmentation this is not prefect and there is (currently) no way to make it perfect, the levers that we are able to pull is correct for the specific generation, aka

      /**
       * @deprecated Use `api.rpc.state.getKeysPaged` to retrieve keys
       * Returns the keys with prefix, leave empty to get all the keys (deprecated: Use getKeysPaged)
       **/
      getPairs: AugmentedRpc<(prefix: StorageKey | string | Uint8Array | any, at?: BlockHash | string | Uint8Array) => Observable<Vec<KeyValue>>>;

As an example of non-perfectness in VSCode -

image

However when going to the specific endpoint, it does highlight as deprecated -

image

As well as -

image

The first one should mark as striked in the editor as well as having the correct bubble as per the last 2.

@jacogr jacogr added the -auto label Sep 28, 2022
@polkadot-js-bot polkadot-js-bot merged commit a92bfca into master Sep 28, 2022
@polkadot-js-bot polkadot-js-bot deleted the jg-rpc-deprecated branch September 28, 2022 05:14
@polkadot-js-bot
Copy link
Copy Markdown

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@polkadot-js polkadot-js locked as resolved and limited conversation to collaborators Sep 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add & typegen deprecation flag for RPCs

2 participants