bucklescript-tea icon indicating copy to clipboard operation
bucklescript-tea copied to clipboard

Running tea with Melange

Open idkjs opened this issue 3 years ago • 7 comments

Hi @OvermindDL1

I tried building something with this and running the program gets you the error main is not a function

Here is a reproduction -> https://github.com/feluxe/bs-tea-starter-kit/pull/3

The error occurs on the example and on Usage.re which is copied from these docs.

Thanks for any guidance.

idkjs avatar Jun 16 '21 11:06 idkjs

I'm not really sure I can recommend using this project for new code since bucklescript's changes over the past year have broken a lot of various things, it seems to be going more toward a non-ocaml setup rather than something that transparently handles all setups. I'll accept a PR if you find a fix for this (or if you want to take up overall work then I can give full access), but I'm not sure it's worth trying to "upgrade" to a newer bs-platform version. If you use bs-platform things you might want to stick with the older versions that implement to OCaml more correctly. Otherwise JSOO has some fantastic tea-like API's as well.

OvermindDL1 avatar Jun 28 '21 17:06 OvermindDL1

@OvermindDL1 I hear it. I might see how far the upgrade goes version by version of bucklescript and try to figure it out. Mostly because there is a lot of value in this project as an example of what is possible. Hate to see it get mothballed. Thanks for the feedback. I will revert if I get anywhere.

idkjs avatar Jun 28 '21 22:06 idkjs

@jayesh-bhoot has it working here https://github.com/jayesh-bhoot/spiced-tea. FYI.

idkjs avatar Jul 03 '21 14:07 idkjs

@idkjs If it's working there then that's still using a main function, what changed in the BS api?

Please feel free to PR any fixes though!

OvermindDL1 avatar Jul 21 '21 16:07 OvermindDL1

I agree with @OvermindDL1 .

All I did in https://github.com/jayesh-bhoot/spiced-tea was to make bucklescript-tea work with melange, and document that. The API works as-is.

I don’t see why anything should change in this repo, may be except documenting the integration with melange.

jyssh avatar Jul 21 '21 19:07 jyssh

I can confirm that everything works as-is with melange. I've also created a sample repo that integrates with dream and adds tailwindcss: https://github.com/tcoopman/dream-melange-tea-tailwind

tcoopman avatar Jul 25 '21 08:07 tcoopman

I'm really curious if someone could figure out what's the different in OP's example then, I wonder if there might be a compat issue then....

OvermindDL1 avatar Jul 26 '21 22:07 OvermindDL1