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. As promised there, it eliminates the need to use
get
when working directly with the@env
argument. It does this by largely getting rid of the explicit notion of a specialEnvironment
wrapper type.This Change
Instead of handing components in the UI an
Environment
object wrapped around whatever@env
was passed in, we now just directly use the given@env
value as much as possible. Since there were previously several public methods you could call on anEnvironment
object, this is another breaking change that will require some (hopefully not too obtrusive) updates in consumers:@env.metaForField
has been eliminated. The only real use case we ever actually had for that was determining the canoncal location in the env where a trail of$bind
s actually pointed, which is now possible viaimport { resolveEnvPath } from 'ember-exclaim'
.@env.extend
is no longer directly possible. Previously, you would callthis.args.env.extend(foo)
and then pass the resulting value as the second parameter to{{yield}}
. Now, you pass whateverfoo
is directly as the second{{yield}}
param, and the details of adding those keys to the ambient environment for your child are internal to Exclaim. In general, this should just allow components that expose bound values to their children to simplify their implementation slightly and otherwise be unimpacted.Not This Change
As in #58, looking through this diff may suggest obvious additional work we should take on. The following are things this PR intentionally does not do:
@ember/component
,@computed
, etc) in Exclaim itself or in the playground app.ExclaimUi
that uses unadorned getters for binding instead ofcomputed()
for compatibility with@tracked
data. That may or may not happen before 2.0, but the idea would be that this opt-in mode becomes the only mode in 3.0 and acts as a path to incremental migration to@tracked
in 2.x.Notes/Caveats
In trying to track down what ultimately turned out to be 100f0e7, I refreshed the v2 addon blueprint in this repo to make sure I was getting the latest version of various build dependencies. You should be able to largely ignore that commit and just look through the others one by one.