Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.
main
is currently in pre mode so this branch has prereleases rather than normal releases. If you want to exit prereleases, runchangeset pre exit
onmain
.Releases
[email protected]
Major Changes
#715
e8155b2
Thanks @NullVoxPopuli! - Drop support for TypeScript < 4.8 in order to support Glint.#778
901ae9a
Thanks @NullVoxPopuli! - Themap
utility resource has changed its first type-argument for better inference.The utility already supported inference, so this change should not impact too many folks.
When explicit type-arguments were specified,
This is advantageous, because with
@tsconfig/ember
, the optionnoUncheckedIndexedAccess
is enabled by default. This is a great strictness / quality option to have enabled,
as arrays in javascript are mutable, and we can't guarantee that they don't change between
index-accesses.
However the
map
utility resource explicitly disallows the indicies to get out of syncwith the source
data
.But!, with
noUncheckedIndexedAccess
, you can only infer so much before TS goes the safe route,and makes the returned type
X | undefined
.For example, in these type-tests:
#779
a471d9b
Thanks @NullVoxPopuli! -trackedFunction
has a new API and thus a major version release is required.Work by @lolmaus
tl;dr: the breaking changes:
isResolved
is only true on successisError
has been renamed toisRejected
isLoading
has been removed as it was redundantother changes:
trackedFunction
is a wrapper aroundember-async-data
'sTrackedAsyncData
NOTE:
trackedFunction
is an example utility of how to use auto-tracking with function invocation,and abstract away the various states involved with async behavior. Now that the heavy lifting is done by
ember-async-data
,trackedFunction
is now more of an example of how to integrated existing tracked utilities in to resources.Migration
Previously,
trackedFunction
could take an initial value for its second argument.This has been removed, as initial value can be better maintained and made more explicit
in user-space. For example:
Or, in a template:
Or, in gjs/strict mode:
Previously, the
isResolved
property wastrue
for succesful and error statesNow,
isResolved
is only true when the function passed totrackedFunction
has succesfullycompleted.
To have behavior similar to the old behavior, you may want to implement your own
isFinished
getter:Minor Changes
#778
f841a98
Thanks @NullVoxPopuli! - Use strictest possible settings with TypeScript so that consumers can't be stricter than this library#776
a99793e
Thanks @NullVoxPopuli! - Glint is now supported starting with 1.0.0-beta.3Patch Changes
abaad4a
Thanks @GreatWizard! - fix typo in map error message when checking if every datum is an object