lxsmnsyc / forgetti

Solve your hook spaghetti (with more spaghetti). Inspired by React Forget.
https://forgetti.vercel.app/
MIT License
352 stars 7 forks source link

Question: Recommended approach for adoption #29

Open jasekiw opened 1 year ago

jasekiw commented 1 year ago

I am really intrigued that there is a version of react forget I can play with.

I am interested in starting to use this on a production application with around 40k lines of code.

Would you say this library is production ready? What would be the recommended approach for adopting this library into a production system like this? I imagine gradual adoption would be the safest route. ex. use it on all new components.

Thanks for this awesome library!

lxsmnsyc commented 1 year ago

There's two ways to opt-in or out of Forgetti partially:

This requires a lot of testing. I'm not sure how it went in production environment but maybe @SukkaW could share some of his insights since he has tested this more than I do.

jasekiw commented 1 year ago

I probably want to opt in on a component basis. Would it be possible to have a /* @forgetti include*/ or /* @forgetti enable */. Otherwise I might have to do MyComponent.forgetti.tsx for the include path to work.

I'm interested to see what @SukkaW has to say regarding his experience.

lxsmnsyc commented 1 year ago

Well the inverse is quite difficult to do because it has to match the include config first, which is kinda counter-intuitive.

SukkaW commented 1 year ago

I heavily rely on /* @forgetti skip */ and webpack loader's test, include and exclude for the gradual adoption, because: