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

Support for neo-blessed possible?

Open philraj opened this issue 6 years ago • 8 comments

(Sorry for spamming you with so many issues)

Is there any way you can think of to get this to work when using a blessed fork like neo-blessed?

I noticed that the way this interacts with react-blessed is by patching the blessed object with a fake element type. I don't know if there's a cleaner way than making it an optional peer dependency and using something like require.resolve to see if neo-blessed is being used.

I know it's a less probable use case, but unfortunately the standard blessed has strange bugs that will probably never be fixed.

philraj avatar Oct 02 '18 18:10 philraj

Thanks, no problem, I appreciate the input!

I didn't know about neo-blessed. It sounds like a good idea to support it, too. I think it should be possible by trying to patch both by wrapping that in try/catch. I will give it a try.

dundalek avatar Oct 02 '18 20:10 dundalek

I gave it some more thought. I think the trouble is that both react-blessed and blessed-contrib load blessed internally. So even if we patched neo-blessed the original blessed would be still used.

So the question is if there is a way to override blessed in react-blessed and blessed-contrib. If that is somehow possible then adding support to react-blessed-contrib would be then pretty simple.

dundalek avatar Oct 02 '18 20:10 dundalek

https://github.com/Yomguithereal/react-blessed/blob/master/README.md#using-blessed-forks

This is the supported way to override which blessed is being used, so at least on that side it is possible.

philraj avatar Oct 02 '18 21:10 philraj

Oh, that's neat. Now only if there would be a similar approach for blessed-contrib.

dundalek avatar Oct 02 '18 21:10 dundalek

@dundalek I have access to blessed-contrib and can merge and push releases as required. It would be helpful though if you or others could help triage PRs there as I'm less informed on the internals.

lirantal avatar Oct 02 '18 21:10 lirantal

I'm really hoping this happens some day.

dustinlacewell avatar Jul 07 '21 20:07 dustinlacewell

@dustinlacewell It looks like there is another option now since npm v6.9.0 introduced support for module aliases. You should be able to install neo-blessed as blessed with npm install blessed@npm:neo-blessed and things should just work.

dundalek avatar Jul 07 '21 22:07 dundalek

☝️ love this hack idea!

@dustinlacewell - are there any specific updates in neo-blessed that you are looking for?

lirantal avatar Jul 08 '21 18:07 lirantal