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

Have option to use type instead of interfaces for component props #41

Closed
spiftire opened this issue Dec 2, 2021 · 6 comments
Closed
Labels
enhancement New feature or request

Comments

@spiftire
Copy link

spiftire commented Dec 2, 2021

I personally prefere to use type instead of interface when describing the props in typescript. I see agrippa defaults to using interface
It would be nice to have some sort of flag to decide which alternative to use.

@nitzanhen nitzanhen added the enhancement New feature or request label Dec 2, 2021
@nitzanhen nitzanhen added this to the v1.3.0 milestone Dec 2, 2021
@nitzanhen
Copy link
Owner

nitzanhen commented Dec 2, 2021

Fair enough! I'll try to get it done for v1.3.0.

Thanks for reaching out!

@nitzanhen nitzanhen removed this from the v1.3.0 milestone Dec 3, 2021
@nitzanhen
Copy link
Owner

Sadly, since this feature requires its own flag (which, in turn, requires updating the schema on SchemaStore) as well as other tasks, releasing this in v1.3.0 would delay the release by at least a few days.

So it won't be included in v1.3.0, though I'll try to get a special version with this feature as soon as I can after the v1.3 release.

Sorry!

@nitzanhen
Copy link
Owner

Ok, it's implemented in version 1.4.0-alpha.1. You can install it using npm i -g agrippa@1.4.0-alpha.1, please test it out!

The new flag is tsPropsDeclaration (--ts-props-declaration in the command line), and it can receive either interface (the default) or type; the corresponding Typescript structure is then used. Note that using this flag in a non-TS environment will raise an error.

It's technically an unstable version, but the tests I set up for the feature pass and it seems to behave smoothly. Either way, if you come across any bugs or have any other feedback, please reply here!

@spiftire
Copy link
Author

spiftire commented Dec 5, 2021

Great work. I'll but it to the test during the next week

@spiftire
Copy link
Author

Seems to work as expected. Great work. Keep it up 🚀

@nitzanhen
Copy link
Owner

Thanks!
Closing this issue, if you find any bugs please open another issue.

Thanks again for suggesting this.

@nitzanhen nitzanhen pinned this issue Dec 27, 2021
@nitzanhen nitzanhen unpinned this issue Jun 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants