gen_js_api icon indicating copy to clipboard operation
gen_js_api copied to clipboard

Change Ojs_exn to Ojs.Exn

Open rgrinberg opened this issue 5 years ago • 2 comments

It's recommended that every library has a single toplevel module, and (wrapped false) is only there to help people transition to dune. Would it be ok to break compatibility and to switch to Ojs.Exn? If not, then perhaps we could add something to dune to help the transition from (wrapped false) to (wrapped true). We already have one such mechanism (wrapped (transition "message")) but it doesn't quite work in some cases (like this one)

rgrinberg avatar Nov 01 '20 20:11 rgrinberg

Why doesn't the "transition" mechanism work in that case ?

hhugo avatar Nov 01 '20 21:11 hhugo

In this case, Ojs_exn depends on Ojs. So we'd need to extract Ojs.t to some other module core, and then write ojs.ml as:

include Core
module Exn = Exn

But that would mean that (wrapped (transition ..)) would create a deprecated alias of the form ojs_core. This seems unnecessary.

I suppose that in this case we can just inline ojs_exn into ojs and then write ojs_exn as:

include Ojs.Exn

With a deprecation message. That seems alright to me.

rgrinberg avatar Nov 01 '20 21:11 rgrinberg