Dean177 / reason-standard

An easy-to-use, comprehensive, and safe standard library enhancement for Reason and OCaml.
https://reason-standard.netlify.com
MIT License
53 stars 2 forks source link

Deprecated special raw forms for functions #6

Closed sarna closed 4 years ago

sarna commented 4 years ago

Hello,

Love the library! Finally found an stdlib replacement with good docs :)

The only problem is, I can't build it - I'm getting a lot of deprecation warnings and they're configured as errors for some reason (I'm new to BuckleScript, sorry).

They should be pretty straightforward to fix, an example warning looks like this:

Warning number 22 (configured as error) 
  /home/me/code/typer/node_modules/reason-standard/bucklescript/src/Standard.ml 702:18-20

  700 ┆ let remainder (n : t) ~(by : t) = (modulo n ~by : t)
  701 ┆ 
  702 ┆ let power = ([%raw fun a b -> "{return a ** b}"] : t -> t -> t)
  703 ┆ 
  704 ┆ let ( ** ) (base : t) (exponent : int) : t = power base (ofInt exponent)

  Special raw form for function is deprecated, plain [%raw ".."] is recommended
Dean177 commented 4 years ago

Is this a project using standard (is it open source?) or building standard itself?

sarna commented 4 years ago

I tried adding Standard to my Reason/BuckleScript project, following the guidelines here: https://reason-standard.netlify.app/docs/installation

Dean177 commented 4 years ago

Short term you can disable the warning: https://bucklescript.github.io/docs/en/build-configuration#warnings

I am a little busy with family stuff at the moment, so it might be a while for me to do a new release.

A PR would be amazing though, this is the relevant section in the Bucklescript docs: https://bucklescript.github.io/docs/en/embed-raw-javascript#docsNav

sarna commented 4 years ago

No worries, family comes first :)

I’ll try to prepare a PR this week.