Open jasekiw opened 1 year ago
There's two ways to opt-in or out of Forgetti partially:
include
to define which parts of your project should be compiled. /* @forgetti skip */
to disable optimization on selected parts of your code.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.
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.
Well the inverse is quite difficult to do because it has to match the include
config first, which is kinda counter-intuitive.
I heavily rely on /* @forgetti skip */
and webpack loader's test
, include
and exclude
for the gradual adoption, because:
forgetti
(I have discussed this with @lxsmnsyc on his discord server before about TanStack Table React). You will likely need to wrap them with your own hook and exclude it from the optimization using /* @forgetti skip */
.forgetti-loader
.can not read property of undefined
errors a lot during the adoption process.
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!