Repository metrics
- Stars
- (477 stars)
- PR merge metrics
- (PR metrics pending)
Description
As discovered while trying to implement a new parameter, our URL building is not ideal. In this particular case, we URL-encode stuff twice: when we pass parameters to the builder and then in the builders themselves.
Most share pages use URL parameters, so wouldn't it be better for each social network to only define its main URL along with the needed parameters? Then, we can take the built-in URL and URLSearchParams to build the final URL.
A while ago, Dario did a similar thing, also adding a lot of other stuff. Since then, Shareon lost TypeScript, switched bundlers, heck, even the default branch is different. It might make more sense to re-implement this.
It is very important that the final size remains as small as possible, ideally under 1 kB for the ESM bundle. Use pnpm test to build and test for size. See also https://github.com/kytta/shareon/issues/62