What are Coconut.ui and HaxeUI worth?

I have to make a web app with a relatively complex ui. I’ve looked at various options and two stand out: HaxeUI and Coconut.ui.

I’d prefer creating a ui from haxe than manipulating html, but given that there is no showcase for haxeui, i don’t know what it’s worth.

There no showcase for coconut.ui either.

What i want to know is: before i invest lots of time into one, i want to hear about some experiences using them. What are they worth?

1 Like

I don’t know about Haxe UI, but I’m very satisfied with Coconut UI. There isn’t a lot of documentation, but it’s very similar to React.

You can start by taking a look at this sample application:

1 Like

FWIW, coconut does have a show case website, although it is not very resourceful.

https://mvcoconut.github.io/

For some clarification:

  • HaxeUI is first and foremost a rich component library, that gives you a consistent API across a vast set of targets: HTML, native desktop UIs, native Android, OpenFl and Kha (basically drawing the controls on screen), pdcurses (drawing fancy ASCII art controls in a terminal) … I probably forgot some … on top of that it has a CSS based layout system and you can (but don’t have to) describe your UIs via XML

  • Coconut focuses entirely on bringing a certain paradigm to Haxe … one that is quite shamelessly stolen from React and MobX … in a nutshell, the idea is that:

    1. you describe your data (in models)
    2. you describe your ui (in views) … Coconut renders it
    3. you modify your data in events (user input, network, …) … Coconut updates your UI accordingly

    Coconut does not bring its own controls. Instead, you can target the DOM (and build your controls via HTML), you can target React (and use React component libraries such as Material UI) or React Native (which renders via native controls), you can even target HaxeUI if you want to and there are a bunch of other targets too.

    Coconut does not give you any functionality that you wouldn’t have without it. It allows you to create UIs in a descriptive way that’s vastly terser than the imperative equivalent. There’s a certain performance overhead (in my experience negligible) and loss of direct control involved (although there are escape hatches). On the plus side, you have less code.

If you don’t require native UI, then you may also want to consider feathersui (for which there’s also a coconut backend). Another option would be to use haxe-react “directly” (i.e. without coconut), together with material ui or any other react component kit (check out dts2hx to generate externs).

7 Likes

I use both in different scenarios and are happy with both.

  • coconut.ui is used in a mobile app (cordova), which has a long long history. It started with jQuery and jQuery Mobile, than abandoned that and moved the layout to a modern look with framework7 (still very jQuery like). Then new modules were added with Francos Doom (also a virtual DOM, but not as strict and elegant as coconut) on top of framework7, because it was there before coconut. And now finally everything is moved to coconut.ui and coconut.data. Coconut.data brings order into chaos and coconut.ui has proven to be very powerful as soon as you don’t fight against it - but it was (and still is) a long learning curve when you are not used to reactive style. So coconut.ui has no UI elements on its own, that’s why I still need framework7 - but mostly the css and I try not to use any of its framework7 js. My final goal is to get rid of all framework7 js and only use its css an do the complete ui with coconut.
  • HaxeUI is the contrary - it has a whole bunch of UI Elements which are css style-able. Currently I use it in a typical desktop App, which was started by a former employee. HaxeUI is not a finished product but with its many components it is great for desktop Apps. Ian is a great help when you encounter some problems and there is the rumour, that he creates a new target or component every month :slight_smile: . Programming is more classical UI style, but that’s not a must - you can combine it with coconut (I still have to try that).

So it depends what you need and where you want to go.

4 Likes