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
SSolidJS
Created by oneiro on 8/3/2023 in #support
Best way to upload files from a form with solid-start?
Check this solution with fetch and TransformStream - https://stackoverflow.com/a/69400632
8 replies
SSolidJS
Created by oneiro on 8/3/2023 in #support
Best way to upload files from a form with solid-start?
dont think that's possible with the current <Form> implementatiohn
8 replies
SSolidJS
Created by oneiro on 8/3/2023 in #support
Best way to upload files from a form with solid-start?
I assume something like this should work?
import { createServerAction$, json } from 'solid-start/server';

export default function EnrollmentPage() {
const [upload, { Form }] = createServerAction$(async (form: FormData) => {
// Do something with blob
const blob = form.get('file') as Blob;

// Send blob to external API
// or save to folder

return json({ success: true });
});

return (
<Form enctype="multipart/form-data">
<input type="file" name="file" />
<button type="submit" disabled={upload.pending}>
Upload
</button>
</Form>
);
}
import { createServerAction$, json } from 'solid-start/server';

export default function EnrollmentPage() {
const [upload, { Form }] = createServerAction$(async (form: FormData) => {
// Do something with blob
const blob = form.get('file') as Blob;

// Send blob to external API
// or save to folder

return json({ success: true });
});

return (
<Form enctype="multipart/form-data">
<input type="file" name="file" />
<button type="submit" disabled={upload.pending}>
Upload
</button>
</Form>
);
}
8 replies
SSolidJS
Created by davedbase on 8/1/2023 in #support
Issue with using ApexCharts (solid-apexcharts) in Start
always! 🙂
8 replies
SSolidJS
Created by davedbase on 8/1/2023 in #support
Issue with using ApexCharts (solid-apexcharts) in Start
8 replies
SSolidJS
Created by davedbase on 8/1/2023 in #support
Issue with using ApexCharts (solid-apexcharts) in Start
Apexcharts has some weird exports, and works only when you make it a unstable_clientOnly component. Same issue here - https://github.com/wobsoriano/solid-apexcharts/issues/1
8 replies
SSolidJS
Created by davedbase on 8/1/2023 in #support
Issue with using ApexCharts (solid-apexcharts) in Start
Hey Dave, Ill take a look asap 🙂
8 replies