[Tidy] Proof of concept replacing ctd for filter and parameter #880
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
@petar-qb raising this PR just to see if you think it's a good idea as a change. I won't actually implement it until you've done your PR so you don't have to resolve any more conflicts.
I'm finally continuing work on #363 and this seems like a small refactor that will tidy things up some more before the conversion to classes, which will hopefully be the next PR I raise on this topic 🤞
So far this PR is just a proof of concept to show what the change would look like. I haven't fully rolled it out or updated tests yet but the simple demo app works exactly the same as before.
Basically we passed
filters
andparameters
throughinputs
in the callbacks before but didn't actually use them anywhere and instead looked insidectx.args_grouping
to extract all the values and and component ids. The only actual properties used in theCallbackTriggerDict
areid
andvalue
. We can instead pass through named states in the form{<id>: State(...)}
to get theid
passed in automatically so we don't needctx.args_grouping
for that. I don't think we'll ever need it for anything else. Here's what's in it to remind you:The change here would achieve be half of what you suggest in this comment:
The other half is also captured by my more recent comment:
Screenshot
Notice
I acknowledge and agree that, by checking this box and clicking "Submit Pull Request":