Releases: orbitjs/orbit
v0.17.0-beta.3
This is the third beta release for v0.17. It includes several enhancements and some major modernizations to the build process and build dependencies.
This release finally removes @orbit/store
, which has been deprecated for a while. Please update your apps to use @orbit/memory
instead.
The @orbit/jsonapi
source now supports a new url
option, which allows for completely custom URLs to be used for any request (both queries and transforms).
Furthermore, request option handling has been standardized for both queries and transforms. Any option passed at the root level will be merged with options specific to sources (with the specific options taking precedence).
The above changes mean that the following requests will both be treated by a jsonapi
source named remote
:
source.query(q => q.findRecords('planets'), {
label: 'Find planets and their moons',
sources: {
remote: {
include: 'moons',
url: 'https://example.com/custom/planets'
}
}
});
source.query(q => q.findRecords('planets'), {
label: 'Find planets and their moons',
include: 'moons',
url: 'https://example.com/custom/planets'
});
The former will only provide the include
and url
options to the remote
source, while other sources won't be aware of them. For most cases, this level of specificity is not needed since sources typically ignore options they don't recognize.
Changelog
🚀 Enhancement
@orbit/jsonapi
@orbit/data
,@orbit/indexeddb
,@orbit/jsonapi
,@orbit/local-storage
,@orbit/memory
,@orbit/record-cache
@orbit/record-cache
🏠 Internal
@orbit/coordinator
,@orbit/core
,@orbit/data
,@orbit/identity-map
,@orbit/immutable
,@orbit/indexeddb-bucket
,@orbit/indexeddb
,@orbit/integration-tests
,@orbit/jsonapi
,@orbit/local-storage-bucket
,@orbit/local-storage
,@orbit/memory
,@orbit/record-cache
,@orbit/serializers
,@orbit/store
,@orbit/utils
Committers: 2
v0.16.5
v0.16.5 (2020-03-12)
This release backports PR #735 to v0.16 to improve the mergeRecords
function to better handle links, meta, and relationships members when merging records. This fixes a bug (#709) in which data
members in a relationship were replaced when the updated relationship contained only links
or meta
(but not a replacement data
).
🚀 Enhancement
@orbit/data
,@orbit/memory
,@orbit/record-cache
Committers: 1
- Dan Gebhardt (@dgeb)
v0.17.0-beta.2
This is the second beta release for v0.17. It includes a number of significant new features and improvements from 6 contributors.
Changelog
🚀 Enhancement
@orbit/record-cache
@orbit/data
@orbit/data
,@orbit/memory
,@orbit/record-cache
@orbit/jsonapi
@orbit/coordinator
,@orbit/core
,@orbit/data
@orbit/core
,@orbit/data
,@orbit/indexeddb-bucket
,@orbit/local-storage-bucket
@orbit/data
,@orbit/indexeddb
,@orbit/integration-tests
,@orbit/jsonapi
,@orbit/local-storage
,@orbit/memory
,@orbit/record-cache
🐛 Bug Fix
@orbit/data
- #710 Allow mergeOperations to set null for hasOne relationship (@jembezmamy)
@orbit/jsonapi
- #712 [BUGFIX] Always allow serialization of null attributes (@makepanic)
📝 Documentation
🏠 Internal
@orbit/record-cache
@orbit/coordinator
,@orbit/core
,@orbit/data
,@orbit/identity-map
,@orbit/immutable
,@orbit/indexeddb-bucket
,@orbit/indexeddb
,@orbit/integration-tests
,@orbit/jsonapi
,@orbit/local-storage-bucket
,@orbit/local-storage
,@orbit/memory
,@orbit/record-cache
,@orbit/serializers
,@orbit/store
,@orbit/utils
Committers: 6
- Christian (@makepanic)
- Clemens M�ller (@pangratz)
- Dan Gebhardt (@dgeb)
- Paul Chavard (@tchak)
- Paweł Bator (@jembezmamy)
- Philipp Brumm (@brumm)
v0.16.4
This release fixes a couple bugs, both related to null
values:
- When merging changes, say from a fork back into a root source,
null
values for has-one relationships were not being applied. - In some scenarios, the
JSONAPISerializer
would error when serializingnull
values for attributes.
Many thanks to @jembezmamy and @makepanic for finding and fixing these bugs.
Changelog
🐛 Bug Fix
@orbit/data
- #710 Allow mergeOperations to set null for hasOne relationship (@jembezmamy)
@orbit/jsonapi
- #712 [BUGFIX] Always allow serialization of null attributes (@makepanic)
Committers: 2
- Christian (@makepanic)
- Paweł Bator (@jembezmamy)
v0.17.0-beta.1
This is the first beta release for v0.17. It includes several important enhancements and deprecations:
-
As described in #695, an unsubscribe function is now returned whenever subscribing to an event (with
on
orone
). This function is more foolproof than callingoff
directly. -
IndexedDB and LocalStorage sources are now more efficient about activation and deactivation.
-
Thanks to #688, queries now support multiple expressions! This makes queries analogous to transforms, which can support multiple operations.
Query#expression
has been deprecated in favor ofQuery#expressions
.
Thanks to @tchak for doing all the heavy lifting with this release! 💪
Changelog
🚀 Enhancement
@orbit/core
,@orbit/data
,@orbit/record-cache
@orbit/indexeddb
,@orbit/local-storage
@orbit/indexeddb
@orbit/data
,@orbit/indexeddb
,@orbit/jsonapi
,@orbit/local-storage
,@orbit/memory
,@orbit/record-cache
Committers: 1
- Paul Chavard (@tchak)
v0.16.3
This release patches some issues with filtering results in @orbit/record-cache
, and thus also in downstream sources such as @orbit/memory
:
relatedRecord
filter now works withnull
- All filters now ignore any
undefined
values (and will never match based upon anundefined
value).
Thanks to @Michiel87 and @dgeb for finding and fixing these issues.
@tchak also did a bunch of housekeeping with this release - updating dependencies and switching lerna over to use yarn workspaces.
Changelog
🐛 Bug Fix
@orbit/memory
,@orbit/record-cache
@orbit/record-cache
- #701 fix: added null case to relatedRecord filter processing (@Michiel87)
🏠 Internal
@orbit/coordinator
- #697 Bump mixin-deep from 1.3.1 to 1.3.2 in /packages/@orbit/coordinator (@dependabot[bot])
@orbit/utils
- #698 Bump mixin-deep from 1.3.1 to 1.3.2 in /packages/@orbit/utils (@dependabot[bot])
@orbit/coordinator
,@orbit/core
,@orbit/data
,@orbit/identity-map
,@orbit/immutable
,@orbit/indexeddb-bucket
,@orbit/indexeddb
,@orbit/integration-tests
,@orbit/jsonapi
,@orbit/local-storage-bucket
,@orbit/local-storage
,@orbit/memory
,@orbit/record-cache
,@orbit/serializers
,@orbit/store
,@orbit/utils
- Other
Committers: 3
- Dan Gebhardt (@dgeb)
- Michiel de Vos (@Michiel87)
- Paul Chavard (@tchak)
v0.16.2
v0.16.2 only updates @orbit/coordinator
with a fix to the RequestStrategy
handler. As described in #687, this fix ensures that custom handler functions on a RequestStrategy
, such as action
, blocking
, and filter
, receive all args emitted from the source event:
- For
beforeX
events such asbeforeQuery
, the handler functions will receive the secondhints
argument. - For
x
events such asquery
, the handler functions will receive the secondresult
argument. - For
xFail
events such asqueryFail
, the handler functions will receive the seconderror
argument.
This is considered a bug fix because the behavior changed unintentionally when hints were introduced in v0.16.0.
Changelog
🐛 Bug Fix
Committers: 1
- Dan Gebhardt (@dgeb)
v0.16.1
This patch release contains a few fixes, primarily focused on builds.
The ES5 builds available in each package's dist/*/es5 dir are now processed with the for...of
and async / await
transforms. These builds will need to be paired with the regenerator-runtime
package to ensure that the regeneratorRuntime
global is defined.
The default builds targeted by main
and module
are now ES-latest. These builds are as small and performant as possible, and of course can be further processed with Babel if necessary. This change is considered a bug fix because the previous targets were neither ES5 nor ES-latest, but rather a merger of the two (see #661 for more details).
Changelog
🚀 Enhancement
@orbit/jsonapi
- #683 fix(jsonapi): don't deserialize null attributes (@makepanic)
🐛 Bug Fix
@orbit/core
@orbit/coordinator
,@orbit/core
,@orbit/data
,@orbit/identity-map
,@orbit/immutable
,@orbit/indexeddb-bucket
,@orbit/indexeddb
,@orbit/integration-tests
,@orbit/jsonapi
,@orbit/local-storage-bucket
,@orbit/local-storage
,@orbit/memory
,@orbit/record-cache
,@orbit/serializers
,@orbit/store
,@orbit/utils
📝 Documentation
@orbit/store
- #681 fix: fix typo in deprecation message (@makepanic)
Committers: 3
- Christian (@makepanic)
- Dan Gebhardt (@dgeb)
- Miguel Camba (@cibernox)
v0.16.0
This is the first official release of v0.16. There have been no changes since the last beta release: v0.16.0-beta.11.
The Orbit guides now contain a complete summary of what's new in v0.16, which covers all the major changes since v0.15.
v0.16.0-beta.11
🚨 If you are an author of any sources, please focus on the breaking changes in this release! 🚨
While testing the hinting feature and its interactions with different source interfaces, @tchak uncovered some scenarios in which hints could fail to return expected results (see #612). This led to a quest to understand those problems and fix them across source interfaces. Unfortunately, in order to guarantee predictable and consistent behavior, we needed to move some responsibilities to source implementations that were previously handled in Orbit's private implementations of those interfaces.
Thus, if you're writing sources, please ensure that you do the following in any of your internal implementation methods that work with transforms (e.g. _update
, _sync
, etc.):
-
Check the
transformLog
for the requested transform to see if work actually needs to be done before doing it. -
Invoke
transformed
for any transforms that are applied.
By moving these responsibilities to source implementations, we allow more flexibility in implementations. For instance, _update
can ignore re-applying transforms that may have been sync'd via beforeUpdate
listeners, while still returning results that are specified via the hints
argument.
In order to update the @orbit/memory
source to both support hints and respond to the above requirements, the following changes were needed:
/////////////////////////////////////////////////////////////////////////////
// Syncable interface implementation
/////////////////////////////////////////////////////////////////////////////
async _sync(transform: Transform): Promise<void> {
- this._applyTransform(transform);
+ if (!this.transformLog.contains(transform.id)) {
+ this._applyTransform(transform); // <- internal implementation that applies the transform to the source's cache
+ await this.transformed([transform]);
+ }
}
/////////////////////////////////////////////////////////////////////////////
// Updatable interface implementation
/////////////////////////////////////////////////////////////////////////////
async _update(transform: Transform, hints?: any): Promise<any> {
- return this._applyTransform(transform);
+ let results: PatchResultData[];
+
+ if (!this.transformLog.contains(transform.id)) {
+ results = this._applyTransform(transform); // <- internal implementation that applies the transform to the source's cache
+ await this.transformed([transform]);
+ }
+
+ if (hints && hints.data) {
+ if (transform.operations.length > 1 && Array.isArray(hints.data)) {
+ return hints.data.map((idOrIds: RecordIdentity | RecordIdentity[]) =>
+ this._retrieveFromCache(idOrIds)
+ );
+ } else {
+ return this._retrieveFromCache(hints.data);
+ }
+ } else if (results) {
+ if (transform.operations.length === 1 && Array.isArray(results)) {
+ return results[0];
+ } else {
+ return results;
+ }
+ }
}
/////////////////////////////////////////////////////////////////////////////
// Queryable interface implementation
/////////////////////////////////////////////////////////////////////////////
async _query(query: Query, hints?: any): Promise<any> {
- return this._cache.query(query);
+ if (hints && hints.data) {
+ return this._retrieveFromCache(hints.data);
+ } else {
+ return this._cache.query(query);
+ }
}
Please review your custom sources to make any necessary changes. If your methods don't support hints, the diffs should rather small, like in the _sync
method above. If you want to support hints
, you'll need to provide alternate code paths for when hints are provided and not, like in the _update
and _query
methods above.
We're planning to include a guide to writing your own sources with the v0.16 release to clarify all these responsibilities.
Changelog
💥 Breaking Change
@orbit/data
,@orbit/indexeddb
,@orbit/jsonapi
,@orbit/local-storage
,@orbit/memory
🚀 Enhancement
@orbit/coordinator
,@orbit/data
,@orbit/indexeddb
,@orbit/jsonapi
,@orbit/local-storage
,@orbit/memory
🏠 Internal
@orbit/jsonapi
,@orbit/memory
@orbit/data