Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor URL builder #61

Open
kytta opened this issue Jul 11, 2023 · 1 comment
Open

Refactor URL builder #61

kytta opened this issue Jul 11, 2023 · 1 comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@kytta
Copy link
Owner

kytta commented Jul 11, 2023

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 #62

@kytta kytta added enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers labels Jul 11, 2023
@kytta
Copy link
Owner Author

kytta commented Oct 26, 2023

An important note: This issue is blocked by pretty much every other issue. Using URL and URLSearchParams is a potentially breaking change, and I want to add support for as many new buttons as possible before finally releasing v3

kytta added a commit that referenced this issue Feb 5, 2024
Closes #61

Co-authored-by: Dario Vladovic <d.vladimyr@gmail.com>
kytta added a commit that referenced this issue Feb 5, 2024
Closes #61

Co-authored-by: Dario Vladovic <d.vladimyr@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant