Which Redux Lib would you guys indicate to start persistent extension development ?

208 views
Skip to first unread message

Claudio Felipe Carvalho Vilas Boas

unread,
Mar 16, 2021, 10:30:32 AM3/16/21
to Chromium Extensions, amandago...@gmail.com
We are developing a crypto wallet as  chrome extension using React and Redux. 
For using Redux it seemed the best solution would be use some of these libraries: 


Is there any recommendation on it ? Using redux is viable for good extension development ? 


Cuyler Stuwe

unread,
Mar 16, 2021, 1:26:56 PM3/16/21
to Chromium Extensions, claudiocarva...@gmail.com, amandago...@gmail.com
Do you even really need Redux...?

I have my own Manifest V2 template where I use Redux in the background and optionally in content scripts, but it seems like it's fundamentally working against where Google is taking extensions with Manifest V3.

Cuyler Stuwe

unread,
Mar 16, 2021, 1:27:49 PM3/16/21
to Chromium Extensions, Cuyler Stuwe, claudiocarva...@gmail.com, amandago...@gmail.com
In other words, it seems to me that you're doing this in reverse -- With a solution seeking a problem.

Claudio Felipe Carvalho Vilas Boas

unread,
Mar 16, 2021, 1:42:43 PM3/16/21
to Chromium Extensions, salem...@gmail.com, Claudio Felipe Carvalho Vilas Boas, amandago...@gmail.com

That's a good question, I'm reading more about manifest v3 and the service workers now (and it really seems that using redux without the possibility to have a persistent background page would be adding unnecessary work), but as I come more from a webapp background and have used redux for almost all Apps I have done... I'm getting stuck in designing a way my application could have it's states without a store(and a Provider wrapping the whole application from top-level). 
Do you have any alternative or example of application that have a good state control using react without redux ? 

Cuyler Stuwe

unread,
Mar 16, 2021, 1:48:01 PM3/16/21
to Claudio Felipe Carvalho Vilas Boas, Chromium Extensions, amandago...@gmail.com
Oh man, that's a huge can of worms with so many possibilities that it doesn't even really belong here in particular.

React has some state hooks and stuff that I haven't really looked into which are supposed to solve the "state problem" for React in particular.

Architecturally, a Chrome Extension though is multiple "applications" that talk to each other via ports -- In MV2 at least, you can sort of think of Content/Popup/etc. scripts and the Background Script as somewhat similar to a client/server architecture with isolated worlds between them. So you could still have e.g., a full React app in the Popup in the exact way you're accustomed in a web app, and just write messages back and forth treating the Background Script as a sort of "server".

Claudio Felipe Carvalho Vilas Boas

unread,
Mar 17, 2021, 10:38:07 AM3/17/21
to Chromium Extensions, salem...@gmail.com, Chromium Extensions, amandago...@gmail.com, Claudio Felipe Carvalho Vilas Boas
Yeah we ended up switching from MV3 back to MV2 for this project and using regular redux through a persistent Background Script, just saving the extension states at shutdown  and reloading it at startup... 
Hooks indeed helps a lot, just for managing lots of states in a deterministic way, the high order stuff as the layout provider it still helps me out to have some reducers.
But indeed it's a deep discussion, I'm still researching ways and possibilities to use other designs to get good state flow on applications, always good to have new perspectives and possibilities to expand your skillset. 
Thanks for reaching out man,
Best Regards!
Reply all
Reply to author
Forward
0 new messages