Ocsigen Server 8.0 reorganises its public modules under hierarchical names and modernises its base library. These changes break compatibility with earlier versions. This page explains what changed and how to update existing code, either by switching to the new names or by relying on the ocsigenserver-compat package during the transition.
The historical flat Ocsigen_xxx modules are now grouped under three namespaces: Ocsigen for the server, Ocsigen_base for the base library and Ocsigen_http for the HTTP layer.
Ocsigen.Xxx)Ocsigen_server becomes Ocsigen.ServerOcsigen_config becomes Ocsigen.ConfigOcsigen_extensions becomes Ocsigen.ExtensionsOcsigen_request becomes Ocsigen.RequestOcsigen_response becomes Ocsigen.ResponseOcsigen_multipart becomes Ocsigen.MultipartOcsigen_messages becomes Ocsigen.MessagesOcsigen_local_files becomes Ocsigen.Local_filesOcsigen_command becomes Ocsigen.CommandOcsigen_parseconfig becomes Ocsigen.ParseconfigOcsigen_cohttp becomes Ocsigen.Ocsigen_cohttpOcsigen_base.Xxx)Ocsigen_lib becomes Ocsigen_base.LibOcsigen_cache becomes Ocsigen_base.CacheOcsigen_loader becomes Ocsigen_base.LoaderOcsigen_stream becomes Ocsigen_base.Ocsigen_streamOcsigen_config_static becomes Ocsigen_base.Config_staticOcsigen_http.Xxx)Ocsigen_header becomes Ocsigen_http.HeaderOcsigen_charset_mime becomes Ocsigen_http.Charset_mimeA few public modules are unchanged and need no update: Ocsigen_lib_base, Polytables, Ocsigen_cookie_map and the main Ocsigenserver module.
To make the transition smooth, the ocsigenserver-compat package provides every old Ocsigen_xxx name as an alias to its new module. Existing code keeps compiling without changes: just add the package to your dune file.
The shims are split to mirror the libraries they alias:
ocsigenserver-compat: old server names (Ocsigen_server, Ocsigen_extensions, Ocsigen_config, ...)ocsigenserver-compat.baselib: old base-library names (Ocsigen_lib, Ocsigen_cache, ...)ocsigenserver-compat.http: old HTTP names (Ocsigen_header, Ocsigen_charset_mime)For example, to keep using the old names in an executable:
(executable (public_name myserver) (name main) (libraries ocsigenserver ocsigenserver-compat ocsigenserver-compat.baselib ocsigenserver-compat.http))
The compat package is meant as a temporary migration aid: it is recommended to update your code to the new module names and drop the dependency once done. The compat modules are intentionally excluded from the API reference, which documents the new names only.
Ocsigen Server 8.0 requires OCaml 4.14 or later.
Several helpers that duplicated standard-library features have been removed from Ocsigen_lib (now Ocsigen_base.Lib). Use the standard library instead:
Ocsigen_lib.id is removed; use Sys.opaque_identityOcsigen_lib.leftright is removed; use Either.tOcsigen_lib.List.map_filter is removed; use List.filter_mapOcsigen_lib.Option module is removed; use the standard library OptionThese helpers have no replacement in ocsigenserver-compat: their standard equivalents should be used directly.