Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

refactor(experimental): improve getTupleCodec type inferences #2344

Merged
merged 1 commit into from
Mar 20, 2024

Conversation

lorisleiva
Copy link
Contributor

@lorisleiva lorisleiva commented Mar 19, 2024

This PR follows the footsteps of #2181 which improved the type inferences of getStructCodec and getDataEnumCodec by inferring the types from the provided codecs instead of inferring the other way around.

This PR does the same with the getTupleCodec and also makes use of the DrainOuterGeneric helper from the previous PR to reduce the amount of instantiations TypeScript does when resolving the codec types.

Copy link

changeset-bot bot commented Mar 19, 2024

🦋 Changeset detected

Latest commit: 5cf4020

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 Patch
@solana/transactions Patch
@solana/web3.js-experimental Patch
@solana/sysvars Patch
@solana/compat Patch
@solana/web3.js-legacy-sham Patch
@solana/programs Patch
@solana/rpc-api Patch
@solana/rpc-graphql Patch
@solana/rpc-subscriptions-api Patch
@solana/signers Patch
@solana/transaction-confirmation Patch
@solana/rpc Patch
@solana/rpc-subscriptions Patch
@solana/accounts Patch
@solana/addresses Patch
@solana/assertions Patch
@solana/codecs-core Patch
@solana/codecs-numbers Patch
@solana/codecs-strings Patch
@solana/errors Patch
@solana/functional Patch
@solana/instructions Patch
@solana/keys Patch
@solana/options Patch
@solana/rpc-parsed-types Patch
@solana/rpc-spec-types Patch
@solana/rpc-spec Patch
@solana/rpc-subscriptions-spec Patch
@solana/rpc-subscriptions-transport-websocket Patch
@solana/rpc-transformers Patch
@solana/rpc-transport-http Patch
@solana/rpc-types 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

Copy link
Contributor Author

lorisleiva commented Mar 19, 2024

@mergify mergify bot added the community label Mar 19, 2024
@mergify mergify bot requested a review from a team March 19, 2024 16:00
@lorisleiva lorisleiva force-pushed the loris/improve-tuple-inference branch from 248f04d to d116532 Compare March 19, 2024 16:11
@lorisleiva lorisleiva self-assigned this Mar 19, 2024
@lorisleiva lorisleiva force-pushed the loris/improve-tuple-inference branch from d116532 to de73851 Compare March 19, 2024 16:20
@lorisleiva lorisleiva marked this pull request as ready for review March 19, 2024 16:53
Copy link
Contributor

@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.

Lgtm! I didn't dive too deep into the whole DrainOuterGeneric discussion, so:

good luck

Copy link
Contributor

@steveluscher steveluscher left a comment

Choose a reason for hiding this comment

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

Added via Giphy

@lorisleiva lorisleiva force-pushed the loris/codec-drain-outer-generic branch from b8caa96 to e6d76e0 Compare March 20, 2024 10:13
@lorisleiva lorisleiva force-pushed the loris/improve-tuple-inference branch from de73851 to 87e679c Compare March 20, 2024 10:13
@lorisleiva lorisleiva force-pushed the loris/codec-drain-outer-generic branch from e6d76e0 to d309da8 Compare March 20, 2024 10:25
@lorisleiva lorisleiva force-pushed the loris/improve-tuple-inference branch from 87e679c to 84e4286 Compare March 20, 2024 10:25
Copy link
Contributor Author

lorisleiva commented Mar 20, 2024

Merge activity

  • Mar 20, 6:30 AM EDT: @lorisleiva started a stack merge that includes this pull request via Graphite.
  • Mar 20, 6:31 AM EDT: Graphite rebased this pull request as part of a merge.
  • Mar 20, 6:32 AM EDT: @lorisleiva merged this pull request with Graphite.

Base automatically changed from loris/codec-drain-outer-generic to master March 20, 2024 10:30
@lorisleiva lorisleiva force-pushed the loris/improve-tuple-inference branch from 84e4286 to 5cf4020 Compare March 20, 2024 10:31
@lorisleiva lorisleiva merged commit deb7b80 into master Mar 20, 2024
7 checks passed
@lorisleiva lorisleiva deleted the loris/improve-tuple-inference branch March 20, 2024 10:32
Copy link
Contributor

🎉 This PR is included in version 1.91.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Copy link
Contributor

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 Apr 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve performance of codec input/output types by draining outer generics.
3 participants