New JavaScript API methods #8
Replies: 2 comments
-
Wized.apps would be a gamechanger, especially working with Supabase. There's a lot of requests like: uploading multiple files to a bucket, getting the list of bucket's items, or delete file etc. that can't be done natively in Wized. And I'm really suffering right now, working on my project 😄 So, I'll be very gratefull to you for this feature) |
Beta Was this translation helpful? Give feedback.
-
Update on |
Beta Was this translation helpful? Give feedback.
-
There are a few API methods that have been requested by the community.
Let's discuss them!
Exposing App SDK's via
Wized.apps
Update:
We have created a better approach via Wized.requests.getClient().
Here's the preview documentation for the new method, feel free to give it a read an provide feedback!
https://wized-docs-2-emcelod7u-finsweet.vercel.app/javascript-api/#wized-requests-getclient
Original:
This one is by far the most requested one.
In Wized there are some integrations like Supabase and Firebase that have their own native SDK. Although Wized tries to stick as close as possible to their API, there are some missing features that are not built into Wized (yet).
To have full control of the Apps, users have asked if it would be possible to access those SDK's via the Wized JavaScript API.
I'm thinking we could do something like this:
For example, the user has a Supabase app called
my_supabase
, accessing the Supabase SDK to perform a basic select would look like this:Pros
Cons
An alternative that could potentially fix the latter problem could be to expose a single method to retrieve an SDK, like:
So the previous example would look like:
I'm open to ideas!
Reactive functions via
Wized.data.effect()
Wized uses @vue/reactivity under the hood to implement granular reactivity using signals.
The base of Wized's signals is the effect() method, which allows us to create reactive effects that re-run any time its dependencies change.
Exposing this method in our API would allow users to implement more advanced custom logic that smartly reacts to their Wized application state.
Here's an example:
Aborting requests via
Wized.requests.abort()
Sometimes users want to abort an ongoing request. This would be possible only when using REST requests (via an AbortController) and Supabase requests (via abortSignal), but it's worth exposing it in my opninion.
It would look something like this:
I don't know if it would also be valuable to include this request abortion control in the Wized native event after actions. Same as users can
Perform request
, we could add a newAbort request
action. Thoughts?Wized.destroy() or Wized.restart() methods for SPA mode
Some users tried to use Wized in combination with an SPA router like barba.js or swup. These methods would allows users to safely destroy and restart Wized's runtime to make it compatible with SPA navigations.
Beta Was this translation helpful? Give feedback.
All reactions