-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
feat: @ember-data/tracking primitives to prevent backtracking render errors #8214
Conversation
Asset Size Report for a70fbb7 Modern Builds 🛑 The size of the library EmberData has increased by +1.14 KB (+189.0 B compressed) which exceeds the failure threshold of 75 bytes.Warnings
Changeset
Full Asset Analysis (Modern)
Modern Builds (No Rollup) 🛑 The size of the library EmberData has increased by +1.07 KB (+124.0 B compressed) which exceeds the failure threshold of 75 bytes.WarningsChangeset
Full Asset Analysis (Modern)
|
Performance Report for a70fbb7 Scenario - basic-record-materialization: ☑️ Performance is stable
Scenario - relationship-materialization-simple: ☑️ Performance is stable
Scenario - relationship-materialization-complex: ☑️ Performance is stable
Scenario - unload: ☑️ Performance is stable
Scenario - unload-all: ☑️ Performance is stable
Scenario - destroy: ☑️ Performance is stable
Scenario - add-children: ☑️ Performance is stable
Scenario - unused-relationships: ☑️ Performance is stable
|
Commit v Release Performance Report for a70fbb7 Scenario - basic-record-materialization: ☑️ Performance is stable
Scenario - relationship-materialization-simple: ☑️ Performance is stable
Scenario - relationship-materialization-complex: ☑️ Performance is stable
Scenario - unload: ☑️ Performance is stable
Scenario - unload-all: ☑️ Performance is stable
Scenario - destroy: ☑️ Performance is stable
Scenario - add-children: ☑️ Performance is stable
Scenario - unused-relationships: ☑️ Performance is stable
|
work on #8173
Introduces
@ember-data/tracking
package with the exportstransact
andmemoTransact
for executing/authoring code for which all change notifications in ember-data should be flattened. This prevents backtracking render errors for read-before-write in situations in which doing so is actually safe.Backtracking render errors will still occur if you've already read something before the transaction you write during the transaction.
I also added
untracked
to this, which silencesreads
and defers write notifications via a micro task.Note: while this package introduces a new public API to stop-gap the issues Ember and
@glimmer/tracking
currently have around read-write interleaving etc, it's intended that any future primitives from glimmer itself that serve the same purpose would be able to replace these. We'll likely always keep these ourselves purely to ensure interop with other frameworks.