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

cli: de-duplicate IDL JSON in TS types #1213

Closed
wants to merge 1 commit into from

Conversation

johnrees
Copy link
Contributor

I haven't tested this locally yet (will do tomorrow if this is considered useful), I'm just getting reacquainted with IDL stuff that's been added over the past few months.

One of the things I noticed was that the IDL object is included twice in generated typescript types file. I assume the reasoning behind this was because the types were too generic?

If that's the case using as const should mean that you don't need to duplicate the JSON in the file as the type would effectively be a readonly representation of the object.

before: without as const, version is string after: with as const, version is readonly "0.1.0"
Screenshot 2021-12-31 at 12 06 00 AM Screenshot 2021-12-31 at 12 05 51 AM

@acheroncrypto acheroncrypto mentioned this pull request Feb 25, 2024
@acheroncrypto acheroncrypto added ts cli idl related to the IDL, either program or client side labels Mar 10, 2024
@acheroncrypto
Copy link
Collaborator

Superseded by #2824.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli idl related to the IDL, either program or client side ts
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants