oke
oke
Explore posts from servers
DTDrizzle Team
Created by fossfighter on 2/28/2025 in #help
Turso drizzle-kit CLI: Passing dbCredentials via CLI options
If it's an environment variable, maybe you can just pass in directly into the command ?
TURSO_DATABASE_URL=abc... npm run dev
TURSO_DATABASE_URL=abc... npm run dev
Or create a .env file and use source to source the envs
2 replies
DTDrizzle Team
Created by claudiu on 2/28/2025 in #help
Migration failed, and can't add new migration
Since the migration failed, I think you should run drizzle-kit drop and drop the last two migrations concerning this label column, then re-generate migration again
3 replies
DTDrizzle Team
Created by tltl on 2/18/2025 in #help
How to fix TypeError: Cannot read properties of undefined (reading 'columns')?
Do you have reproduction steps? Could you isolate which line of code caused this issue? Maybe provide a minimal reproduction repository ?
2 replies
CDCloudflare Developers
Created by oke on 2/18/2025 in #pages-help
Cannot see "Build Configuration" option for Pages project on dashboard
Therefore, no Github connection was made. The project counts as a "file upload deploy" and thus the build options were irrelevant.
3 replies
CDCloudflare Developers
Created by oke on 2/18/2025 in #pages-help
Cannot see "Build Configuration" option for Pages project on dashboard
Okay I found out why. This is because I "mistakenly" deployed this project using the wranger pages deploy CLI command
3 replies
SSolidJS
Created by oke on 2/11/2025 in #support
SSG isn't truly static
I finally succeed. Thanks to the amazing Solidjs community for esbuild-solid-plugin Thanks Brendon a lot too to help me realize the only ways forward and not mess around with non-working ways
20 replies
SSolidJS
Created by oke on 2/11/2025 in #support
SSG isn't truly static
You'd somehow need to get Vite to transform the email code at build time, and then run it at build time, so you could put the result in a virtual module
I might need to actually need to whip up a manual esbuild pipeline to do this. If only I could re-use the esbuild pipeline that Vite/Vinxi/SolidStart is already using. We'll see if this is enough; seems like SolidStart also employs Babel for its processing
20 replies
SSolidJS
Created by oke on 2/11/2025 in #support
SSG isn't truly static
the renderToString call on the server during prerendering and on the client after a navigation
Yeah that's the current implementation, using a server function. Only issue is every time someone visits the page, the processing (importing component and calling renderToString ) is called again --> problem is potentially further exacerbated by serverless cold start
20 replies
SSolidJS
Created by oke on 2/11/2025 in #support
SSG isn't truly static
That's okay. The components Button, Container, Row, Column have been developed to be email-friendly. They are not simple <button> or <div> but a bunch of <table> and <td> under the hood Only thing I want is to be to build those emails once to produce the HTML of each email I could make an API route GET /build_emails --> that calls the renderToString functions on all the JSX Email Templates, and produce a static JSON file that SolidStart can import. --> Then make a Vite plugin so that every time the email_templates folder changes, the plugin re-fetch this API route But that feels like a hack. Also wouldn't work at build time (since at build time there is no server running to serve the GET /build_emails URL). If somehow I could use renderToString and make Vite understands SolidJS JSX in a build process
20 replies
SSolidJS
Created by oke on 2/11/2025 in #support
SSG isn't truly static
In a way I suppose, but I don't think it's an npm package. It's definitely not intended to be customizable after build time. The user story is: A developer uses components like Button, Container, Row, Column to build out Solid-JSX-based email templates --> Then they use SolidStart to build out an Admin Dashboard that have route /email_content/[template_name] that displays the HTML result of these templates so that Marketing can copy the HTML and send them to people I hope I make sense
20 replies
SSolidJS
Created by oke on 2/11/2025 in #support
SSG isn't truly static
so that developers build emails using JSX components inside an email_templates folder, then all the HTML are rendered out one-time during build, and then embed that HTML onto the /email_content url and users of the app can just copy the generated HTML via the web interface.
20 replies
SSolidJS
Created by oke on 2/11/2025 in #support
SSG isn't truly static
Thanks for the info. That's good to know. I have tried to develop a Vite plugin to do my processing, but I want to call renderToString on imported SolidJS components (I'm developing an Solidjs email template solution), and I can't seem to do that with a Vite plugin via buildStart hook. I deduced that my Vite plugin runs before the SolidJS plugin/compiler/JSX runtime kicks in. import.meta.glob doesn't work in Vite plugin; and if I use dynamic await import, when I import the TSX file in my Vite plugin, it calls to React.createElement ???
20 replies
SSolidJS
Created by oke on 2/11/2025 in #support
SSG isn't truly static
Is that okay to do inside the component too?
20 replies
SSolidJS
Created by oke on 2/11/2025 in #support
SSG isn't truly static
The random number is just an example. It could stand for anything - like calling database to get some fixed build-time config data, reading from the files system
20 replies
SSolidJS
Created by oke on 2/11/2025 in #support
SSG isn't truly static
Example RandomPage component
// src/routes/(layout)/random.tsx
import { createAsync, query } from '@solidjs/router'

const randomNum = query(async () => {
'use server'
const n = Math.random()
console.log('RANDOM HIT', n)
return n
}, 'random-num')

export default function RandomPage() {
const ranNum = createAsync(() => randomNum())
return <p>{ranNum() || 'undefined'}</p>
}
// src/routes/(layout)/random.tsx
import { createAsync, query } from '@solidjs/router'

const randomNum = query(async () => {
'use server'
const n = Math.random()
console.log('RANDOM HIT', n)
return n
}, 'random-num')

export default function RandomPage() {
const ranNum = createAsync(() => randomNum())
return <p>{ranNum() || 'undefined'}</p>
}
Maybe I missed some steps to make SSG truly work. Or it SSG not possible for only part of an application ?
20 replies