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

chore: attempt deep defaults in spec factory #1399

Closed

Conversation

nickofthyme
Copy link
Collaborator

Attempt at deep defaults.

Findings:

  • The types would be loose but the values are all typed going into the spec factory so shouldn't be too concerning
  • The props would need to be overridden before passing the the upsertSpec function which is not idea.
  • The breaking point for me was the domain having partial keys. So either I make the whole domain partial on the spec causing type checks everywhere. Or we somehow find a way to type which props are objects whose keys can be deep and values can be partials.

All in all this really hurt my brain and I think it's a future consideration when we separate the final spec types from the props the user must defined which could differ. But currently I think this is more effort than it is worth.

@nickofthyme nickofthyme added the wip work in progress label Sep 21, 2021
@nickofthyme nickofthyme mentioned this pull request Sep 21, 2021
7 tasks
@nickofthyme nickofthyme deleted the deep-default-attempt branch September 21, 2021 22:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wip work in progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant