Skip to content

Dunify#241

Merged
balat merged 15 commits intoocsigen:masterfrom
Julow:dunify
Apr 22, 2026
Merged

Dunify#241
balat merged 15 commits intoocsigen:masterfrom
Julow:dunify

Conversation

@Julow
Copy link
Copy Markdown
Contributor

@Julow Julow commented Feb 24, 2026

This switches build system to Dune. This works like with the Eliom template, except that the rule generation is extracted and tested here: https://github.com/Julow/ocsigen-dune-rules

ocsigen-dune-rules is vendored, as it's not released.

Some changes to the code are needed as code typechecks differently with eliomc than with the regular compiler and eliom.ppx. More annotation are needed but the typechecking is now also more strict in case of polymorphism. The API of some modules is changed slightly.

Comment thread ocsigen-toolkit.opam
"dune" {>= "3.14"}
"ocaml" {>= "4.08.0"}
"js_of_ocaml" {>= "6.0.0"}
"eliom" {>= "11.0.0"}
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The dependency on Eliom needs to updated with the upcoming version. This PR requires ocsigen/eliom#810

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Until the releases are available, the required pins are:

opam pin add -n eliom git+https://github.com/ocsigen/eliom#master
opam pin add -n ocsigen-ppx-rpc git+https://github.com/ocsigen/ocsigen-ppx-rpc#main
opam pin add -n ocsigenserver git+https://github.com/ocsigen/ocsigenserver#master

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.

All these projects are released

-> ?onmove:(Dom_html.touchEvent Js.t -> int -> unit) Eliom_client_value.t
-> ?onend:(Dom_html.touchEvent Js.t -> int -> unit) Eliom_client_value.t
-> 'a Eliom_content.Html.elt
-> Html_types.div_content Eliom_content.Html.elt
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I wonder if the typechecking was broken with eliomc here ?

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.

The bind function is supposed to make it possible to bind any element, so the 'a made sens

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

For some reason I was thinking that the element was inserted into a div. It's not and the type API type is reasonable.
I haven't been able to annotate the code to make this work thought.

Comment thread src/widgets/ot_carousel.eliomi
Comment thread src/widgets/ot_carousel.eliomi
@balat
Copy link
Copy Markdown
Member

balat commented Feb 26, 2026

I think this version does not install css files anymore. There was a ocsigen-toolkit.install, that should probably be removed and replaced maybe by something like:

(install
 (section share)
 (files
  (glob_files css/*.css)))

(not sure)

Julow added 12 commits April 14, 2026 16:30
This switches build system to Dune. Rules are mostly taken from the
template in eliom, modified to be easier to setup.
These changes are necessary to replace eliomc with the normal ocaml
compiler and eliom's PPX.

The API of Ot_picture_uploader, Ot_swipe, Ot_tongue and Ot_carousel
changed because it was hard to share polymorphic values across the
client and server.

In some cases, it looks like there was a bug in typechecking, for
example in Ot_tongue.

Requires Eliom to be pinned to at least 705cc199.
Included as a subtree from https://github.com/Julow/ocsigen-dune-rules
It replaces the 'gen_dune' tool and the standalone PPX definition with a
tested and reused tool.
eliom.ppx.client was ran twice.
The code contains many warnings that were supposedly enabled and treated
as error by the previous Makefile.
The polymorphic ~change argument is used in the wild.
The polymorphic argument requires explicit annotation due to how the
generated code references it.
The development version of eliom requires more recent compilers.
The version of binaryen available in ubuntu is too old and doesn't
contain wasm-merge needed by wasm_of_ocaml.
@Julow
Copy link
Copy Markdown
Contributor Author

Julow commented Apr 14, 2026

I added the install rule for the CSS and rebased. Ready for review!
The CI is now green :)

@balat balat merged commit f179e2b into ocsigen:master Apr 22, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants