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

refactor(experimental): rename mapCodec to transformCodec #2434

Merged
merged 1 commit into from
Apr 4, 2024

Conversation

lorisleiva
Copy link
Collaborator

@lorisleiva lorisleiva commented Apr 4, 2024

Currently we have the following codec functions:

// Transforms Codec<T> to Codec<U> by providing mapping functions between T and U.
mapCodec(codec, U => T, T => U);

// Creates a Codec<Map<K, V>> by providing a Codec<K> and a Codec<V>.
getMapCodec(keyCodec, valueCodec);

Whilst they do completely different things, their names are too close to each other.

This PR fixes this by renaming mapCodec to transformCodec — i.e. /map(Encoder|Decoder|Codec)/transform$1/g.

Copy link

changeset-bot bot commented Apr 4, 2024

🦋 Changeset detected

Latest commit: 6258291

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 35 packages
Name Type
@solana/codecs-data-structures Patch
@solana/codecs-strings Patch
@solana/transactions Patch
@solana/codecs-core Patch
@solana/addresses Patch
@solana/rpc-types Patch
@solana/options Patch
@solana/codecs Patch
@solana/accounts Patch
@solana/keys Patch
@solana/rpc-api Patch
@solana/rpc-graphql Patch
@solana/transaction-confirmation Patch
@solana/transaction-messages Patch
@solana/compat Patch
@solana/web3.js-experimental Patch
@solana/programs Patch
@solana/rpc-subscriptions-api Patch
@solana/signers Patch
@solana/codecs-numbers Patch
@solana/instructions Patch
@solana/rpc-parsed-types Patch
@solana/sysvars Patch
@solana/rpc-subscriptions Patch
@solana/rpc-transformers Patch
@solana/rpc Patch
@solana/assertions Patch
@solana/errors Patch
@solana/functional Patch
@solana/rpc-spec-types Patch
@solana/rpc-spec Patch
@solana/rpc-subscriptions-spec Patch
@solana/rpc-subscriptions-transport-websocket Patch
@solana/rpc-transport-http Patch
@solana/webcrypto-ed25519-polyfill Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@lorisleiva lorisleiva marked this pull request as ready for review April 4, 2024 09:20
@lorisleiva lorisleiva self-assigned this Apr 4, 2024
@lorisleiva lorisleiva requested review from mcintyre94 and buffalojoec and removed request for mcintyre94 April 4, 2024 12:52
Copy link
Collaborator

@buffalojoec buffalojoec left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Transform" I think makes it more clear. Nice!

transformer

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh lame that your Git diff looks like this.

Copy link
Collaborator

@mcintyre94 mcintyre94 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, agree that this is clearer!

Copy link
Collaborator Author

lorisleiva commented Apr 4, 2024

Merge activity

  • Apr 4, 12:47 PM EDT: @lorisleiva started a stack merge that includes this pull request via Graphite.
  • Apr 4, 12:52 PM EDT: Graphite rebased this pull request as part of a merge.
  • Apr 4, 12:53 PM EDT: @lorisleiva merged this pull request with Graphite.

Base automatically changed from loris/variable-size-boolean to master April 4, 2024 16:51
@lorisleiva lorisleiva merged commit 31916ae into master Apr 4, 2024
6 of 7 checks passed
@lorisleiva lorisleiva deleted the loris/rename-map-codec branch April 4, 2024 16:53
Copy link
Contributor

🎉 This PR is included in version 1.91.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

Copy link
Contributor

github-actions bot commented May 1, 2024

Because there has been no activity on this PR for 14 days since it was merged, it has been automatically locked. Please open a new issue if it requires a follow up.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 1, 2024
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.

None yet

3 participants