Yomguithereal / react-blessed

A react renderer for blessed.
MIT License
4.45k stars 177 forks source link

update react support, context & hooks #89

Closed konsumer closed 5 years ago

konsumer commented 5 years ago

This will add support for context & hooks, and update the fiber implementation. Related to #88 .

Yomguithereal commented 5 years ago

Hello @konsumer. All seems alright from what I can understand right now. However, is it possible not to rely on react's alpha versions (or maybe hooks only work on alpha versions right now?), specially for peerDeps?

konsumer commented 5 years ago

It's not required for context, but hooks are only available in @next (currently 16.7.0-alpha.2.)

I could go to 16.6.3 (current @latest) and just have hooks demo not work (but hooks will be fine in user's code.)

Yomguithereal commented 5 years ago

Ok. Can I be a bit annoying and ask you to split this PR into two: one for context, and a second one for hooks, please?

I could go to 16.6.3 (current @latest) and just have hooks demo not work (but hooks will be fine in user's code.)

I could live with that I think. Then we'll need to update the dev deps when react officially moves hooks to latest. Does it seem good to you?

konsumer commented 5 years ago

Can I be a bit annoying and ask you to split this PR into two: one for context, and a second one for hooks, please?

I'm not sure how to do do that. Do you mean rewrite the code changes as different commits?

Then we'll need to update the dev deps when react officially moves hooks to latest. Does it seem good to you?

sounds perfect. I'll make the change and add a note to the hook demo that it won't work with older versions of react.

konsumer commented 5 years ago

ask you to split this PR into two: one for context, and a second one for hooks

More about this: this PR is mostly not directly related to hooks or context (I just made 1-file demos for those, like yours.) This PR is primarily an update of react & react-reconciler, and rewriting the fiber part to follow the current react-reconciler API.

konsumer commented 5 years ago

As a sidenote, I set peer-dep to 16.6.3, but left dev-dep at 16.7.0-alpha.2, so people can run the hook example, but won't be warned to use alpha, if they import it. I'm happy to set it however you want, but this seems like a good plan to me.

Yomguithereal commented 5 years ago

Ok, I'll wait just a little bit to see if anybody interested in the repo has some remarks then I will merge & release. Ping me if I forget.

konsumer commented 5 years ago

Hi, not sure if I am giving it enough time, but this is me pinging 😃

I have been using the fork in this project and it seems to be working well, but if there are more thorough tests I should put it through (other than the examples) let me know.

Yomguithereal commented 5 years ago

v0.5.0 released with your changes.