hypertrons-crx icon indicating copy to clipboard operation
hypertrons-crx copied to clipboard

[Refactor] use the extension framework `plasmo` to refactor Hypercrx

Open tyn1998 opened this issue 3 years ago • 2 comments

Description

We want to make Hypercrx available in Firefox(#499), even make it available in Safari someday. In the same time, we avoid introducing extra complexity into this project. That is, we do not like to write different code for different target platforms.

So plasmo comes to our aid. plasmo is a brand new extension framework for extension developers to start an extension project quickly. It abstracts away most of the manifest details and handles dev and product building processes for us. The most important thing is, it supports building extensions that are targeted to Chrome, Edge, and Firefox(mv2 only atm) in the same time, and even Safari is already on the agenda!

If turning to this framework, we will not need to worry about how to build extensions for different targets. What a relief.

There are other reasons:

  • plasmo takes turbo as its bundler, which can be 3x faster than webpack as they claimed. In extreme cases the number can be 300x.
  • and it also hides all details of how to start a devserver and how to build the product. so we don't need to worry about complex configurations.
  • it supports live-reload and HMR, which is already supported in Hypercrx, but was implemented without enough elegance.
  • built-in support for localization
  • automated submission (another feature that we also have)
  • good docs
  • good responsive community in Discord
  • ...

Apparently plasmo can do Hypercrx already can do(I believe they do them better), and it does more things which we are not able to reach at the moment. We may turn to this powerful framework to make Hypercrx project more robust and equipped with technologies of state of the art.

I suggest to create a new branch called refactor/plasmo in this repo. After all things are settled down, the branch will then be merged into master.

tyn1998 avatar Nov 23 '22 13:11 tyn1998

I would love to have a try as long as I have spare time for this. Can't wait to try out a new framework. 😺

wxharry avatar Oct 19 '23 02:10 wxharry

Do we still want to refactor with Plasmo?

wxharry avatar May 26 '24 01:05 wxharry