Skip to content

Dunify#241

Open
Julow wants to merge 10 commits intoocsigen:masterfrom
Julow:dunify
Open

Dunify#241
Julow wants to merge 10 commits intoocsigen:masterfrom
Julow:dunify

Conversation

@Julow
Copy link

@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.

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.
"dune" {>= "3.14"}
"ocaml" {>= "4.08.0"}
"js_of_ocaml" {>= "6.0.0"}
"eliom" {>= "11.0.0"}
Copy link
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
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
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
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
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
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.

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.
@balat
Copy link
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)

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