Replies: 4 comments 7 replies
-
|
Easy enough to test, just try importing the regular SDK in a hook and see what happens. Please report back :) |
Beta Was this translation helpful? Give feedback.
-
|
Tested it and found out this will be an hard task, as all of the PocketPages core need to be rewritten to support async/away starting by the EJS render. Easy enough to test, hard enough to implement. ;) |
Beta Was this translation helpful? Give feedback.
-
|
As goja supports async/await and Promises, I think it is possible to uses pocketbase SDK, the only change you need to do is to provide an fetch function, and It can be done without forking: const pb = new PocketBase('http://127.0.0.1:8090');
pb.beforeSend = function (url, options) {
options.fetch = async (url, options) => {
// Uses $http.send here
...
};
return { url, options };
}; |
Beta Was this translation helpful? Give feedback.
-
|
So goja supports it but PocketBase does not allow yet?
…On Fri, Aug 15, 2025 at 10:35 AM Rodrigo Moyle ***@***.***> wrote:
Ok, did not work at all, It is not possible to register and async routing
route like:
routerAdd('GET', '/hello/{name}', async (e) => {});
Logs this:
WARN the handler must a non-async function and not return a Promise
—
Reply to this email directly, view it on GitHub
<#88 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAWMN26BI6JJH7BKPU7JD6D3NX42NAVCNFSM6AAAAACD5ESYBWVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTIMJRHAZTMOA>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***
com>
--
*Victorio Berra*
***@***.***
636-328-7110
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
@benallfree I was looking at dop251/goja and found out that it supports async/await syntax, what did you think about using the JS SDK from pocketbase/js-sdk instead of benallfree/pocketbase-js-sdk? Did you tried it before and not worked?
Beta Was this translation helpful? Give feedback.
All reactions