Closed jchavarri closed 5 years ago
We could also use BuckleScript (kidding / not kidding ) 😄
lol, I kinda like the idea of using BuckleScript. that would take care of both linting and type.
Yeah 😄 I have been thinking more, and if extra tooling is going to be added, we could just as well use jsoo Js
module, and ppx (obj##.property
, obj##method
), which has quite good support to deal with JS data types (actually BuckleScript was inspired from it in many ways).
As an example, this:
would become this:
Js.Opt.to_option
😂
Maybe a small experiment with useState
for example would throw more light, but it seems like the simplest path forward. If that was the case the external
go away and are replaced with regular let
where the converted logic for each function would go.
I wish I had more experience with jsoo to give constructive input. Although it's very fascinating to learn where bs drew some inspiration. 😅
So if I understand correctly, if we decided to just use the jsoo, lib/React.js
would be replaced with one jsoo ffi implementation? Any no need for external
s ?
@benschinn Exactly! No need for .js
files anymore.
There are some basic mistakes that can happen all the time in
.js
files. Adding eslint (or typescript?) would help mitigate that.