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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Binding refactoring #13

Merged
merged 8 commits into from
Jul 5, 2021
Merged

Binding refactoring #13

merged 8 commits into from
Jul 5, 2021

Conversation

na--
Copy link
Member

@na-- na-- commented Jul 4, 2021

It will probably be easier to read this commit by commit... 馃槄

The biggest change is that now we now have a clear difference in the Binding (the callback that reads some source (or other) value and saves it to the Destination) and the Binder (the thing that creates the Binding). Array and number bindings are now also very similar to the other simpler bindings 馃帀 The bitSize checking is now only done on the frontend side, sources are no longer concerned with it (because they don't need to be) 馃帀

I still want to tweak things things (potentially how default values are handled) and add more fields (esp. if I can reduce the boilerplate), so I may push a few more commits here... 馃槄

na-- added 5 commits July 3, 2021 15:44
This simplifies value source implementations even further. Now they need to only work with int64, uint64 and float64 numbers, without any concern for bit sizes. Validation that smaller numbers can fit into the used smaller native types on the users' side is ensured by the frontends (e.g. NewInt8Field()).
This opens the way for injecting other types of value bindings, e.g. typed callbacks and validators.
This huge commit cleans up the interface types and makes them much more composable at the cost of minimal complexity increase of the sources. It also shifts the responsibility for Field value consolidation from the individual fields to the Manager and ManagedField.
@na-- na-- requested review from artych and codebien July 4, 2021 21:00
@na-- na-- merged commit 6420e85 into main Jul 5, 2021
@na-- na-- deleted the binding-refactoring branch July 5, 2021 07:10
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.

None yet

1 participant