ml-in-barcelona / jsoo-react

js_of_ocaml bindings for ReactJS. Based on ReasonReact.
https://ml-in-barcelona.github.io/jsoo-react
MIT License
137 stars 19 forks source link

ppx: set display name on let%component #166

Closed glennsl closed 2 years ago

glennsl commented 2 years ago

Not sure how to test it, but this produces react stack traces such as this:

The above error occurred in the <Dune__exe__HelloWorldOCaml.Foo.make.(fun)> component:
    in Dune__exe__HelloWorldOCaml.Foo.make.(fun)
    in div (created by Dune__exe__Main.make.(fun))
    in div (created by Dune__exe__Main.make.(fun))
    in div (created by Dune__exe__Main.make.(fun))
    in div (created by Dune__exe__Main.make.(fun))
    in Dune__exe__Main.make.(fun)

Also note that the lower bound on OCaml was bumped to 4.12 to be able to use __FUNCTION__

glennsl commented 2 years ago

CI errors look like flukes to me :shrug:

glennsl commented 2 years ago

MacOS failure was indeed a fluke. Windows failure seems to be an issue with setup-ocaml: https://github.com/ocaml/setup-ocaml/issues/479

jchavarri commented 2 years ago

@glennsl this PR would close https://github.com/ml-in-barcelona/jsoo-react/issues/79, right?

glennsl commented 2 years ago

@glennsl this PR would close #79, right?

Seems so! Need to figure out how to detect if we're in dev mode though.

glennsl commented 2 years ago

Now it'll only set the display name if the environment variable JSOO_REACT_DEV set.

jchavarri commented 2 years ago

Thanks!