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: split schemas & types #48

Merged
merged 4 commits into from
Jul 22, 2024
Merged

refactor: split schemas & types #48

merged 4 commits into from
Jul 22, 2024

Conversation

Llandy3d
Copy link
Member

are we sure we want to keep this refactor ?

In retrospective having the same type and schema sharing names seemed like leading to cleaner code and ergonomics 😕

We would just have to keep in mind that a schema is also a type, but after that it did seems better indeed.

@going-confetti
Copy link
Collaborator

In retrospective having the same type and schema sharing names seemed like leading to cleaner code and ergonomics 😕

I don't really mind them sharing the names, although I have a stronger opinion on having types and schemas with the same names in the same files. If you prefer types and schemas sharing names, you can remove the suffixes from the schema objects names, but leave the folder structure as it is in this PR

Copy link
Collaborator

@going-confetti going-confetti 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 added a separate comment on types and schemas sharing names - take a look before merging

@Llandy3d
Copy link
Member Author

In retrospective having the same type and schema sharing names seemed like leading to cleaner code and ergonomics 😕

I don't really mind them sharing the names, although I have a stronger opinion on having types and schemas with the same names in the same files. If you prefer types and schemas sharing names, you can remove the suffixes from the schema objects names, but leave the folder structure as it is in this PR

that could lead to more confusion or actually to errors I think when we need to import both type & schema in a single file, let's keep the Schema naming, I've seen another tool (Valibot) actually having this naming convention 🤔

@Llandy3d Llandy3d merged commit ae030b1 into main Jul 22, 2024
1 check passed
@Llandy3d Llandy3d deleted the refactor_schemas branch July 22, 2024 09:13
@going-confetti
Copy link
Collaborator

that could lead to more confusion or actually to errors I think when we need to import both type & schema in a single file, let's keep the Schema naming, I've seen another tool (Valibot) actually having this naming convention 🤔

We don't do it yet, but if the need arises you can do the following:

import { TestRule } from '@/types/rules'
import { TestRule as TestRuleSchme } from '@/schemas/rules'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants