r/purescript • • Nov 13 '19

Advice on greenfield PureScript + React?

I want to write a new PureScript app which will render as a React component in a JupyterLab extension.

This application will be very interactive with lots of drag-and-drop.

My question is: what would you, expert and opinionated PureScript developer, choose for your dependencies to start project like this?

  1. thermite?
  2. purescript-react-basic + purescript-react-dnd-basic?
  3. purescript-react?

Reference: https://www.reddit.com/r/purescript/comments/a3jguv/ui_library_question/

13 Upvotes

11 comments sorted by

View all comments

Show parent comment

2

u/jamesdbrock Nov 14 '19 edited Nov 14 '19

Thank you very much for your advice @spicydonuts. Since you work with Phil Freeman, the author of thermite and PureScript, and since you and Phil jointly authored purescript-react-basic, I am going to weigh your advice very heavily.

The reason I wrote this post is because I have heard it claimed that the approach taken in thermite is generally better than purescript-react-basic, and specifically that thermite relies less on internal React component state than purescript-react-basic. If you and Phil both agree that purescript-react-basic should be preferred to thermite, then I bet a lot of users would be interested in an explanation about that in the README for either thermite or purescript-react-basic.

3

u/[deleted] Nov 14 '19

I can't speak for Phil or thermite, really, but it depends on what you want. If thermite's api appeals to you, give it a shot! The hooks api appeals to me because it's so close to the JS one, meaning my own knowledge from that area is more directly applicable and it's easier to interact with 3rd party libs like react-media-hook. We were also porting an existing JS React app, so easy ffi helps a lot. But that's just me :)

2

u/elvecent Nov 14 '19

Hooks are actually a game changer. While thermite might be better than react-basic without hooks, it's not necessarily better than it with them.