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

[Request]: share_plus refactor #3403

Open
miquelbeltran opened this issue Dec 18, 2024 · 0 comments · May be fixed by #3404
Open

[Request]: share_plus refactor #3403

miquelbeltran opened this issue Dec 18, 2024 · 0 comments · May be fixed by #3404
Assignees
Labels
all enhancement New feature or request share_plus Feature, Enhancement, Bug Fixes for Share Plus Plugin

Comments

@miquelbeltran
Copy link
Member

miquelbeltran commented Dec 18, 2024

Plugin

share_plus

Use case

Currently, the SharePlus class entry point has three major problems:

  • Functionality to share content is divided in three methods, this difficult implementing new features and leads to code duplication across these three.
  • Share functions have parameter creep, as functionality grows and more optional/named parameters are added. It is not clear what are all parameters doing (e.g. subject)
  • The SharePlus class exposes static methods, and it is not instantiable, this makes mocking/faking more difficult.

Proposal

  1. Unify the three methods into one.
  2. Create a ShareParams class with multiple share parameters (this class should be serializable so it can be passed to the native layer as well), and document those parameters.
  3. Make SharePlus instantiable and expose a singleton instance, so devs can choose how to use it.
  4. Expose old static methods with @deprecated annotation, so public API remains the same.

Related issues

@miquelbeltran miquelbeltran added enhancement New feature or request share_plus Feature, Enhancement, Bug Fixes for Share Plus Plugin all labels Dec 18, 2024
@miquelbeltran miquelbeltran self-assigned this Dec 18, 2024
@miquelbeltran miquelbeltran linked a pull request Dec 18, 2024 that will close this issue
16 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
all enhancement New feature or request share_plus Feature, Enhancement, Bug Fixes for Share Plus Plugin
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant