Replaced fixed order with dynamic ordering #286
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.
For #271, the automatic addition of
data/callbacks
when thereal-time
behavior is used, was a desired feature of can-connect, and necessitated some way for real-time to declare that it needed another package included while still preserving order. this changes the ordering code so individual behaviors can decide where in the order they should go, and allows other connect behavior authors access to this ordering.This isn't quite ready yet, because the dependency objects are generally rather ham-handed, mostly deriving from the lines of order previously listed in connect.js plus some trial and error. Also tests have not yet been made for the new ordering code and for required deps.
Pursuant to the previous bullet point, a pain point about can-connect (that the dependencies between behaviors aren't clear from the docs or code, due to the relationship between behaviors stems from shared property names) can be somewhat remedied by using the dependency object to show where ordering must be enforced.
The dependency from one behavior to another may be in either the "base" direction (from object to proto) or the "derived" direction (from proto to containing object), and may be "optional" (enforce order if both behaviors are included) or "required" (if A is included then include B in the correct order).