react-blessed icon indicating copy to clipboard operation
react-blessed copied to clipboard

idea: hybrid tui-gui apps

Open davidmarkclements opened this issue 8 years ago • 13 comments

This may be a spin off project, but looking for thoughts

If we take the elements like <box>, <list>, <checkbox>, <table> and so on, most of these can be equated to CSS frameworks like bootstrap - so what if we create a plugin that does just that - renders using blessed in the terminal, and outputs bootstrap DOM structure equivalents for browser rendering

approaches:

Approach Option 1: Hybrid Fundamental Components

instead of using <box>, <list> etc. we supply a <Box>, <List> etc components (e.g. import {Box} from react-blessed). Some kind of transpilation flag (e.g. env=tui or env=gui) supplies either the react-blessed element or a DOM structure

Approach Option 2: React elements plugin

create a library that adds react-blessed element namespaces to react on the gui side, these then render the dom structures. This options requires zero changes to code, other than requiring react-blessed-bootstrap-dom-shim (better name needed) instead of react-blessed - however it's not as clean, there's potential for namespace clashes between dom elements and blessed elements

davidmarkclements avatar Dec 27 '15 17:12 davidmarkclements

for compatibility we'd also need to address the class situation, as per https://github.com/Yomguithereal/react-blessed/issues/17

davidmarkclements avatar Dec 27 '15 17:12 davidmarkclements

This could be fun indeed. Let me think about it and see if I can find ideas.

Yomguithereal avatar Dec 27 '15 19:12 Yomguithereal

There's also the possibility of rendering to canvas: https://github.com/flipboard/react-canvas - even as a stop gap. Perhaps what we really need is a common set of generic components that will render in any environment (dom, canvas, terminal, native mobile, webgl, maybe even audio/Braille (eg screen readers and brialle interfaces))

davidmarkclements avatar Jan 02 '16 18:01 davidmarkclements

+1000 on this, I always wanted blessed to be more HTML-like for this kind of things (I was also thinking on developing my own blessed-based HTML renderer... :-P).

piranna avatar Mar 08 '16 05:03 piranna

I you ever make some tests with CSS layout etc. I would be glad to get your feedback about it and about your experiences on the subject @piranna.

Yomguithereal avatar Mar 08 '16 09:03 Yomguithereal

I have some other projects on my queue (I'm lead developer of NodeOS), but I'm thinking about using this for one of them so when I get time I'll told you about it ;-)

piranna avatar Mar 08 '16 10:03 piranna

https://github.com/formula1/meh-texteditor/tree/master/lib/Components/AbstractComponents

Shameless plug. Ive got started on it but I am pretty far from actually finishing it. Im not using the real react because I dislike the global nature of it and their stucture/import declarations make it dofficult for me to know where things are and how it works

formula1 avatar Mar 09 '16 14:03 formula1

well, react + redux is really what you want to support =0)

konobi avatar Jun 18 '16 09:06 konobi

+1 This would be a great feature

simonhochrein avatar Jan 15 '17 16:01 simonhochrein

related : https://medium.com/styled-components/announcing-primitives-support-for-truly-universal-component-systems-5772c7d14bc7

revolunet avatar Aug 21 '17 19:08 revolunet

What's the difference with ReactNative-everywhere?

El 21/08/2017 21:10, "Julien Bouquillon" [email protected] escribió:

related : https://medium.com/styled-components/announcing- primitives-support-for-truly-universal-component-systems-5772c7d14bc7

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Yomguithereal/react-blessed/issues/41#issuecomment-323826191, or mute the thread https://github.com/notifications/unsubscribe-auth/AAgfvgI9Ei0XkXD02qpiScHKb4yYC4lpks5sadYNgaJpZM4G7nHJ .

piranna avatar Aug 21 '17 19:08 piranna

I can see a very good usecase for this to build styled components that have a blessed fallback. Or the other way around.

vviikk avatar Apr 15 '18 08:04 vviikk

Each time I think about it, I find it a better fit to have a react-native-tty project and use it instead of raw blessed...

piranna avatar Apr 15 '18 17:04 piranna