Schmavery / reprocessing

ReasonML graphics library inspired by Processing
https://schmavery.github.io/reprocessing/
MIT License
682 stars 24 forks source link

Few problems when compiling #100

Closed baransu closed 6 years ago

baransu commented 6 years ago

I'm playing and trying out this library and it's really amazing. You rocks 🀘πŸ”₯ While creating simple "game" I've encountered few issues I have problem with. I'm only interested in web target at the moment so if I could drop bsb-native would be great (as mentioned here #69 ).

Versions of stuff:

reprocessing: 0.1.0
bsb-native: 2.1.1
refmt: Reason 3.0.0 @ bee43b0

No Gl.framebufferT

  /Users/baransu/Documents/Reason/game-test/node_modules/Reprocessing/src/Reprocessing_Common.re 73:23-37

  71 β”‚
  72 β”‚ type _imageT = {
  73 β”‚   framebuffer: option(Gl.framebufferT),
  74 β”‚   texture: Gl.textureT,
  75 β”‚   /* both redundant with tgls, maybe make Gl expose functions to get t
       he width/height */

  This type constructor's parameter, `Gl.framebufferT`, can't be found. Is it a typo?

This one is strange. I happend out of nowhere when I was fighting other issues. Can be reproduced with the current master of the baransu/reprocessing-test.

UNKNOWN SYNTAX ERROR

Basically the same issue as https://stackoverflow.com/questions/50541943/reprocessing-vscode-reason-refmt-breaks-project. I assume it's the problem with bsb-native in version 2.1.1 which is not up to date with Reason version I'm using. But the syntax error is pointing at very strange place that I don't fully understand.

No Reprocessing

  /Users/baransu/Documents/Reason/game-test/src/Game.re 1:6-17

  1 β”‚ open Reprocessing;
  2 β”‚
  3 β”‚ type runningT =

  The module or file Reprocessing can't be found.
  - If it's a third-party dependency:
    - Did you list it in bsconfig.json?
    - Did you run `bsb` instead of `bsb -make-world`
      (latter builds third-parties)?
  - Did you include the file's directory in bsconfig.json?

So when trying to fix UNKNOWN SYNTAX ERROR I bumped bsb-native to latest release and stumbled upon this error. I don't know if it's some stale version of some dependency or cache or something else but it seems strange that version 2.1.1 has not problem like that and the latest version breaks.


It's amazing library and I've spend huge amount of time to understand everything is tied together. Would be great to move forward and have stable setup I can build upon. If there is anything I can improve for other uses would like to help πŸ™‚

baransu commented 6 years ago

It turns out that few problems piled up causing my problems. I decided to clean up everything related to Reason/OCaml from my machine. Then I've made clean clone of bsansouci/reprocessing-example. After that installed latest Reason version and newest bsb-native version:

npm install -g reason-cli@3.2.0-darwin
npm install bsb-native@3.2.0

I've spend few hours trying different configurations so I hope no one will have similar problems πŸ™‚

bsansouci commented 6 years ago

Hey thanks for opening this issue. I'll keep it open until I've actually made the release, the remind me of the urgency of this issue! Really sorry for the pain man :/

reinvanimschoot commented 6 years ago

So I take it the UNKNOWN SYNTAX ERRORs I'm getting is due to a version difference? I've been trying to write a Pong game but I'm getting a lot of those errors and for the life of me, I cannot figure out what I was doing wrong since I followed the examples.

bsansouci commented 6 years ago

The error's due to bsb-native containing a different version of refmt than the global install that your editor's using to refmt the code. So you'll refmt your code with the newer version which will, for example, add trailing commas to a lot of stuff, then try to build with the older version which will no know how to parse the trailing commas. This shouldn't be happening on 3.2.0 though, does it?

reinvanimschoot commented 6 years ago

Oh, I see! I haven't yet updated. I just tried yarn add bsb-native@3.2.0 but I'm only getting the choice between two older versions.

Thanks for the quick reply btw!

reinvanimschoot commented 6 years ago

update:

Tried it like this: yarn add bsansouci/bsb-native#3.2.0 and it worked! However, after cleaning everything and building again, I now get the following error:

screen shot 2018-06-27 at 18 48 57

Schmavery commented 6 years ago

You can either

Schmavery commented 6 years ago

This seems like it's taken care of, let us know if not!