Conversation
1 task
balat
force-pushed
the
modernize
branch
2 times, most recently
from
May 29, 2026 17:06
03c3848 to
8ef4365
Compare
js_of_ocaml must not be a runtime dependency of the server library, only a compile-time include for type definitions. Otherwise, loading the library via Dynlink (ocsigenserver in lib mode) fails with "Unimplemented Javascript primitive caml_pure_js_expr". Use -I include flags (via type_includes) instead of libraries, like Eliom does.
Update all references from old Eliom_xxx names to new wrapped names: - Eliom_service -> Eliom.Service - Eliom_content -> Eliom.Content - Eliom_registration -> Eliom.Registration - Eliom_parameter -> Eliom.Parameter - Eliom_client -> Eliom.Client - Eliom_config -> Eliom.Config - Eliom_reference -> Eliom.Reference - Eliom_state -> Eliom.State - Eliom_shared -> Eliom.Shared - Eliom_bus -> Eliom.Bus - Eliom_comet -> Eliom.Comet - Eliom_notif -> Eliom.Notif - Eliom_request_info -> Eliom.Request_info - Eliom_tools -> Eliom.Tools - Eliom_cscache -> Eliom.Cscache - Eliom.run -> Eliom.App.run
Ot_form -> Ot.Form, Ot_popup -> Ot.Popup, Ot_icons -> Ot.Icons, etc.
Drop the [Os_] prefix from all source files and all internal references (Os_session -> Session, Os_user -> User, etc.). The modules become accessible to users as [Os.Session], [Os.User], ... via dune's wrapping.
Sync the bundled distillery template with the os_template repository (via the rename script).
Place all module sources in [src/Os/] and use dune's standard [(include_subdirs qualified)] + [(wrapped false)] to expose them under the [Os.] namespace. Split client side into a separate [src/client/dune] with [(include dune.client)] + [(mode promote)]. The dune.client generation rule passes [--server-objs-dir] to ocsigen-dune-rules so [-server-cmo] resolves unambiguously to the server lib's [.cmo].
Use the installed version from opam instead. Add ocsigen-dune-rules dependency
The migrate-to-Eliom.Xxx and ocsigenserver wrapping commits depend on eliom 13. Use [>= "13.0~"] (not [>= "13.0.0"]) so opam also accepts the pre-release [13.0~dev] version shipped by the eliom modernize branch (in opam semver, [13.0~dev < 13.0.0]). Cap at [< 14.0.0] so CI does not try to build against future eliom majors that may break this.
Ocsigen_config -> Ocsigen.Config Ocsigen_extensions -> Ocsigen.Extensions Ocsigen_lib -> Ocsigen_base.Lib Ocsigen_stream -> Ocsigen_base.Ocsigen_stream
Bundled CSS files for toolkit widgets (ot_buttons, ot_carousel, ot_datetime, ot_drawer, ot_form, ot_icons, ot_page_transition, ot_picture_uploader, ot_popup, ot_spinner, ot_sticky, ot_tongue), default CSS, wasm_loader.js, and npm metadata (package.json, package-lock.json).
Provides old Os_xxx module names as aliases to new Os.Xxx modules to ease migration of existing code.
Apply the same change as in os_template upstream: PROJECT_NAME_icons.eliom's [Make] functor now takes [Eliom.Content.Html.T] as parameter, replacing the local ad-hoc ICON_HTML signature.
Use the standard dune install pattern:
(install
(package ocsigen-start)
(section lib_root)
(files
(glob_files_rec
(template.distillery/* with_prefix eliom/templates/os))))
so eliom-distillery picks up the os template at the conventional
[lib/eliom/templates/os/] location. The template source directory
is named [template.distillery/], and the installed name is [os].
Update src/client/dune to invoke [ocsigen-dune-rules gen ...] using
the new sub-command syntax.
Module namespace migration to Os.Xxx, ocsigen-start-compat package, PROJECT_NAME_icons on Eliom.Content.Html.T, template renamed to os and installed at lib/eliom/templates/os/, migration to Eliom 13 + wrapped ocsigenserver names. Major version bump (9.0.0~dev) for the module renames.
build/gen_wikidoc.sh runs eliomdoc with the wikidoc plugin against the
modernize layout's wrapped Os.* modules in src/Os/, producing .wiki
files in _build/doc/dev/api/{server,client}/.
The script handles the strengthening of wrapped module names by
generating short-name [include Os__X] aliases in a temporary directory
before invoking eliomdoc, so that doc cross-references like [Session.X]
resolve correctly.
The output is meant to be committed on the wikidoc branch under
doc/dev/api/. The README is updated to point to the script.
The wikidoc plugin generates menu.wiki from the structure of the ocamldoc -intro file. doc/server.indexdoc and doc/client.indexdoc group the Os.* modules by topic (User management, Persistence, Notifications, ...) so the website navigation reflects that grouping instead of being a flat list. The script also stops feeding .mli files to the client-side generation: those files declare server-only modules and would otherwise produce client docs for modules that don't exist on the client side.
Replaces the previous print-only stub (left when the OCamlnet
implementation was removed for OCaml 5 compatibility) with one that
pipes an RFC-2822 message to the configured mailer ("sendmail" by
default) via Lwt_process.
When the mailer is not on PATH, the email is dumped to stderr through
Logs.warn instead of failing, so applications remain usable out of
the box without configuring an MTA.
Drops the now-unused Invalid_mailer exception.
Use the installed version from opam instead. Add ocsigen-dune-rules dependency
Ocsigen_config -> Ocsigen.Config Ocsigen_extensions -> Ocsigen.Extensions Ocsigen_lib -> Ocsigen_base.Lib Ocsigen_stream -> Ocsigen_base.Ocsigen_stream
Provides old Os_xxx module names as aliases to new Os.Xxx modules to ease migration of existing code.
index.mld already is the package home page (it introduces Ocsigen Start and links to the introduction and the API). Add @children_order so the introduction comes before the API modules in the ocaml.org sidebar, point the ocsigen.org landing at the home page, and drop the now-redundant "Overview" navigation entry (the home page is the landing).
Follow-up to #712: index.mld (a short home page) and intro.mld (demo, getting started, implementation and library overview) overlapped. Fold the introduction's content into index.mld so there is a single home page, and drop intro.mld and its navigation entry.
Bring the deriving branch in line with master: convert the relative ../<project> links to odoc cross-package references (quoting hyphenated page names) and normalise the demo and tutorial links to full https URLs, matching master so a future merge does not reintroduce the old links.
The screenshots used the wiki-image markup {{files/…png|Ocsigen Start}}, which
odoc rejects ("bad markup") and renders broken. Master uses {%wodoc:img src=…
alt=…%}; the #713 merge carried this branch's older intro markup into index.mld.
Convert to the same wodoc image markup as master.
The API docs are now built with odoc/wodoc (see doc/wodoc and the Documentation CI workflow); the gen_wikidoc.sh eliomdoc->wiki script and the README section are no longer used. The indexdoc menus are kept (still consumed by doc/wodoc).
Eliom.Lib.Option (which re-exported the Ocsigen Server baselib Option module) was removed in Server 8. Use the stdlib Option module instead (map/iter have identical signatures).
Pre-existing formatting drift that fails the lint-fmt CI; fix it so the branch is green.
Adapt to Ocsigen Server 8: use stdlib Option
Pin ocsigenserver#master, ocsipersist#master, eliom#deriving, ocsigen-toolkit#modernize, ocsigen-dune-rules#modernize, ocsigen-ppx-rpc#modernize and ocsigen-i18n#modernize.
CI: pin the Server 8 dev branches of ocsigen deps
Bump the js_of_ocaml lower bound to 6.4.0 (matches ocsigen-toolkit and the Server 8 / 6.4 toolchain).
eliom is versioned 13.0~dev; ">= 13.0.0" excludes it (`~` sorts before the release), causing the opam install to fail. Use ">= 13.0~".
The Server 8 / modern ppx stack (ocsigen-ppx-rpc needs ppxlib >= 0.37, which together with pgocaml's ppx_sexp_conv pulls ppxlib_jane >= v0.17 requiring OCaml >= 5.3) cannot be resolved on OCaml 4.12 / 4.14 / 5.2. Build on OCaml 5 (latest) only.
wasm_of_ocaml (pulled via eliom) needs binaryen's wasm-merge. Use the Aandreba/setup-binaryen action like eliom, and drop the Windows runner (no binaryen/wasm toolchain there), matching eliom's matrix.
The os.pgocaml template was renamed to os; the old name no longer exists.
The os distillery template pinned eliom < 12.0.0 and ocsigen-start < 8.0.0, which conflict with the current eliom 13 / ocsigen-start 9. Bump to eliom 13.x and ocsigen-start 9.x.
The generator read the project sources through "../../.." (and
"../../../assets"), a path that climbs out of _build to the real source
tree. It only worked because the rule was run unsandboxed; under a
sandbox (or with an extra directory level) those paths do not resolve and
the build fails with Sys_error "../../../assets".
Read the sources from the gen subdir's parent ("..", "../assets") and
declare the .eliom/.eliomi/.tsv files as rule dependencies so dune stages
them in the sandbox and re-runs the generator when they change.
The generator read the project sources through "../../.." (and
"../../../assets"), a path that climbs out of _build to the real source
tree. It only worked because the rule was run unsandboxed; under a
sandbox (or with an extra directory level) those paths do not resolve and
the build fails with Sys_error "../../../assets".
Read the sources from the gen subdir's parent ("..", "../assets") and
declare the .eliom/.eliomi/.tsv files as rule dependencies so dune stages
them in the sandbox and re-runs the generator when they change.
The generator now reads the build directory (".."), which mirrors the
sources but also contains generated files: the .pp.eliom/.pp.eliomi
preprocessing artifacts and the .eliom modules produced from assets/*.tsv
(i18n) and *.eliom.in (static config). Enumerating those emitted a client
rule twice for the same target, so `make all` failed with "Multiple rules
generated for ...". Filter them out and keep only real sources.
Completes the sandbox fix: the previous commit corrected the paths but
exposed these duplicates once the generator started reading the build tree.
The generator now reads the build directory (".."), which mirrors the
sources but also contains generated files: the .pp.eliom/.pp.eliomi
preprocessing artifacts and the .eliom modules produced from assets/*.tsv
(i18n) and *.eliom.in (static config). Enumerating those emitted a client
rule twice for the same target, so `make all` failed with "Multiple rules
generated for ...". Filter them out and keep only real sources.
Completes the sandbox fix: the previous commit corrected the paths but
exposed these duplicates once the generator started reading the build tree.
The workflow generates the test project inside the ocsigen-start checkout,
which ships a dune-project. Dune then took ocsigen-start as the build root
and treated the generated project as a nested subdirectory, which breaks
Eliom's client/server value linking ("Inferred type of client value not
found. You need to regenerate ...cmo"). Drop a dune-workspace into the
generated project so it is its own dune root.
The workflow generates the `os` test project inside the ocsigen-start
checkout, which ships a dune-project. Dune then took ocsigen-start as the
build root and treated the generated project as a nested subdirectory,
which breaks Eliom's client/server value linking ("Inferred type of client
value not found. You need to regenerate ...cmo"). Drop a dune-workspace
into the generated project so it is its own dune root.
Require js_of_ocaml 6.4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Companion to ocsigen/eliom#859. Eliom 13 drops
Stdlib.Marshalfrompersistent storage;
Reference.eref ~persistentnow requires aDeriving_Json.tcodec.Commits
Migrate persistent erefs to Deriving_Json codecs(encoded as a sorted string list) and pass it to both
`tips_seen` and `tips_seen_not_connected`.
`local_calendar_{of,to}_json` so `[%json: Os.Date.local_calendar]`
resolves transparently. Encoding: Unix float
(`CalendarLib.Calendar.{to,from}_unixfloat`).
`[%json: Os.Date.local_calendar option]` to the demo eref so the
generated app shows the new idiom.
(in opam semver, `13.0~dev < 13.0.0`).
`ocsigen-toolkit` commit on github — it silently overrode any
local pin to toolkit when ocsigen-start was repinned.
Test plan
`eliom#deriving` + `ocsigen-toolkit#deriving`
app