Closed ovaistariq closed 1 year ago
/bounty $25
💎 $25 bounty created by ovaistariq
🙋 If you start working on this, comment
/attempt #368
to notify everyone👉 To claim this bounty, submit a pull request that includes the text
/claim #368
somewhere in its body📝 Before proceeding, please make sure you can receive payouts in your country
💵 Payment arrives in your account 2-5 days after the bounty is rewarded
💯 You keep 100% of the bounty award
🙏 Thank you for contributing to tigrisdata/tigris-client-ts!
/attempt #368
Hi! I would love to work on this!
I have one question about the deliverable here. Where would the test app be commited? Should it be in src/_tests_/tigris.worker.spec.ts
?
Yes, let's start with that. If it turns out that it needs its own repo, we can do that. BTW, I found this nice post about unit testing code with cloudflare workers: https://blog.cloudflare.com/unit-testing-workers-in-cloudflare-workers/
So, for a status:
node_compat
option, as cloudflare worker did not know how to resolve the node
builtins otherwise.http2
library, as, for some reason, it does not work, even with node_compat
enabled.There may be a blocker: Cloudflare has disabled the unsafe-eval
property for cloudflare workers, and openapi generates unsafe evals, at least for tigris-api/server/v1/api.proto
.
Some code examples seem to indicate that this is bypassable, so I will continue to investigate.
Things that remain to be done:
Thanks for the update @tachyonicbytes. Definitely, seems better to have a separate repo. Since this will be a separate repo, let's approach this as an example app that runs on cloudflare worker and uses Tigris. What do you think?
That seems right. Do you think it fits in https://github.com/tigrisdata/tigris-examples-ts, or should it be a separate repo in the tigris organization? Something like https://github.com/tigrisdata/tigris-example-cloudflare?
As for the code itself, do you think my approach is right for now? I mean getting the code from the documentation to run
I'm still searching the internet for directions in order to solve that problem. It seems that this aws library migrated from new Function
, in order to side-step this exact bug. The recommendation from this cloudflare community answer seems to be that there is currently no way to side-step it, apart from not using new Function
anymore.
Cloudflare workers have support for node.js. We need to build an app on Cloudflare workers that uses Tigris and verify that Tigris TypeScript works perfectly. If any problems are found, let's create GitHub issues for them.