Twilight
Twilight
Explore posts from servers
DDeno
Created by Twilight on 11/9/2024 in #help
Is it an expected behavior of deno when installing npm packages?
Is it an expected behavior of deno to exit early when irrelevant package for the current platform could not be found? It happened when running deno install npm:@webviewjs/webview deno exits with the following error
Add npm:@webviewjs/webview@0.1.2
error: npm package '@webviewjs/webview-freebsd-x64' does not exist.
Add npm:@webviewjs/webview@0.1.2
error: npm package '@webviewjs/webview-freebsd-x64' does not exist.
even though I'm currently not on freebsd. Both npm and bun (bun shows not found warnings for irrelevant packages) work just fine for comparison.
1 replies
SSolidJS
Created by Twilight on 5/23/2024 in #support
Universal rendering does not trigger re-render and onMount or onCleanup
I am trying to implement a custom renderer using solid-js/universal but I am not able to get onMount or onCleanup to work, and neither does setCount() re-render. here's my code:
function Component() {
const [count, setCount] = createSignal(0);

const interval = setInterval(() => {
console.log('interval', count());
setCount((prev) => prev + 1);
}, 1000);

onMount(() => {
console.log('mounted');
});

onCleanup(() => {
console.log('cleanup');
clearInterval(interval);
});

return (
<View>
<Text>{count()}</Text>
</View>
);
}

render(() => <Component />, customDom.root);

setInterval(() => {
console.log(customDom.toString());
}, 1000);
function Component() {
const [count, setCount] = createSignal(0);

const interval = setInterval(() => {
console.log('interval', count());
setCount((prev) => prev + 1);
}, 1000);

onMount(() => {
console.log('mounted');
});

onCleanup(() => {
console.log('cleanup');
clearInterval(interval);
});

return (
<View>
<Text>{count()}</Text>
</View>
);
}

render(() => <Component />, customDom.root);

setInterval(() => {
console.log(customDom.toString());
}, 1000);
7 replies