chirptune
chirptune
Explore posts from servers
SSolidJS
Created by chirptune on 10/26/2024 in #support
How to transform into getters outside of props?
When you pass a prop into a component it is transformed into a getter like <MyProp color={color()}, the props are { get color() { return color() } }. Is there a way to trigger such compile transformation for normal js code, like creating a normal object and transforming it into an object of getters?
3 replies
DDeno
Created by chirptune on 9/19/2024 in #help
How to reuse SSL session
In Ruby, you can create an openssl socket, reuse a session from another ssl socket, and then connect like this:
data_ssl_socket = OpenSSL::SSL::SSLSocket.new(data_socket, context)
# data_ssl_socket.sync_close = true
data_ssl_socket.session = ssl_socket.session
data_ssl_socket = OpenSSL::SSL::SSLSocket.new(data_socket, context)
# data_ssl_socket.sync_close = true
data_ssl_socket.session = ssl_socket.session
I have the impression that's not possible in deno right now, am I correct? I found this https://deno.com/blog/v1.7#tls-session-cache but no code showing how to use it.
4 replies
SSolidJS
Created by chirptune on 9/9/2024 in #support
How to catch all errors but keep rendered component?
In other words, how can I make the child of ErrorBoundary stay rendered and not switch to fallback? Or rather, how I can catch all errors in my solid app?
3 replies
SSolidJS
Created by chirptune on 5/17/2024 in #support
Why is solid start dev site so heavy?
I ran pnpm create solid, picked the basic template, then ran dev to encounter almost 10mb of js being loaded. I'm aware that building will minify, bundle and tree shake most of this, but building takes almost 6 seconds to build an empty app, even when building after a succesful build. Something as equally confusing is that the heaviest resource is 1.5mb of shikiji, a syntax highlighter. I found this issue, maybe related? https://github.com/solidjs/solid-start/issues/1281
4 replies
SSolidJS
Created by chirptune on 5/17/2024 in #support
Is it possible to have a nextjs-style app router?
... where (inside app/) route.ts are API calls and page.ts are pages. Is the intention to not move in that direction to clearly separate API code from client side code?
7 replies
SSolidJS
Created by chirptune on 7/31/2023 in #support
solid devtools fails with O.createRoot is not a function
The extension is version 0.27.5 My deps are:
"solid-devtools": "^0.27.5",
"solid-js": "^1.7.0",
"solid-devtools": "^0.27.5",
"solid-js": "^1.7.0",
Error is:
debugger.ts-92f4bae0.js:1 Uncaught TypeError: O.createRoot is not a function
at Hn (debugger.ts-92f4bae0.js:1:6771)
at debugger.ts-92f4bae0.js:64:12559
debugger.ts-92f4bae0.js:1 Uncaught TypeError: O.createRoot is not a function
at Hn (debugger.ts-92f4bae0.js:1:6771)
at debugger.ts-92f4bae0.js:64:12559
12 replies
TtRPC
Created by chirptune on 4/18/2023 in #❓-help
Why am I seeing 500 errors on responses to clients in production?
I'm running my trpc server with NODE_ENV=production with the expressjs adapter, and I'm getting this in the response of a client. [{"error":{"message":"connect ECONNREFUSED 127.0.0.1:5432","code":-32603,"data":{"code":"INTERNAL_SERVER_ERROR","httpStatus":500,"path":"budget"}}}] I would expected the message to not show up, and just give a generic error message. Why don't these errors get written to stdout by default instead? Or maybe I don't have it setup correctly?
14 replies
SSolidJS
Created by chirptune on 4/11/2023 in #support
How to have reactive getters on each element?
Let's say I have a createStore, and I want each element to have a getter, how should I go about this? I asked chat gpt, and he proposed this.
const [state, setState] = createStore([
{ name: 'John', age: 30 },
{ name: 'Mary', age: 25 },
{ name: 'Bob', age: 40 },
]);

const filteredState = createComputed(() =>
state.map((item) => ({
...item,
get filteredName() {
return item.name.toLowerCase().startsWith(nameFilter().toLowerCase());
},
}))
);
const [state, setState] = createStore([
{ name: 'John', age: 30 },
{ name: 'Mary', age: 25 },
{ name: 'Bob', age: 40 },
]);

const filteredState = createComputed(() =>
state.map((item) => ({
...item,
get filteredName() {
return item.name.toLowerCase().startsWith(nameFilter().toLowerCase());
},
}))
);
I think this looks ok enough, do you guys agree? Is there an alternative that lets you include getters right into the data I pass to createStore?
5 replies