Prototype Evaluation: Unify passing low volume state change through single method across layers #24447
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.
Evaluating the idea of pushing all low volume state changes through a single method, rather than a method per state type.
The main advantage is we don't need to add a new method to all layers for every state new state or augmentation, the disadvantage is it is harder to do api based feature detection.
The loss of api based feature detection may however be mitigated by the fact that we now have a layer compat contract. in fact, it is hard to deal with both layer compat and api as they don't interoperate well, so pushes more types are changes into the layer compat contract may actually make it easier to manage.
The basic premise here is replace
setConnectionState
,setAttachState
,noifyReadOnlyState
, andsetTombstone
with a single method,notifyStateChange
.I didn't do it in this PR, but we could also consider bringing a change like this to the loader layer.