bret_pat
bret_pat
Explore posts from servers
CDCloudflare Developers
Created by bret_pat on 4/6/2024 in #workers-help
Worker "isSecureContext" is set to false locally
Hi! A library that I'm using uses the Web Crypto API which checks (!globalThis.isSecureContext) which fails while developing locally. It seems like worker's aren't running in a secure context. Is there some sort of setting that I need to change which will fix this?
3 replies
DTDrizzle Team
Created by bret_pat on 10/20/2023 in #help
Streaming results from mysql
It seems like there have been a few unanswered posts about streaming results from a query, but they don't seem to be followed up on. Is that because there is an alternative solution to making these streaming requests rather than having drizzle support it natively? Any advice would be great.
8 replies
DTDrizzle Team
Created by bret_pat on 8/9/2023 in #help
Share drizzle-zod schemas with the frontend
I'm wondering how I should use drizzle-zod generated schemas without leaking the actual implementation of my tables to the frontend? I'm assuming by exporting drizzle-zod schema's and letting the frontend consume them, I'm actually bundling the definitions inside of my FE as well. Is there a way to avoid this? Or frankly, should I not care?
2 replies
PD🧩 Plasmo Developers
Created by bret_pat on 8/6/2023 in #👟framework
How to use Plasmo's globalProvider?
For tanstack query, I need to have a global provider for all of the getInlineAnchorList(). I saw that this should be possible through this github pull but I haven't been able to get it to work. Does anyone have a working example? https://github.com/PlasmoHQ/plasmo/pull/557
7 replies
TtRPC
Created by bret_pat on 8/4/2023 in #❓-help
Get query parameters in middleware
Hi! I'm looking to perform authorization inside of middleware and I'm wondering how I can access the parameters that the user queried inside of the middleware? For example, let's say a user requested to look at Workout routine ID 532 in an API call. How would I be able to access the workout ID inside of middleware? I have their userID within CTX but no way to get the url path Thanks!
5 replies
PD🧩 Plasmo Developers
Created by bret_pat on 8/4/2023 in #👟framework
Putting Key in manifest causes ``Uncaught Error: Extension context invalidated.
Removing the key makes it work but my problem is that I'm trying to generate the same extension ID so that I could use Clerk locally. Any ideas on how to fix?
9 replies
PD🧩 Plasmo Developers
Created by bret_pat on 7/25/2023 in #👟framework
PlasmoGetInlineAnchorList doesn't shift host layout
I'm looking to inject elements onto the page whenever more content is loaded. The content would be a button under every post. I've exported a getInlineAnchorList function but the button is being overlayed on each post rather than inline with the existing HTML. i.e. I want the extra button to look "naturally placed" onto the content rather than just an overlay How would I fix this issue?
3 replies
PD🧩 Plasmo Developers
Created by bret_pat on 7/21/2023 in #👟framework
Content match help
I'm looking to match any urls on facebook or tiktok domains. I currently have
matches: ["https://*.tiktok.com/*", "https://*.facebook.com/*"]
matches: ["https://*.tiktok.com/*", "https://*.facebook.com/*"]
. But it doesn't work for other domain endings like facebook.eu/, I'd want to be able to match any domain ending. Any help is appreciated!
2 replies
CDCloudflare Developers
Created by bret_pat on 5/3/2023 in #workers-help
Rust worker, cannot build default project
New project, ran
pnpm create cloudflare workers worker-rust
pnpm create cloudflare workers worker-rust
and I'm trying to run
pnpm wrangler dev
pnpm wrangler dev
but I get an error
Running custom build: cargo install -q worker-build && worker-build --release
error[E0658]: use of unstable library feature 'bool_to_option'
Running custom build: cargo install -q worker-build && worker-build --release
error[E0658]: use of unstable library feature 'bool_to_option'
I'll add my toml to a separate post
3 replies
CDCloudflare Developers
Created by bret_pat on 5/1/2023 in #pages-help
next-on-pages and modifying routes
So I only want page functions to run whenever I hit my nextjs API route, how can I do this?
9 replies
CDCloudflare Developers
Created by bret_pat on 4/13/2023 in #workers-help
Orchestrate long running workers
Background information I have a business use case that I'm trying to figure out how to implement in workers or if workers aren't a good solution for my situation. A user can start a long running task that consists of many sequential third party api calls. We want this long running task to be both cancellable (in case the user changes their mind mid-way), and throttle-able across all users so that we don't bring down the 3rd part API. We'd want to know when a task has officially cancelled and not just when the cancel as requested, since we would likely want to start a new task after the previous one has officially completed. Current thoughts on implementation We'd have to break down our long running task into multiple sequential workers for a specific task, so that one continues after the previous one has ran out of CPU time. The biggest CPU sink would be just parsing the json that we get from the 3rd party api. Maybe a durable object (that shows which tasks should be active) + a queue that has all of the requests of long running tasks? How would we be able to implement a long-running task consisting on multiple sequential workers, prerably bundled since we're mostly waiting on API calls?
2 replies
DTDrizzle Team
Created by bret_pat on 3/17/2023 in #help
Stream select
Hey! I'm doing a large select and I'm wondering how to stream the responses for MySql
2 replies