ctrl-z
ctrl-z
Explore posts from servers
SSolidJS
Created by ctrl-z on 4/25/2025 in #support
How to set route info for file routes?
In case someone else stumbles upon this and need to know: in the route file, you can export a route object like this:
import { type RouteDefinition } from "@solidjs/router"
...
export const route: RouteDefinition = {
info: {
test: "zzz",
},
}
import { type RouteDefinition } from "@solidjs/router"
...
export const route: RouteDefinition = {
info: {
test: "zzz",
},
}
Then access the info object like this
const matches = useCurrentMatches()
for (const m of matches()) {
console.log(m.route.info)
}
const matches = useCurrentMatches()
for (const m of matches()) {
console.log(m.route.info)
}
2 replies
SSolidJS
Created by Garrett Floyd on 5/8/2025 in #support
How do you trigger population of db on startup of app in SolidStart?
I currently take the local scripts approach to handle 1-off scripts like db-seeding. Basically just create a scripts dir with nodejs scripts in it and run via tsx scripts/script-name. Then it's like the above comments: just an issue of using the database.
10 replies
SSolidJS
Created by Garzec on 4/28/2025 in #support
How do Layouts work with SolidStart?
for a root layout that is applies to all routes, you should be able to wrap the line <Suspense>{props.children}</Suspense> in src/app.tsx with your layout as well.
10 replies
SSolidJS
Created by ctrl-z on 4/17/2025 in #support
Clearing form after action in solid-start
real, heavy duty usage probably would involved some form library any way
8 replies
SSolidJS
Created by ctrl-z on 4/17/2025 in #support
Clearing form after action in solid-start
thanks. yea I got something going already. Just wanted to contribute some discussion toward slightly better dx
8 replies
SSolidJS
Created by ctrl-z on 4/17/2025 in #support
Clearing form after action in solid-start
I tried out action's onComplete and feel that it may better belong with useSubmission. One reason is that having onComplete as a form clean up mechanism essentially requires it to be defined inside a component, thus the action would have to be defined inside the component as well. This makes named actions not reusable across multiple components. Also, if an action is defined inside a component, we can do whatever form clearing or visual update (displaying error messages, success messages, etc.) inside the action async. onComplete doesn't really add value. My 2 cents but I'm still new at this so there is a good chance this perspective is based on incomplete info.
8 replies
SSolidJS
Created by ctrl-z on 4/17/2025 in #support
Would this break reactivity?
thank you
5 replies
SSolidJS
Created by ctrl-z on 4/17/2025 in #support
Clearing form after action in solid-start
thank you so much for taking the time to write thoughtful responses, and with reference links!
8 replies
SSolidJS
Created by ctrl-z on 4/14/2025 in #support
Why are both class and classList needed?
ah i see. Thank you for the quick response, guys!
3 replies
CDCloudflare Developers
Created by ctrl-z on 4/12/2025 in #workers-help
how to view console.log when running via `wrangler dev --remote`
what path are you referring to? I'm currently not getting log in production either (via cf dashboard). The content of my wrangler.jsonc is this
"$schema": "node_modules/wrangler/config-schema.json",
"name": "myproject",
"compatibility_date": "2025-04-09",
"main": "./workers/app.ts",
"vars": {
"VALUE_FROM_CLOUDFLARE": "Hello from Cloudflare"
},
"observability": {
"enabled": true
},
"compatibility_flags": ["nodejs_compat"],
"browser": {
"binding": "MYBROWSER"
}
"$schema": "node_modules/wrangler/config-schema.json",
"name": "myproject",
"compatibility_date": "2025-04-09",
"main": "./workers/app.ts",
"vars": {
"VALUE_FROM_CLOUDFLARE": "Hello from Cloudflare"
},
"observability": {
"enabled": true
},
"compatibility_flags": ["nodejs_compat"],
"browser": {
"binding": "MYBROWSER"
}
I'm trying to debug issues with the browser binding
3 replies