blessed icon indicating copy to clipboard operation
blessed copied to clipboard

React wrapper

Open jussi-kalliokoski opened this issue 9 years ago • 9 comments

Just throwing an idea in the air... It would be really cool to be able to define terminal UIs in a React-style way, and this library seems like a perfect fit for wrapping into a React-style API (in a separate module of course).

jussi-kalliokoski avatar Mar 25 '15 08:03 jussi-kalliokoski

This is definitely one of the directions I want to see blessed go. I have a few in mind actually, just off the top of my head:

  1. Create a markup language for blessed (already done, and pretty cool: https://github.com/kevinhikaruevans/blessedoo)
  2. Use blessed as a rendering backend for jsdom, allowing us to create an insanely good terminal web browser (have you ever seen a terminal browser with hover effects and hoverable text boxes?).
  3. Wrap blessed with any other APIs that have a concept of rendering, such as this.

chjj avatar Mar 25 '15 10:03 chjj

Of course, I wouldn't include this in core blessed. These are things that should be separate in my opinion.

chjj avatar Mar 25 '15 10:03 chjj

:+1:

Use blessed as a rendering backend for jsdom, allowing us to create an insanely good terminal web browser (have you ever seen a terminal browser with hover effects and hoverable text boxes?).

This would be the best thing ever. A relevant lib might be facebook/css-layout.

dbkaplun avatar Mar 25 '15 13:03 dbkaplun

I've been having the same idea since I first learned about blessed - More specifically, blessing backbone/marionette. Blessedoo should make it much easier!

taneltm avatar Mar 25 '15 21:03 taneltm

Hello everyone. With the latest changes in [email protected] and the separation of the rendering logic from the components' one, I started a little proof of concept of react-blessed here. It does not much for the time being but if you like the idea, we can start working on that and extend the features of the renderer quite easily.

Yomguithereal avatar Jul 22 '15 18:07 Yomguithereal

@Yomguithereal, good job. I wasn't aware React was modularized in that way. That makes things a lot easier. That's one idea. I think it's worth pursuing.

But the ultimate goal I have in my head should be to combine JSDOM with a CSSOM module (anyone know of a good headless CSSOM?) and use Blessed for the rendering backend. Then we could use whatever frontend framework we wanted without changing a thing. It would definitely be a non-trivial task, but it would be awesome. Plus, nevermind the frameworks, we could also make the best terminal web browser ever created (complete with hover effects, images, ansiimages, etc).

chjj avatar Jul 23 '15 04:07 chjj

What about cssom the npm package (sorry if this is not headless and for some stupid reasons I missed it)?

Beotian question: is jsdom rendering backend modifiable without a kind of fork?

Yomguithereal avatar Jul 23 '15 20:07 Yomguithereal

@chjj, I just started experimenting with the latest jsdom version (which packs a partial CSSOM) and am trying to use facebook's css-layout module on the resultant DOM to see whether the produced layout is of sufficient quality

Yomguithereal avatar Sep 17 '15 21:09 Yomguithereal

Just JSX no react, one file implementation with types and supporting, FunctionElement, ClassElement, function attributes and things like {arr.map(a=><text....>} or {condition && <box...}

  • implementation: https://github.com/cancerberoSgx/typescript-ast-explorer/blob/dba7859e301d9b86c065a2881151471f63c89417/src/blessed/jsx.ts
  • test: https://github.com/cancerberoSgx/typescript-ast-explorer/blob/dba7859e301d9b86c065a2881151471f63c89417/spec/blessed/jsxTest2.tsx

cancerberoSgx avatar Apr 13 '19 08:04 cancerberoSgx