-
-
Notifications
You must be signed in to change notification settings - Fork 347
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
v2 RFC : Memo component by default and Boundary compoents #105
Comments
To be honest, I don't like the Having support for Regarding error boundaries, I've been looking at the React docs and their example and wondering how come they don't have an answer to error handling based on hooks? Error handling is behavior, which is what hooks are meant to abstract - this library is hooks first, so that's worth thinking about. (I'm clearly not the first to have thought about this - here's one example of error boundaries defined via hooks.) Since we're talking about version 2 already, here's something I've been wondering about lately. Do you think it's possible to move the component execution and diffing off the main thread into a Also, I think we still have issues to resolve with version 1 - mainly, tests should be rock solid and in working order before proceeding with more features, in my opinion. Error handling also likely needs work (we currently can't see errors at all) before adding more error handling features. |
I'm here. I'm very glad to hear from you. I think I can explain something:
I thought about this. Maybe we need something like
Yes, right now, error boundary can only be applied to class in React now, I think it's similar to suspense, so I put forward a similar API. |
Wow, we thought of going together, as you said, I wrote another framework. https://github.com/132yse/voe There, I try to run voe is still in the prototype stage. If it works possible, I can improve it and change the repo to English. But in fact, it's very difficult, because message posting is limited. It can't pass functions, DOM, so most diff algorithms can't be used. I don't think fre is worth making such a big change
Yes, we should. This issue is just a discussion about v2. In fact, V1 still needs to be tested completely and maintained for a long time. |
Voe looks interesting, I hadn't seen this. Also has the initialization wrapper function I talked about in #106. I need to take a closer look at this at some point. 🙂
From my point of view, Not sure, I guess I'd need to see specifically what you mean... |
I think about it again. Maybe we can do memo component without any APIs. Every component can be called pureComponent by default. |
https://github.com/132yse/fre/blob/master/demo/src/memo.js |
I'm trying to improve the performance of fre. Here are two main ideas
Memo component by default
Maybe we can memo all components by default, every component is pureComponent, without additonal API
the ListView will rerender while
state.list
changed. It like useMemo, but for compoent rerender.Suspense Boundary
Boundary components have similar APIs, it can use for es6 import()
When OtherCompont have not resolve,it will render loading.
Error Boundary
When Child catch any errors,it will render borken.
The text was updated successfully, but these errors were encountered: