tmcw
tmcw
Explore posts from servers
DDeno
Created by tmcw on 12/13/2023 in #help
Is there a way to get a server's SSL certificate's public information with Deno?
This is available in Node with getPeerCertificate() but not in Deno's Node compatibility layer - is there an equivalent I'm missing?
2 replies
DDeno
Created by tmcw on 10/4/2023 in #help
Is it possible to use Cache-Control headers to control Deno's cache
I've seen via an issue ( https://github.com/denoland/deno/issues/16296 ) that Deno stores its metadata.json files in its cache directory so that it has response headers from when the dependency was downloaded, for cache invalidation. Is there cache invalidation based on these headers? Like if I have a dependency via HTTP that has Cache-Control: no-cache, can it be re-downloaded each time it's requested?
3 replies
DDeno
Created by tmcw on 9/29/2023 in #help
Is there a schedule / pattern for which Deno releases get new Docker files?
We'd love to update to Deno 1.37.1 in production, but deno_docker is still at 1.37.0. I've noticed that sometimes there are releases that don't get cut in Docker files until well after Deno's updated. Is there a process / guideline to which versions become Docker images? https://github.com/denoland/deno_docker
2 replies
DDeno
Created by tmcw on 9/12/2023 in #help
Is there any way to get Deno to not statically analyze import()?
I understand that statically analyzing and fetching dynamic import() calls is a good thing for performance, but it's making my usecase impossible - I want to import user code, which may crash, and to handle the error if it, say, throws an error on import. I can do this with browser import(). I can do it with Node. I can't do it with Deno: you basically can't use import statements like you'd expect to if you read the MDN page, which seems like a major move away from this being web-standardsy and also makes dynamic import way less useful. Is there a way to actually dynamically load code, at runtime, that I'm missing?
8 replies
DDeno
Created by tmcw on 8/23/2023 in #help
Deno with the --inspect-wait arg doesn't expose /json/protocol - should it?
I'm testing out connecting to a Deno process via the v8 inspector protocol: https://deno.land/[email protected]/basics/debugging_your_code and discovering that though it seems to work with Chrome and certain other tools, trying it with chrome-remote-interface https://github.com/cyrus-and/chrome-remote-interface says that it doesn't expose an endpoint at /json/protocol. I've tried Node, and it does expose an endpoint there and list its capabilities with JSON. Is this not part of the v8 protocol but something else? Maybe this is something Deno hasn't implemented?
4 replies
DTDrizzle Team
Created by tmcw on 8/7/2023 in #help
Is there a simpler way to get an enum type than (typeof enumType)["enumValues"][number]?
Pretty quick question (and maybe quick answer) - we have this pattern in a few places and it looks a bit verbose.
7 replies
TtRPC
Created by tmcw on 6/15/2023 in #❓-help
Can I get non-redacted INTERNAL_SERVER_ERRORS in production?
I'm trying to debug crashes in production, and having a hard time. As far as I can tell, errors are redacted before they're sent to the onError handler, which is a little surprising: I don't want to send stack traces to the wider internet, of course, but I'd want an internal, server-side-only error handler with the raw errors. Is that possible? Thanks!
2 replies
DTDrizzle Team
Created by tmcw on 5/5/2023 in #help
I ran introspect:pg to initialize my schema, then created a new migration. How should I deploy this?
The remote database, right now, doesn't have the drizzle.__drizzle_migrations table. It'd be nice to have a way to know that the old migrations - the ones that were generated by introspect:pg and just reflect the existing state of the database - won't run. Is this the right way to look at it? Thanks!
17 replies
DDeno
Created by tmcw on 4/21/2023 in #help
Can I pre-cache dependencies that I specify using npm:?
Hi! Trying to figure out the right way to combine Deno's module support to make our deploys consistent. In particular, I was using esm.sh URLs, but just hit some CDN errors so that made me switch to npm: in hopes of it being more reliable. But afaict deno vendor doesn't vendor npm dependencies? What's the right combination of things to do to deploy reliably?
21 replies
DTDrizzle Team
Created by tmcw on 4/10/2023 in #help
drizzle-kit doesn't pull foreign keys from supabase/postgres?
It's hard to really turn this into a proper bug report because, honestly, with Supabase there could be many root causes, but basically, when I use drizzle-kit to introspect my Supabase setup, it works pretty well, except: 1. It doesn't include any foreign keys 2. It doesn't include anything that's in the auth schema I think #2 is a known issue? And something that I'll avoid as soon as we switch off of Supabase. But #1 might be something that's new to the drizzle team, so noting it here!
3 replies
DDeno
Created by tmcw on 3/21/2023 in #help
Using dynamic import with npm compatibility gives intermittent error "__DENO_NODE_GLOBAL_THIS_167935
This is pretty hard to google because the number at the end of the error changes everytime it happens, but basically: is this a known issue? I'll run some code (in a worker, using dynamic import pointing to npm: or a CDN and get ReferenceError: __DENO_NODE_GLOBAL_… on the first and sometimes second run, but after that it'll work.
12 replies
DDeno
Created by tmcw on 3/14/2023 in #help
Is it possible to know what version of a dynamically-imported module was just imported?
Right now, you can run code like import('npm:lodash'), which will get the latest version of lodash. Is it possible to know what version of lodash that resolved to, in the runtime or elsewhere? I suspect that it writes to an import map if there is one?
3 replies
DDeno
Created by tmcw on 3/13/2023 in #help
Should we, or how should we, use Deno as a sandbox for untrusted code?
I've been using Deno in this context because of some of the nice security model features. However, it's been tricky hitting snags with the model. For example, user's code runs in a WebWorker and has a specific environment with limited access to APIs. But there's no permission to enable/disable the creation of new Worker objects, so people can create a worker in the worker that has access to raw APIs. Is there a right way to do this?
29 replies