Skip to content

9.0.0

Latest

Choose a tag to compare

@balat balat released this 26 Nov 16:22
· 30 commits to master since this release
caccc24
  • Module namespace modernization
    • Public modules are now accessed as Os.Session, Os.User, Os.Tips,
      Os.Email, Os.Notif, ... instead of the legacy flat Os_xxx prefix.
    • New ocsigen-start-compat opam package: provides the legacy
      Os_xxx module names as include-aliases of the new Os.Xxx
      modules, to ease migration of existing code.
  • PROJECT_NAME_icons.eliom in the distillery template is now
    parameterised on Eliom.Content.Html.T (the shared signature
    exposed by Eliom 13) instead of an ad-hoc ICON_HTML signature.
  • Os.Page: the error pages are sent with an HTTP status matching the error:
    403 when the user may not see the page (Session.Not_connected,
    Session.Permission_denied, a predicate returning false), 404 when what it
    shows does not exist (Eliom.Common.Eliom_404, User.No_such_user,
    Db.No_such_user, Db.No_such_resource, Handlers.No_such_resource), 500 for
    any other exception, Not_found included, as in Eliom. They used to be
    sent with 200. The fallback may set another one with
    Eliom.Registration.set_status (Eliom 13). The exception is logged on
    the source os:page with the path of the request, on both sides: as an
    error for a 500, at debug level otherwise.
  • Os.Page: an exception raised by the fallback is no longer caught as if
    the predicate had raised it, which called the fallback again. In
    Os.Page.page, a Predicate_failed raised by the predicate is no longer
    wrapped in another one, as in connected_page.
  • Os.Session also puts the service session in the group of the user, as
    it already did for the data sessions: at login, when the session is
    restored, and when the service session has left the group. Services
    registered with scope Eliom.Common.default_group_scope are now shared
    by all the sessions of the user (Eliom 13), and
    Os.Session.disconnect_all closes them. A service session, with its
    cookie, is now created at login.
  • Distillery template
    • Renamed from os.pgocaml to os.
    • Unknown URLs get a page of the application, with status 404, through
      Eliom.Registration.set_exn_handler, instead of the default error page
      of Ocsigen Server. Eliom then answers these URLs itself: extensions
      placed after <eliom/> in the configuration no longer see them, and
      each unknown URL costs a full page of the application, session
      included.
    • Database schema: the tables of Ocsigen Start are now in
      ocsigen_start.sql, a replayable file copied into the project,
      which creates them on a new database and brings them up to date
      from any release since 0.99. Its trigger functions live in the
      schema ocsigen_start; the helper trigger_exists of the previous
      templates is dropped. PROJECT_NAME.sql only holds the schema of
      the application, and is replayable too. make db-update applies
      both; it replaces db-schema and the dead db-upgrade target.
      db-create also creates the Ocsipersist database.
      To move an existing project to this layout: copy
      ocsigen_start.sql from the new template; take db-update and
      OS_PSQL_FILE from its Makefile.db and Makefile.options; remove
      the Ocsigen Start part from PROJECT_NAME.sql and make the rest
      replayable, as the header of the new PROJECT_NAME.sql explains;
      then run make db-update.
    • The set_main_email trigger of the template schema now names the
      users table with its schema: adding an email to a user created
      without one failed with the default search_path.
    • Source directory renamed back to template.distillery/ (the
      convention used by ocsigen-start's previous Makefile-based
      build), and now installed via dune
      (install (section lib_root) (files (glob_files_rec
      (template.distillery/{,.} with_prefix eliom/templates/os))))
      so the template lands at lib/eliom/templates/os/, where
      eliom-distillery picks it up at the standard location (Eliom
      13 dropped the per-package eliom-templates/ auto-discovery).
    • template.distillery is now generated from the os_template
      repository by script/update_template.sh.
    • No data directory in the configuration: Ocsipersist gets its
      location from <database> or <store>.
    • New demo page for forms, with a button to show the password.
      Style update.
    • New layout: the code of the application is a library in lib/,
      its entry module is in app/, and app/main/ is an executable that
      links Ocsigen Server as a library (make test.static.byte). Their
      dune rules are generated by ocsigen-dune-rules.
    • The WASM client is enabled with USE_WASM, both in the
      configuration file and in the executable.
    • Formatted with the ocsigen profile of OCamlformat 0.30.0, which the
      .ocamlformat of generated projects selects.
  • Migrated to the new Eliom 13 module names (Eliom.Service,
    Eliom.Content, Eliom.Common, ...) and to the wrapped
    ocsigenserver module names (Ocsigen.Server, Ocsigen.Extensions,
    Ocsigen.Config, Ocsigen_base.Lib, ...).
  • The library is built with dune and ocsigen-dune-rules instead of
    Makefiles.
  • Dependencies: OCaml >= 5.1, Eliom 13, Ocsigen Toolkit 5,
    ocsigen-i18n 6, ocsigen-ppx-rpc 2, ocsipersist-pgsql-config 3.1,
    js_of_ocaml >= 6.4.1, and exactly ocsigen-dune-rules 1.0.0, since
    each new version changes the generated rules. conf-postgresql
    replaces the depexts on PostgreSQL.
  • Documentation: the API documentation and the manual are written
    with odoc, and published on ocsigen.org and ocaml.org.
  • Os.Email: the default email-sending function now pipes an RFC-2822
    message to the configured mailer ("sendmail" by default) via
    Lwt_process, instead of printing to stdout. If the mailer is not on
    PATH, the email is logged to stderr so the application stays usable
    out of the box. The now-unused [Invalid_mailer] exception is removed.
  • Os.Services: the services of phone connectivity are marked with
    Eliom.Service.allow_unregistered, so that Eliom 13 does not warn about
    them when an application does not enable phone connectivity.
  • opam: opam install --with-doc works again. The opam build no longer
    runs dune's @doc, which fails because the server and client libraries
    define the same modules.