Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,844 changes: 0 additions & 1,844 deletions templates/rescript-template-xote-ssr/package-lock.json

This file was deleted.

3 changes: 1 addition & 2 deletions templates/rescript-template-xote-ssr/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
"build:ssr": "vite build --ssr src/Server.res.mjs --outDir dist/server"
},
"dependencies": {
"rescript-signals": "^3.1.0",
"xote": "^6.2.0"
"xote": "^7.1.0"
Comment thread
fhammerschmidt marked this conversation as resolved.
},
"devDependencies": {
"@tailwindcss/vite": "^4.0.0",
Expand Down
1 change: 1 addition & 0 deletions templates/rescript-template-xote-ssr/rescript.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@
"version": 4,
"module": "XoteJSX"
},
"ppx-flags": ["xote/ppx/ppx"],
"compiler-flags": ["-open Xote"]
}
8 changes: 4 additions & 4 deletions templates/rescript-template-xote-ssr/src/Counter.res
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@jsx.component
@xote.component
let make = () => {
let count = SSRState.signal("count", 0, SSRState.Codec.int)

Expand All @@ -9,15 +9,15 @@ let make = () => {
<button
class="px-3 py-1 rounded bg-slate-900 text-white hover:bg-slate-700" onClick={decrement}
>
{View.text("-")}
{"-"}
</button>
<span class="font-mono text-xl tabular-nums">
{View.signalText(() => Signal.get(count)->Int.toString)}
{Signal.get(count)}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sooo nice!

</span>
<button
class="px-3 py-1 rounded bg-slate-900 text-white hover:bg-slate-700" onClick={increment}
>
{View.text("+")}
{"+"}
</button>
</div>
}
26 changes: 12 additions & 14 deletions templates/rescript-template-xote-ssr/src/Page.res
Original file line number Diff line number Diff line change
@@ -1,40 +1,38 @@
@jsx.component
@xote.component
let make = () => {
<main class="min-h-screen bg-slate-50 text-slate-900 flex items-center justify-center p-6">
<div
class="max-w-2xl w-full bg-white rounded-2xl shadow-sm border border-slate-200 p-8 space-y-8"
>
<header class="space-y-2">
<p class="text-xs uppercase tracking-widest text-slate-500">
{View.text("xote · ssr template")}
{"xote · ssr template"}
</p>
<h1 class="text-3xl font-semibold"> {View.text("Welcome to xote")} </h1>
<h1 class="text-3xl font-semibold"> {"Welcome to xote"} </h1>
<p class="text-slate-600">
{View.text(
"A clean slate for building reactive UIs in ReScript, rendered on the server and hydrated on the client.",
)}
{"A clean slate for building reactive UIs in ReScript, rendered on the server and hydrated on the client."}
</p>
</header>
<section class="space-y-2">
<h2 class="text-sm font-medium text-slate-700"> {View.text("Tech stack")} </h2>
<h2 class="text-sm font-medium text-slate-700"> {"Tech stack"} </h2>
<ul class="text-sm text-slate-600 space-y-1 list-disc pl-5">
<li> {View.text("ReScript v12 — typed language compiling to clean JavaScript")} </li>
<li> {View.text("xote — fine-grained reactivity with SSR + hydration")} </li>
<li> {View.text("Vite 7 — dev server (middleware mode) and bundler")} </li>
<li> {View.text("Tailwind CSS v4 — utility-first, CSS-first config")} </li>
<li> {"ReScript v12 — typed language compiling to clean JavaScript"} </li>
<li> {"xote — fine-grained reactivity with SSR + hydration"} </li>
<li> {"Vite 7 — dev server (middleware mode) and bundler"} </li>
<li> {"Tailwind CSS v4 — utility-first, CSS-first config"} </li>
</ul>
</section>
<section class="space-y-2">
<h2 class="text-sm font-medium text-slate-700"> {View.text("Reactive counter demo")} </h2>
<h2 class="text-sm font-medium text-slate-700"> {"Reactive counter demo"} </h2>
<div class="border border-slate-200 rounded-lg">
<Counter />
</div>
<p class="text-xs text-slate-500">
{View.text("State is rendered on the server and survives hydration via SSRState.")}
{"State is rendered on the server and survives hydration via SSRState."}
</p>
</section>
<footer class="text-xs text-slate-500">
{View.text("Edit src/Page.res and src/Counter.res to start building.")}
{"Edit src/Page.res and src/Counter.res to start building."}
</footer>
</div>
</main>
Expand Down
Loading
Loading