Releases: marshallswain/feathers-pinia
v4.5.4
v4.4.1
What's Changed
- Add support to pass params to create method. by @dallinbjohnson in #165
- fix: prevent client from emitting the events back to server by @jd1378 in #166
- fix: allow custom types for User and export AuthenticateData by @jd1378 in #168
- feat(normalize-find): provide default context.result for find by @MajesticPotatoe in #153
New Contributors
Full Changelog: v4.2.6...v4.4.1
fix: refactor dynamic nested computed in useAuth
It's possible that the nested dynamic computed is breaking reactivity. The nested computed has been replaced with a direct reference to the stored value in itemsById
.
fix: internal `byId` storage now uses `ref`
Some reactivity in Pinia breaks when you use reactive instead of ref. This update switched the byId
object to use a ref
to fix reactivity.
🎁 useBackup, New Relationship Utils, Bye Bye storeAssociated, Shared Stores, and Proxy Services
🎁 useBackup
The new useBackup utility is the opposite of working with clones. Instead of binding your form to a clone, you use
the original record. It keeps a copy, letting you call backup
or restore
to revert changes. The save
method
auto-diffs from the backup, keeping data size to a minimum.
🎁 New Relationship Utilities
New methods have been added to the FeathersPinia Client. These utilities can be used inside setupInstance
functions to
help form relationships between services:
- app.pushToStore pushes data into other service stores. It replaces
storeAssociated
. - app.defineVirtualProperty sets up a virtual property on an object.
- app.defineVirtualProperties sets up many virtual properties on an object.
🔥 storeAssociated
Deprecated
As of Feathers-Pinia v4.2, the storeAssociated
utility has been replaced with a suite of smaller, more-flexible,
single-purpose utilities. See Data Modeling for the new way to store associated data.
🎁 Share Stores Between Services
The PiniaServiceConfig
interface now accepts a storeName
string. storeName {String}
is the name of the store to use for the service. It defaults to service:${servicePath}
. You can also use storeName
to make two services share the same store.
🎁 Proxy Services
The PiniaServiceConfig
interface now also accepts an instanceServicePath
string. The instanceServicePath {String}
overrides the service used for instance-level service methods, like patch
, and remove
. This is useful for "proxy" services. For example: pages/full
loads the page record with populated data, but you want to patch/remove the record through the pages
service.
Also New
- Expose the diff util: the internal
diff
utility is now available in the exports.
Fixes
- Fixes an issue with Cloudflare Workers compatibility (which do not support EventEmitter)
- The
useFind
internalwatch
now usesflush: 'sync'
to prevent an infinite loop during SSR.
🔥 Revert the bug that the last bug "fix" caused.
It turns out that faulty conditional was saving us from a more serious problem. It caused a large fire when my CPU went up in flames. Just kidding. It just wasn't a simple fix, after all.
Reverts the changes made in this release: https://github.com/marshallswain/feathers-pinia/releases/tag/v3.0.6
🐜 Addresses a faulty conditional for find responses
Intended to solve the find
response not being handled, as described in this issue: #126
🐜 Fix mismatch type error for some Feathers Clients
All @feathersjs/
packages have been updated to the latest versions. As a result, some internal types were updated to prevent errors when using the FeathersPinia client.
The documentation has also been updated to show how to ensure all FeathersPiniaService
methods are available for untyped Feathers clients. See the "Common Pitfalls" section on this page: https://feathers-pinia.pages.dev/guide/common-patterns.html
The basic gist is that you need to provide a ServiceTypes generic when calling the feathers()
function:
// import the FeathersService type
import { feathers, type FeathersService } from '@feathersjs/feathers'
// Create a ServiceTypes generic
type ServiceTypes = Record<string, FeathersService>
// Provide `ServiceTypes` in angle brackets before the parentheses
const feathersClient = feathers<ServiceTypes>()
🐜 Fix OFetch adapter swallowing errors
The included feathers-ofetch adapter was swallowing Feathers errors and turning them into a plain text error. Now the full error from the server is correctly returned from requests.
This didn't have any effect on WebSocket communication, which did not experience the error.
🎁 Environment compatibility upgrades
There are no practical changes for existing users, but this release improves compatibility with some Node.js versions and WebContainers.
Many thanks to @FossPrime! ❤️