Add a tracked
-based environment impl
#60
Merged
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.
Background
This PR is a followup to #58 and #59 on the road to v2.0. In Exclaim 1.x it's possible to use
@tracked
data sources in your@env
, but there are some caveats:@dependentKeyCompat
$bind
s have to useset
regardless of whether the ultimate source of truth is@tracked
or notBoth of these caveats stem from the fact that Exclaim's internal handling of helpers and bindings is built on Ember's "classic" reactivity model, which is all based around
computed
.This Change
This change adds an alternative implementation of our core binding logic that relies on tracked data and the conventions around that instead of the classic reactivity model. This implementation will be the default in v2, but consumers can explicitly opt in to the
computed
version instead by passing@useClassicReactivity={{true}}
.This change essentially forks the existing test suite, with one copy using
useClassicReactivity
andset
, and the other using tracked data and native setters. The new tests are otherwise identical to the old.Not This Change
There are still a few more pending updates to come that will likely be grouped into 1 or 2 final PRs before cutting a (beta?) release:
componentPath
key tocomponent
in the implementation map for consistency