2 ms·
It actually depends on the page. Some pages, I don't use the SolidJS JSX, just its plain-js state primitives. For other page, I'll use full-blown SolidJS (with
by bookofcooks 1y ago
It actually depends on the page. Some pages, I don't use the SolidJS JSX, just its plain-js state primitives.
For other page, I'll use full-blown SolidJS (with JSX and everything) for like a popup. Example: https://pasteboard.co/hY35xM7VbATG.png https://pasteboard.co/hY35xM7VbATG.png
Now, how I specifically embed SolidJS, its pretty simple, I have my entrypoint files for specific pages:
assets/admin-edit-book.tsx
assets/admin-edit-song.tsx
assets/single-worship.tsx
assets/worship-edit.tsx
Then I have a 30-line build script that invokes esbuild along with esbuild-plugin-solid (to compile JSX to plain-old html, no fancy virtual dom) to compile the scripts into javascript.
I can share the build script if you'd like. It helps that SolidJS is so self-contained that it makes such a setup trivial.
- brokegrammer 1y agoSure, the build script would be insightful. Removing the virtual dom sounds cool. I've been sleeping on SolidJS because I've always stuck with React after being disappointed by other frameworks. If it allows me to keep my server rendered pages, SolidJS might be what I've been looking for.
- bookofcooks 1y agoAlright, let me know if you need any extra help. https://gist.github.com/BookOfCooks/42181c4214442144c3e4d7e5da361d66 https://gist.github.com/BookOfCooks/42181c4214442144c3e4d7e5...