Version 4.7 includes a number of new deprecations, several new features, bug fixes, and a large slate of significant performance improvements.
Of Note:
Version 4.7 implements a "2.1" cache spec while deprecating the v1 cache spec. This spec differs somewhat from the original 2.0 RFC, an updated RFC specifying the modifications will be published soon. Users looking to migrate to the 2.1 cache should expect that the finalized version of 2.1 enforces that the cache is always a singleton (vs merely allowed to be a singleton), and that data provided to the store and queries to the store from the cache should always contain identifiers in their stable form. This latter point is enforced in 4.7, the former is not yet enforced.
Explicit Polymorphic Relationships: starting in 4.7 it is no longer required to use Mixins or Inheritance to achieve polymorphic relationships. See emberjs/rfcs#793 for full details.
Most record hook and cache APIs now have documentation on api.emberjs.com. More still to come as part of finalizing v2.1 cache.
The return values of hasMany relationships, peekAll, findAll and query are now proxies to native arrays and as such all native array APIs are now usable. These objects will act fully as if they are native arrays. Restrictions on immutability of the result of peekAll and query still apply.
InternalModel is dead, long live InternalModel. Similarly, nearly all private API's have undergone significant change, if your app previously abused these APIs the most likely refactor is to use a custom model or a custom cache.
⚡️ Performance Improvements
Note: many performance improvements are gated by deprecation removal, meaning that you need to resolve all deprecations for EmberData 4.7 and mark your app as compatible with that version in order to opt in to the fastest codepaths.
All applications should observe significant speed improvements when using EmberData 4.7. The below call-outs are in relation to EmberData 4.6, which was itself also the fastest version of EmberData since we began benchmarking and tracking in the late 2.x series. Many of these improvements were made possible due to the nearing completion of Project Trim (and specifically the removal of InternalModel).
⚡️Pushing new data into the cache is now ~33% faster
⚡️Accessing the LiveArray (peekAll / findAll) for the first time is now 97% faster
⚡️Creating record instances is now ~45-50% faster
⚡️Reduced memory pressure may speedup first render after a large push by ~75%
⚡️Initial Access of Related Records is now ~80% faster
⚡️Initial Access of Async Relationships sees 30% faster creation of async proxies
⚡️Unloading of all records individually (one at a time in a loop) is 40% faster
⚡️Destroying all records (e.g. also sending an API request) in a loop is 62% faster
⚡️Unloading all records (of all types) is ~98% faster
⚡️Receiving and processing updated payloads for existing hasMany relationships is ~40% faster
In addition to these improvements significantly speeding up data usage in applications, we expect to see especially dramatic improvements anywhere the application undergoes teardown (after each test in CI or Fastboot request is processed). In several applications that we looked at, fixture population for acceptance and integration tests accounted for 30% of the total test time, with teardown of those fixtures representing another 40% of the total test time. We would expect such tests to see an overall test-run improvement time in the 50-75% range.
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Bumps ember-data from 4.4.0 to 4.7.1.
Release notes
Sourced from ember-data's releases.
... (truncated)
Changelog
Sourced from ember-data's changelog.
... (truncated)
Commits
686111e
v4.7.1dda3e3e
v4.7.0a03a130
FEAT: Explicit Polymorphic Relationship Support [emberjs/rfcs#793] (#7955)026e5d0
chore(deps): update dependency@​types/ember-qunit
to ^5.0.1 (#8158)ab460c3
chore(deps): update dependency@​types/ember
__utils to ^4.0.1 (#8157)986cd87
port test from #6147 (#8160)c45f66e
chore(deps): update dependency typescript to ~4.8.2 (#8152)5e6a95d
v4.8.0-alpha.6e6da96d
fix linting7255223
feat: deprecate v1 cache (#8129)Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)