Skip to content

Commit

Permalink
Deploying to gh-pages from @ 7895324 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
balat committed Mar 8, 2024
1 parent 6ce83ba commit 899924e
Show file tree
Hide file tree
Showing 6 changed files with 226 additions and 180 deletions.
2 changes: 1 addition & 1 deletion 7.1/manual/basics-server.html
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
</p><p>Module <span class="teletype">Eliom_registration.Html_text</span> is used to register a service sending
HTML as strings. But we recommend to used typed-HTML instead (see below).</p></section><section class="docblock"><header><h2>Compiling</h2></header><p>Eliom provides an helper program called <span class="teletype">eliom-distillery</span> to create your projects easily, with the right dune configuration and all default directories you usually need for a Web application (static files, server logs, database, etc.). We will show how to use eliom-distillery in another section below.
</p><p>In this section, we will show how to compile and run a <em>server-side only</em> Web site by creating your project manually.
</p><pre>opam install eliom
</p><pre>opam install ocsipersist-sqlite eliom
dune init proj --kind=lib mysite
cd mysite
</pre><p>Add <span class="teletype">(libraries eliom.server)</span> into file <span class="teletype">lib/dune</span>, in the library section.
Expand Down
11 changes: 5 additions & 6 deletions 7.1/manual/basics.html
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@
[&quot;dir&quot; ; &quot;image.jpg&quot;])
()</code></pre></section><section class="docblock"><header><h2>Compiling</h2></header><p>Eliom provides an helper program called <span class="teletype">eliom-distillery</span> to create your projects easily, with the right dune configuration and all default directories you usually need for a Web application (static files, server logs, database, etc.). We will show how to use eliom-distillery in another section below.
</p><p>In this section, we will show how to compile and run a <em>server-side only</em> Web site by creating your project manually.
</p><pre>opam install eliom
</p><pre>opam install ocsipersist-sqlite eliom
dune init proj --kind=lib mysite
cd mysite
</pre><p>Add <span class="teletype">(libraries eliom.server)</span> into file <span class="teletype">lib/dune</span>, in the library section.
Expand Down Expand Up @@ -359,12 +359,9 @@
Type annotation is almost always required.
</p><p>These client fragments can be manipulated as server side OCaml values:
</p><pre class="server" class=""><code class="language-ocaml translatable">let%server x : int Eliom_client_value.t = [%client 1 + 3 ]</code></pre><p>If such section is reached while generating a page on server side,
the client-side code will be executed once the page is displayed.
the client-side code will be executed when the page is displayed.
</p><p>If such section is reached while generating a page on client side,
the client-side code will be executed immediately
(In that case, you can delay the execution, if needed,
for example with function
<span><a href=".././../../ocsigen-toolkit/latest/api/client/Ot_nodeready#VALnodeready">Ot_nodeready.nodeready</a></span> to wait for the element to be actually displayed).
</p><p>If such section is reached during module initialization on the server
(global client section), it will be executed on client side everytime
a new client side program is launched.
Expand Down Expand Up @@ -396,7 +393,9 @@
</li><li> then the user clicks on a link in the page, and the page is generated by the client-side program (because the service is registered on both sides). In this example, while generating the page, the client does a RPC to the server.
</li></ul><p>In both cases (first request or RPC), the server returns the expected value, but also the value of injections and an order for the client-side program to execute the client-values met during te server-side computation.
</p><p class="centered"><img src="files/tutorial/client-server-req.svg" alt="Example of requests" class="img-col-width-400"/>
</p><p>Tip: You can avoid waiting for the RPC to return by using a spinner from Ocsigen Toolkit. Thus, the client-side generated page will be displayed without delay.
</p><p>Tip 1: You can avoid waiting for the RPC to return by using a spinner from Ocsigen Toolkit (see module <span><a href=".././../../ocsigen-toolkit/latest/api/server/Ot_spinner">Ot_spinner</a></span>). Thus, the client-side generated page will be displayed without delay.
</p><p>Tip 2: To delay the execution of a client fragment after the page is actually displayed, you might want to use function
<span><a href=".././../../ocsigen-toolkit/latest/api/client/Ot_nodeready#VALnodeready">Ot_nodeready.nodeready</a></span> from Ocsigen Toolkit.
</p><p>Regardless of the construction used and their combination, there is
only one communication from server to client, when the Web page is
sent. This is due to the fact that client values are not executed
Expand Down
Loading

0 comments on commit 899924e

Please sign in to comment.