react-blessed
react-blessed copied to clipboard
idea: hybrid tui-gui apps
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
for compatibility we'd also need to address the class
situation, as per https://github.com/Yomguithereal/react-blessed/issues/17
This could be fun indeed. Let me think about it and see if I can find ideas.
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))
+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).
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.
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 ;-)
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
well, react + redux is really what you want to support =0)
+1 This would be a great feature
related : https://medium.com/styled-components/announcing-primitives-support-for-truly-universal-component-systems-5772c7d14bc7
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 .
I can see a very good usecase for this to build styled components that have a blessed fallback. Or the other way around.
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...