You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR adds support for latest field for createAsync and createAsyncStore for compatibility with createResource.
MOTIVATION
At the moment createAsync and createAsyncStore are just wrappers for createResource. createResource provides the mechanism to avoid triggering Suspense, which is quite useful in some cases.
In order to improve adoption of createAsync and createAsyncStore it would be useful to provide this mechanism also for these primitives.
In the future major release of solid support of the latest field (and createResource) will be dropped in favor of createAsync and createAsyncStore. .latest could be replaced with latest(...) helper (TBD) or could be dropped at all. In both cases the migration will be simple:
Replaced with latest(...) helper: data.latest => latest(data)
Dropped support of .latest field: data.latest => data
At the moment lack of .latest support for createAsync and createAsyncStore prevents people from wide adoption of these primitives. Moreover, people start invent some hacks like this which consume much more memory.
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
This PR includes no changesets
When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types
Yeah.. I was hoping to avoid this until we had a better idea of what the future API would look like. But it seems we're here. Having something like .latest is relatively low risk as you said as it isn't transitive and it doesn't cause poor patterns like .state or .error or .loading can unintentionally. So my gut is we can move with this and the migration cost will be relatively minor. It will still be something, but it is localized mostly.
I'm not ignoring this. I am just being a little slow. We need to be careful and I'm actively looking at stuff right now that I figured a few more days wouldn't make a huge difference. If I don't get to where I want by the end of the week we can go ahead.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 adds support for
latestfield forcreateAsyncandcreateAsyncStorefor compatibility withcreateResource.MOTIVATION
At the moment
createAsyncandcreateAsyncStoreare just wrappers forcreateResource.createResourceprovides the mechanism to avoid triggeringSuspense, which is quite useful in some cases.In order to improve adoption of
createAsyncandcreateAsyncStoreit would be useful to provide this mechanism also for these primitives.In the future major release of solid support of the
latestfield (andcreateResource) will be dropped in favor ofcreateAsyncandcreateAsyncStore..latestcould be replaced withlatest(...)helper (TBD) or could be dropped at all. In both cases the migration will be simple:latest(...)helper:data.latest=>latest(data).latestfield:data.latest=>dataAt the moment lack of
.latestsupport forcreateAsyncandcreateAsyncStoreprevents people from wide adoption of these primitives. Moreover, people start invent some hacks like this which consume much more memory.