Skip to content

Upgrade jsoo-react#9

Merged
stilscher merged 15 commits intomasterfrom
jsoo-react-upgrade
Feb 2, 2024
Merged

Upgrade jsoo-react#9
stilscher merged 15 commits intomasterfrom
jsoo-react-upgrade

Conversation

@sim642
Copy link
Copy Markdown
Member

@sim642 sim642 commented Mar 30, 2022

This is the original version of #8.


Unfortunately jsoo-react has lots of breaking changes in the meanwhile. I think I managed to fix most of the compilation error, but there's one left which I don't really understand. There seems to be some change to the children representation, which requires weird ... unpacking on all out custom components.

TODO

  • Fix ErrorBoundary usage compilation.

@sim642 sim642 added enhancement New feature or request help wanted Extra attention is needed labels Mar 30, 2022
@keremc
Copy link
Copy Markdown
Contributor

keremc commented Apr 2, 2022

If I remember correctly, I had the same issue with child components when I tried to update to the latest version of jsoo-react a few months ago. I think #8 should be fine for now. jsoo-react isn't stable yet anyway, so this probably won't be the last breaking change they make.

@sim642
Copy link
Copy Markdown
Member Author

sim642 commented Apr 2, 2022

By the way, the also mentioned that there might be a compatibility library for this big breaking change at some point: ml-in-barcelona/jsoo-react#162 (comment).

@sim642 sim642 mentioned this pull request Aug 16, 2023
@michael-schwarz michael-schwarz assigned stilscher and unassigned keremc Aug 28, 2023
@stilscher
Copy link
Copy Markdown
Member

I rebased Simmo's work on a more recent version of the master branch, removed the opam pin such that we should now be using the opam release of jsoo-react directly, fixed the above mentioned compilation error with the ErrorBoundary and the remaining compilation errors. So while it at least builds, there is this weird TypeError: c1 is undefined error when running GobView and so far I have not really an idea why. Also, I think there might be a syntactically nicer way of fixing the ErrorBoundary compilation error, but so far I have not found out how.

@sim642
Copy link
Copy Markdown
Member Author

sim642 commented Oct 17, 2023

So while it at least builds, there is this weird TypeError: c1 is undefined error when running GobView and so far I have not really an idea why.

If you use the dev profile in dune-workspace to build, then js_of_ocaml should produce non-minimized JS that is somewhat more readable and has roughly original OCaml names for things.

@stilscher stilscher marked this pull request as ready for review October 18, 2023 18:24
@michael-schwarz
Copy link
Copy Markdown
Member

@sim642 Since you worked on this initially, it might make sense if you review it. (I cannot request you as you are the one who started the PR.)

@sim642 sim642 self-assigned this Feb 1, 2024
@sim642
Copy link
Copy Markdown
Member Author

sim642 commented Feb 1, 2024

This seems to work fine with the dev profile, but with a non-dev profile (like trace), GobView breaks with an exception in the browser console:

Fatal error: exception Invalid_argument("Cilfacade.get_ikind: non-integer type void ")

Or maybe this profile issue exists already before this PR?

@stilscher
Copy link
Copy Markdown
Member

I discovered this warning before but was not able reconstruct it. If I remember correctly, it was due to get_ikind (indirectly) being used for the definition of a value. And I suspect that it depended on the compilation order whether this caused an error or not.

@sim642
Copy link
Copy Markdown
Member Author

sim642 commented Feb 1, 2024

I checked that for me it also happens on master, so I opened #38 about it, so this isn't a blocker for this PR, but still needs a fix.

@stilscher stilscher merged commit 8cff0a5 into master Feb 2, 2024
@stilscher stilscher deleted the jsoo-react-upgrade branch February 2, 2024 11:32
@sim642
Copy link
Copy Markdown
Member Author

sim642 commented Feb 7, 2024

Nevermind, I somehow had pinned jsoo-react to the old one again I guess.

Somehow I'm now getting this error when building GobView:

File "gobview/src/dune", line 39, characters 2-53:
39 |   (pps gen_js_api.ppx js_of_ocaml-ppx jsoo-react.ppx)))
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Fatal error: exception Invalid_argument("A spread as a DOM element's children don't make sense written together. You can simply remove the spread.")

So I guess there's some excessive ... although I'm not sure why this didn't come up before. It's also hard to debug because the error isn't at the right place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request help wanted Extra attention is needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants