Fresh pattern help
Could anyone possibly help guide me to understand the 'freshest' pattern for the following, please?
When a user hits
/ I load a login page, and once he submits the form, the server generates some session data in the POST handler for /, and then redirects(send back a 303) to /chat. There is an island on /chat which needs to contain the session data. How would I redirect from the form POST handler, to the /chat page and make sure that my state is passed to the island?
In react or similar I would handle the 'form submission' in javascript and cache the returned session data before redirecting to /chat. Since fresh seems to promote the use of native forms I'm trying to learn how I would handle this situation. I'm thinking of setting a cookie in the redirect, to then be sent with the /chat GET, which I can use to return the page with session data inside. Is that common? Thanks!...Deno seems to assume wrong return type (Puppeteer)
With the following code, I get an type error which I do not expect:
```ts
const element: ElementHandle | null = await page.$('span.label-status');
const shouldBeString: string = await element?.$eval('a', (el): string => el.innerText);...
Creating my first Deno module
Have never published to NPM or Denoland before, so I'm having some problems figuring shit out. I'm gonna use this forum to dump my issues in case someone has gone through this process before and is willing to give a bit of their time to help me get unstuck.
Sanitize multiple test steps
Is it possible to sanitize multiple steps inside of one test.
I want to test my DB with somthing like this:
```
test('db', {permissions:{net:true,env:true},sanitizeOps:false,sanitizeResources:false}, async t=>{
await testDB(async sql => {...
FFI string corrupted?
Is there anything i'm doing wrong here? I'm confused on why it's crashing on setVerisonUE5 in particular. The code without FFI in C++ works fine
```ts
import { Dataminer } from "./mod.ts";
Dataminer.withLogs(true);...
Typescript Conditional Type Returns
I don't know why but this conditional type return is just causing me grief.
```ts
type InnerType<T> = T extends Promise<infer U> ? U : never;
export function CaptureErr<...
Parsing Hostname for TLD, domain name, and SLD
does anyone know of any packages to parse a URL's hostname for the top level domain, domain name, and sublevel domains? I found one, but it actually just doesn't work. It just errors saying the label is too short for everything I give it. https://github.com/lupomontero/psl
Migrating large Node project to Deno
Is there any reliable way to migrate a Node project to Deno? Currently working on a large project that is in dependency purgatory and am sweet talking the team into Deno, but they don't want to have to rewrite everything. It has gulp and workbox as well which are essentials. It has a lot of weird Node quirks which I'd like to remove completely if we switch over
Globally import files for Deno subcommands
I’ve looked at Deno docs and searched online to no avail for this answer. Is there a capability in Deno similar to
node -r <packageOrFilepath> or some other ability to globally import one or more files for the whole script lifetime? For a concrete example, how would I load a polyfill for a global method to be present in my application code and again for individual test files to ensure the polyfilled method is always available?Changing GitHub username – what about deno.land/x?
If I change my GitHub username and I have a couple of modules on deno.land/x, what will happen to those modules exactly?
Passing initial data to Worker
Detault
Worker doesnt seem to support WorkerData as params. Although using node:worker_threads doesnt work well in ts as it does not allow import statements outside a moduleHow do I enqueue_microtask from other thread
so
Isolate.enqueue_microtask is obviously not send/sync so I think the only option is to use std::sync::mpsc::channel and use Receiver.try_recv to get the values from Sender on other thread. The problem is that I am being a rust newbie don't know how to combine them on the single thread or if it actually possible. I somehow need to wake up the runtime when the Sender actually sends the value, I think I can wrap try_recv with poll_fn and use something like tokio's select! macro...Can't connect to http server on official alpine deno with std serve.
I'm using the official alpine docker container to run deno, listening on port 8080, but a simple curl to it and I can't connect. Seems like it isn't listening at all. Deno server shows no error.
```
Use the official Deno Docker image with version 1.32.0
FROM denoland/deno:alpine-1.32.0
...
calling a javascript function and waiting for the promise with `rusty_v8`
```rust
let result = function.call(scope, recv, &[]).expect("couldnt run");
/*i got this result which is a promise. now how do i get the value of the promise
let value = ??...
Deno KV: subtract with `sum` operation?
If I do
.sum([key], 1n) the value is increased by 1. How can I decrease it? I tried .sum([key], -1n) but it doesn't work.
