Conversation
| // Source: https://github.com/reasonml-community/graphql_ppx/blob/master/src/bucklescript_bin/Bin.re | ||
| let argv = | ||
| switch (Sys.argv |> Array.to_list) { | ||
| | [program, ...rest] => | ||
| switch (List.rev(rest)) { | ||
| | [output_file, input_file, ...args] => | ||
| List.concat([ | ||
| [program], | ||
| List.rev(args), | ||
| [input_file, "-o", output_file, "--dump-ast"], | ||
| ]) | ||
| |> Array.of_list | ||
| | _ => Sys.argv | ||
| } | ||
| | _ => Sys.argv | ||
| }; | ||
|
|
||
| let () = Driver.run_main(~argv, ()); No newline at end of file |
There was a problem hiding this comment.
I had to use this otherwise there was an error when running on bs side
There was a problem hiding this comment.
Hmm. I think this is because the BuckleScript compiler is up-to-date with OCaml 4.06: https://bucklescript.github.io/docs/en/upgrade-to-v7#a-quick-look-under-the-hood.
There was a problem hiding this comment.
This is because you updated ocaml-migrate-parsetree. It has nothing to do with BuckleScript.
dylanirlbeck
left a comment
There was a problem hiding this comment.
So after reading through some docs, and seeing your addition in bin/Bin.re, I'm wondering if it's even worth using the css-parser package at all, if we have to go through this hacky way of getting BuckleScript to work.
I think the fundamental difference between tailwind-ppx and graphql-ppx, at least right now, is that graphql-ppx is equally targeting BuckleScript and Reason native projects, so it makes sense to have a newer version of the OCaml compiler. On the other hand, I'd like to optimize the experience of tailwind-ppx for BuckleScript projects, since that's how most people are writing web apps (at least until an issue gets opened by a js_of_ocaml user).
Does that make sense? If anything, I think at this point it'd be better to colocate the parser code into it's own directory, instead of using the css-parser library.
| // Source: https://github.com/reasonml-community/graphql_ppx/blob/master/src/bucklescript_bin/Bin.re | ||
| let argv = | ||
| switch (Sys.argv |> Array.to_list) { | ||
| | [program, ...rest] => | ||
| switch (List.rev(rest)) { | ||
| | [output_file, input_file, ...args] => | ||
| List.concat([ | ||
| [program], | ||
| List.rev(args), | ||
| [input_file, "-o", output_file, "--dump-ast"], | ||
| ]) | ||
| |> Array.of_list | ||
| | _ => Sys.argv | ||
| } | ||
| | _ => Sys.argv | ||
| }; | ||
|
|
||
| let () = Driver.run_main(~argv, ()); No newline at end of file |
There was a problem hiding this comment.
Hmm. I think this is because the BuckleScript compiler is up-to-date with OCaml 4.06: https://bucklescript.github.io/docs/en/upgrade-to-v7#a-quick-look-under-the-hood.
|
Yes, I agree that we should make the bucklescript experience optimal. I tried several things but I wasn't able to keep ocaml 4.06. So let's close this for now :) |
Fixes #51
I added the
ocaml-css-parserso it's not needed anymore to copy/paste the code.Due to ocaml-css-parser constraints, I had to bump dune to >= 2.4. Meaning that I had also to bump the OCaml version.
I took the opportunity to bump some other deps as well.
For now there are 2 "issues":