promise icon indicating copy to clipboard operation
promise copied to clipboard

Melange compatibility

Open jchavarri opened this issue 2 years ago • 2 comments

@aantron would you support making this library compatible with Melange? I don't think many changes would be needed, mostly a couple of changes on opam and dune files. cc @davesnx

Using Melange would unlock a fix for https://github.com/aantron/promise/issues/52.

jchavarri avatar Aug 15 '23 15:08 jchavarri

One thing that comes to mind is that because melange also uses dune, a new library should be added, maybe they could be called promise.native and promise.melange or something like that.

jchavarri avatar Aug 15 '23 15:08 jchavarri

I have vendored this project under server-reason-react on https://github.com/ml-in-barcelona/server-reason-react/tree/main/packages/promise, and changes that I made was:

  • Add dune file for js/
  • Remove type Result and result dependency on native/ (was there for compatibility with 4.02)
  • Remove type result on js/ (was there for compatibility with BuckleScript < 6)

Just my 2 cents about ReScript/Melnage. If there's a need for a compatibility with ReScript (https://github.com/aantron/promise/issues/73) maybe we could migrate either js/promise.re to ReScript and keep it under a bsconfig folder or migrate to OCaml and add the dune with the modes melange.

I have done this similar stuff for styled-ppx and it's a decent solution

davesnx avatar Aug 15 '23 15:08 davesnx