-
Notifications
You must be signed in to change notification settings - Fork 462
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
resolve circular deps inside rewards #1348
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had 2 questions, let's discuss them 😉
@@ -0,0 +1,5 @@ | |||
export type SecretTextRewardForm = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if we need to put these types in a types.ts
close to the components where we actually use them, or we should just put them in the main src/types.ts
file. What are the pros and cons in your opinion?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pros:
- The
src/types.ts
won't grow unmaintainably (name collision, too large file, uncertain types) - The types will be localized in some sense
- This way it's clear that the
types.ts
belongs toSecretText
from every import, this gives the type additional data for the developers.
Cons:
- More files
- Global types don't require imports, as this one does so when something is renamed or moved, more refactor is required usually
I plan to write about these in the project structure convention, this is not something we do in the project now.
Fixes 2 circular dependency group