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

Consolidate references and tags #1314

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

pzuraq
Copy link
Member

@pzuraq pzuraq commented May 22, 2021

No description provided.

Chris Garrett added 4 commits May 22, 2021 14:36
Upstreams the @Tracked decorator, making it part of the
@glimmer/validator package, and removing the `trackedData` concept. The
original concept did not really pan out and was used almost exclusively
for @Tracked. This change will make it easier to refactor and
consolidate the various tag/tracking concepts.
This PR finishes up the autotracking refactors that were done
previously, making after-render effects that used to be handled by the
render transaction handled instead by an EffectsManager. The
EffectsManager essentially manages a number of caches, which it keeps
in lists internally. Every time a render completes, these queues are
scheduled to run, with every cache in the queue being checked in order
to see if something has changed. If it has, the effect runs its update.

The biggest change with this refactor is that the
`didCreate`/`didUpdate` hooks used by classic components will now
interleave with modifiers. Previously, they always ran _before_ all
modifiers, regardless of whether the modifiers were children of a given
component. In theory, this shouldn't be an issue, but if it is we can
separate out the component hooks into a separate queue and restore the
prevous ordering.
@pzuraq pzuraq force-pushed the consolidate-references-and-tags branch from c163cf1 to a19e581 Compare May 23, 2021 16:02
Chris Garrett added 2 commits May 23, 2021 09:12
@pzuraq pzuraq force-pushed the consolidate-references-and-tags branch from a19e581 to d76e312 Compare May 23, 2021 21:49
@pzuraq pzuraq force-pushed the consolidate-references-and-tags branch from d76e312 to c851e14 Compare May 23, 2021 21:53
@NullVoxPopuli
Copy link
Contributor

@pzuraq what's the goal of this PR?

How could someone best take over?

@pzuraq
Copy link
Member Author

pzuraq commented Jan 30, 2022

@NullVoxPopuli the goal is to consolidate the tracking primitives so that we only have one set of primitives. Previously, we had the system of tags where you manually tracked tags. After a while, we realized we could represent everything pretty much as just Sources and Caches, where Sources represent root state and Caches represent derived state. Furthermore, these can both be implemented by the same underlying class and use the same interface (getValue and setValue can be called on both), meaning that they can be used interchangeably.

With this refactor, references in templates just become caches or sources, and everywhere we're currently using tags manually can be simplified a lot. This PR does that simplification in Glimmer VM, though it would still need to be done in Ember to integrate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants