Skip to content
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

Add a tracked-based environment impl #60

Merged
merged 5 commits into from
Mar 18, 2024
Merged

Add a tracked-based environment impl #60

merged 5 commits into from
Mar 18, 2024

Conversation

dfreeman
Copy link
Member

@dfreeman dfreeman commented Mar 18, 2024

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:

  • any getters in your env that rely on tracked data must use @dependentKeyCompat
  • any mutations to the environment through $binds have to use set regardless of whether the ultimate source of truth is @tracked or not

Both 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 and set, 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:

  • A pass over the README and GLOSSARY to ensure the contents reflect reality
  • A brief "updating to v2" guide that covers breaking changes
  • Modernizing the components in Exclaim itself as well as the playground app
  • Changing the componentPath key to component in the implementation map for consistency
  • Adding canonical TS/Glint declarations so downstream consumers don't have to invent their own

@dfreeman dfreeman merged commit c4b6130 into main Mar 18, 2024
8 checks passed
@dfreeman dfreeman deleted the tracked-support branch March 18, 2024 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants