Blankeos
Explore posts from serversHave you guys ever gotten websockets to work on Hono + `@hono/vite-dev-server` plugin?
This occurs for Bun and Node.
1. On Bun, I can serve websockets using
import { createBunWebSocket } from 'hono/bun';
https://github.com/honojs/vite-plugins/issues/148
2. On Node, I can serve websockets using ws
and import { serve } from '@hono/node-server'
__
But the issues are:
1. On Bun, the websocket handler gets stuck. No idea why: https://github.com/honojs/vite-plugins/issues/140. Had some hypothesis that it conflicts with vite, but not too sure.
2. On Node, I can't even run the websocket handler because the mechanism is completely different when running it in dev. In particular, you'd have to get the server first, then attach it there.5 replies
Is there a way to hydrate signals on the server?
I have an AuthContext. I just specifically want to hydrate my
user
signal in some routes. Is there a way to do this?
As far as I know, even in React I can't do this unless I bring in a separate library. Jotai actually does this using useHydrateAtoms
. I'm wondering if there's something similar in SolidJS that I can use? (Not Solid Start specific).
https://jotai.org/docs/utilities/ssr
2 replies
<Show /> vs React-style conditional rendering.
I'm trying to implement a long conditional rendeirng statement in React into Show. It ends up pretty buggy. I just copied the React conditional statement and it seems to just work no problem.
Are there any disadvantages to this?
By the way this solid port project is @wobsoriano 's port of Sonner.
I'm just fixing bugs haha
7 replies
Filter and <For each />
Just a question, is there anything wrong with using
.filter
with For each={} />
Like:
I'm wondering if this causes issues when toasts() is an array that sort of reorders.
Like if toasts()
were a queue that removes the first element every few seconds, will SolidJS know to reuse the 2nd element in place of the removed 1st element?
Visually:
[1st Element, 2nd Element, 3rd Element]
⬇️
[2nd Element, 3rd Element]
------
Another is if 2nd Element just changes something within it like:
[2nd Element.loading, 3rd Element]
⬇️
[2nd Element.success, 3rd Element]
In this case, will SolidJS unmount the 2nd element, and then remount it? (when filter is involved)26 replies
Does the Solid compiler convert JSX to template variables? Know anything about this issue here?
Hi y'all! Does the Solid compiler have anything to do with converting JSX to a template variable in JS?
var _tmpl$ = template(...)
?
This library I'm using seems to be facing an issue where when it's deployed to npm, it loses the quotes in the template. For instance:
<div class="sonner-loading"/>
becomes div class=sonner-loading/>
But locally, it's actually fine after doing pnpm run build
Most of my investigation was diffing, but I honestly can't pinpoint what's causing this issue:
https://github.com/wobsoriano/solid-sonner/issues/144 replies
Proper error logging and tracing?
Do you guys have an example repo that properly sets up error logs and trace?
It seems too difficult to trace here (in the image). As you can see it only traces back to the library-code that threw the error.
I kinda have to to manually trace which function actually threw that error in my code. Which was around here:
2 replies
When there's an error on my typescript code on Hono, Vite Dev Server crashes, and doesn't restart
Problem:
- Error? Crash the dev server and not wait for file changes.
Ideal experience:
- Error? Say it's an error and wait for file changes.
It kinda feels iffy that I need to run
npm run dev
again just to run the dev server. Any fixes for this or maybe just something I missed?
My config looks like this:
2 replies
TTCTheo's Typesafe Cult
•Created by Blankeos on 11/14/2023 in #questions
Copilot account question
Hey y'all ! Anyone using copilot? Planning to buy one for my Work Account. (personal expense)
But I don't wanna buy another subscription for my personal account. Since I pay for it, is there way I can share them?
Or at least, maybe use the same Work Account on my PC, then change to my personal account when I have to make commits and hopefully not worry about my company finding out I'm using my Work account outside of work.
More or less my company's probably okay with it but I just don't wanna leave any unnecessary footprint (If copilot does any).
7 replies
TTCTheo's Typesafe Cult
•Created by Blankeos on 6/22/2023 in #questions
Is there a way to use the trpc client inside a useEffect? Or a separate "service".
I've been using trpc for quite a while now. I have a pretty simple data flow that seems overly complicated to implement in trpc.
In my website, when you go to
"mywebsite.com/local"
I want to fetch from local storage,
but when you got to mywebsite.com/<anythingelse>
I want to fetch from a trpc API.
I don't feel too comfortable just using tanstack react query on everything inside a monolithic react component. Or is it something I should be more comfortable about. I'm also thinking of using the vanilla trpc client.18 replies