wobsoriano
wobsoriano
DDeno
Created by TheSadMidDeveloper on 9/30/2024 in #help
How to load islands in Fresh 2.0 plugins?
If you pass a URL, it'll get the href here - https://github.com/denoland/fresh/blob/e0f65319cd48753f5b9b4784f996a0eaf7e6ebff/src/app.ts#L87 Would love to contribute if we want to use pathname in that specific line instead
15 replies
DDeno
Created by TheSadMidDeveloper on 9/30/2024 in #help
How to load islands in Fresh 2.0 plugins?
Just ran into the same issue. What worked for me is passing pathname instead of a URL class
const url = new URL('./components/islands.ts', import.meta.url)

app.island(url.pathname, 'SignInButton', SignInButton)
app.island(url.pathname, 'SignOutButton', SignOutButton)
const url = new URL('./components/islands.ts', import.meta.url)

app.island(url.pathname, 'SignInButton', SignInButton)
app.island(url.pathname, 'SignOutButton', SignOutButton)
15 replies
DDeno
Created by Ed, Edd n Eddy on 8/13/2023 in #help
Migrating `Deno.run` to `Deno.command` with `readlines`
Hey @ededdneddy9188, do you have an example of your conversion of this? I tried this but it exits immediately https://discord.com/channels/684898665143206084/1131635673217118248/1149868174678958110
21 replies
DDeno
Created by Kay on 7/20/2023 in #help
Log Deno.command process output
I tried this but it exits immediately
this._process = new Deno.Command(Deno.execPath(), {
args: cmd,
stdin: 'piped',
stderr: 'piped',
stdout: 'piped',
})

const child = this._process.spawn();

const stdout = readerFromStreamReader(child.stdout.getReader());
const stderr = readerFromStreamReader(child.stderr.getReader());
for await (const line of readLines(stdout)) {
if (line.trim()) this.emit('data', line);
}

// exits
this._process = new Deno.Command(Deno.execPath(), {
args: cmd,
stdin: 'piped',
stderr: 'piped',
stdout: 'piped',
})

const child = this._process.spawn();

const stdout = readerFromStreamReader(child.stdout.getReader());
const stderr = readerFromStreamReader(child.stderr.getReader());
for await (const line of readLines(stdout)) {
if (line.trim()) this.emit('data', line);
}

// exits
5 replies
DDeno
Created by Kay on 7/20/2023 in #help
Log Deno.command process output
hey @kaytitulaer3820, do you have an example of how you converted this code with new functions?
for await (const line of readLines(process.stdout)) {
emit_console_out(line);
}
for await (const line of readLines(process.stdout)) {
emit_console_out(line);
}
5 replies