Skip to content

Commit

Permalink
rewrite demo names for files
Browse files Browse the repository at this point in the history
  • Loading branch information
davesnx committed Jan 16, 2025
1 parent 379ae13 commit 6005c63
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 17 deletions.
6 changes: 3 additions & 3 deletions demo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
From the root of the project, run

```bash
# 1 terminal with `make build-demo-watch` to compile the code
make build-demo-watch
# 2 terminal with `make demo-watch` to serve the demo
# 1 terminal to compile the code
make demo-build-watch
# 2 terminal to run the server
make demo-serve-watch
```

Expand Down
File renamed without changes.
26 changes: 13 additions & 13 deletions demo/client/dune
Original file line number Diff line number Diff line change
@@ -1,50 +1,50 @@
(melange.emit
(enabled_if
(= %{profile} "dev"))
(alias melange-app)
(target app)
(modules index)
(libraries melange demo_shared_js reason-react melange.dom melange-webapi)
(preprocess
(pps browser_ppx -js reason-react-ppx melange.ppx))
(module_systems
(es6 js))
(enabled_if
(= %{profile} "dev")))
(es6 js)))

(rule
(enabled_if
(= %{profile} "dev"))
(alias client)
(deps
(alias_rec melange-app)
(:script build.mjs))
(target app.js)
(action
(progn
(run node %{script} app/demo/client/index.js %{target})))
(enabled_if
(= %{profile} "dev")))
(run node %{script} app/demo/client/index.js %{target}))))

(rule
(enabled_if
(= %{profile} "dev"))
(alias client)
(deps
(alias_rec melange-app)
(:input create-from-fetch.jsx)
(:script build.mjs))
(action
(progn
(run node %{script} %{input} "app/demo/client/")))
(enabled_if
(= %{profile} "dev")))
(run node %{script} %{input} "app/demo/client/"))))

(rule
(enabled_if
(= %{profile} "dev"))
(alias client)
(target bootstrap.js)
(deps
(alias_rec melange-app)
(:input runtime-with-client.jsx)
(:input create-from-readable-stream.jsx)
(:script build.mjs)
(:extract %{bin:server_reason_react.extract_client_components}))
(action
(progn
(run %{extract} app --out %{target})
(run node %{script} %{input} "app/demo/client/")))
(enabled_if
(= %{profile} "dev")))
(run node %{script} %{input} "app/demo/client/"))))
5 changes: 4 additions & 1 deletion demo/server/server.re
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,10 @@ let serverComponentsHandler = request => {
Html.node(
"script",
[
Html.attribute("src", "/static/demo/client/runtime-with-client.js"),
Html.attribute(
"src",
"/static/demo/client/create-from-readable-stream.js",
),
Html.attribute("async", "true"),
Html.attribute("type", "module"),
],
Expand Down

0 comments on commit 6005c63

Please sign in to comment.