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.
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
fix: Allow
bindInputs()
to no-op when attempting to bind currently bound inputs #3946fix: Allow
bindInputs()
to no-op when attempting to bind currently bound inputs #3946Changes from 12 commits
657be0a
3aa2f6c
0c03210
7969054
554bac5
1b9ceab
9d1f5c7
6eba4cf
f1a072e
3e00632
26e5109
b67b062
616bda0
b124d1b
1c0c4c3
76abdca
4943f03
4a8ca4b
75b50c6
6883344
5be1e65
a6b7c11
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this the only bit of logic that's different here? If it is I may advocate for reducing changes to just this to keep changes focused.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sort of, but we also have to count the number of each type earlier. Before you would add an
id
toduplicateIds
ifbindings.get(id).length > 1
but we need this logic to happen earlier so we can take into account whether there are more than one of the same type as the inclusion criteria.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the diff is probably cleaner with this approach, but I'm sure there are other ways to do this same thing and I'm obviously open to any suggestions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm biased, but I think the more descriptive parameter/variable name is nice here as it's self-documenting and when using it you don't need to reference the typescript types to understand the possible values. If we think we may add more binding types in the future I could see making it more genericly
type
, however. Also, it's not explicitly related to the issue the PR is trying to solve.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I switched it to
type
becauseisRegistered()
would takeinputOrOutput: "all" | "input" | "output"
, which wasn't just input or output. I personally foundinputOrOutput
to be slightly confusing -- given the longer name it feels like there's something more going on with it. I don't have strong feelings and could easily revert it for a smaller diff.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given the change suggested here, I'd advocate for
bindingType
instead ofinputOrOutput
. ThenbindingType
is used everywhere to mean the same thing.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Refactored in b124d1b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh
BindingType
and then ensuring consistency is better!There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are a few conditions in the lines below (not seen in the diff) where we would
continue
and not bind toel
because it's already bound. If we add thisid
to thebindingsRegistry
here, then we'll overcount the bindings onid
.