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

Polymorphic records for widget construction #7

Merged
merged 5 commits into from
Feb 21, 2024

Conversation

postsolar
Copy link
Owner

@postsolar postsolar commented Feb 20, 2024

This would remove the need for wrapping a value with Untagged.Union.asOneOf for each prop each time it's used, at least on widget construction. It also reduces the amount of boilerplate needed to foreign-import a new widget type.

Con: now every single widget field should be marked as ValueOrBinding a, even where it wasn't meant to be this way originally. But I suspect it's actually true for any field anyways, so no type-safety is being compromised, I think.

  • Remove the need for asOneOf on widget creation
  • Collapse all widgets into a single module? The proliferation of modules is getting annoying
  • Test the changes

@postsolar postsolar force-pushed the polymorphic-widget-inputs branch from 97ab81f to 1011edf Compare February 20, 2024 21:52
@postsolar postsolar marked this pull request as ready for review February 21, 2024 04:26
@postsolar postsolar force-pushed the polymorphic-widget-inputs branch from ff82068 to dc664f4 Compare February 21, 2024 05:51
@postsolar postsolar merged commit da1b471 into master Feb 21, 2024
1 check passed
@postsolar postsolar deleted the polymorphic-widget-inputs branch February 21, 2024 10:41
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.

1 participant