rescript-compiler icon indicating copy to clipboard operation
rescript-compiler copied to clipboard

ReScriptify cppo files for certain belt / Js modules

Open ryyppy opened this issue 2 years ago • 2 comments

As stated in #5361 (rescriptify Belt / Js docs), we noticed that some modules are generated from cppo.ml[i] files.

That means that some docs will get overridden with the old docs as soon as we re-generate the necessary files. Therefore we either need to remove cppo from our user-facing modules infra, or accommodate cppo with ReScript code.

Goal is to be able to generate the relevant res and resi files for our Js and Belt modules.

Full list of cppo files with their generated counterparts:

  • map.cppo.ml[i] -> belt_Map*
  • mapm.cppo.ml[i] -> belt_MutableMap*
  • setm.cppo.ml[i] -> belt_MutableSet*
  • hashmap.cppo.ml[i] -> belt_HashMap*
  • belt_Set.cppo.ml[i] ->belt_Set*
  • js_typed_array.cppo.ml[i] ->js_typed_array
  • js_typed_array2.cppo.ml[i] ->js_typed_array2
  • sort.cppo.ml[i] ->belt_SortArray*

ryyppy avatar Jun 22 '22 07:06 ryyppy

cppo does not actually parse files -- might run just as well on res files

cristianoc avatar Sep 15 '22 17:09 cristianoc

ninja is instructed to only look for .ml and .mli files in jscomp/others but could look for .res and .resi

cristianoc avatar Sep 15 '22 17:09 cristianoc

Started implementing this. Indeed it works fine to run cppo on .res files.

cknitt avatar May 28 '23 07:05 cknitt

See #6271 for the Belt part.

I will extend that to the rest of jscomp/other in a separate PR later.

cknitt avatar May 28 '23 17:05 cknitt