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: Reduce reliance of the package on 3rd party dependencies #72

Merged

Conversation

TesteurManiak
Copy link
Contributor

I'm seeing that this package has a lot of 3rd party dependencies that could be avoided. This is not good as some might conflict in projects that also depend on it (and it might also make the maintenance more cumbersome).
This PR aims to reduce the number of dependencies to its bare minimum.

Removed dependencies

  • collection -> implemented firstWhereOrNull locally
  • equatable -> override equality operator and hashCode for the classes that needed it
  • meta -> Refactored PhoenixSocketOptions so it can be made const
  • pedantic -> Not needed and deprecated
  • quiver -> Replaced ListMultimap<String, void Function(PushResponse)> with a Map<String, List<void Function(PushResponse)>>

I've also bumped the version of the dev dependencies and bumped the minimum version of the Dart SDK to 3.0.0 so pattern matching can be used.

Copy link

@ndelanou ndelanou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if you should get rid of the collection package.
We could bump it by a few versions since you are now targeting sdk >= 3.0.0

lib/src/push.dart Outdated Show resolved Hide resolved
lib/src/push.dart Outdated Show resolved Hide resolved
@TesteurManiak
Copy link
Contributor Author

I'm not sure if you should get rid of the collection package.

collection was only used for firstWhereOrNull, I don't really see the dependency should be kept for such a simple extension. 🤔

lib/src/push.dart Outdated Show resolved Hide resolved
lib/src/message.dart Outdated Show resolved Hide resolved
lib/src/message.dart Outdated Show resolved Hide resolved
lib/src/message.dart Outdated Show resolved Hide resolved
lib/src/events.dart Outdated Show resolved Hide resolved
lib/src/events.dart Outdated Show resolved Hide resolved
lib/src/events.dart Outdated Show resolved Hide resolved
lib/src/events.dart Outdated Show resolved Hide resolved
lib/src/push.dart Outdated Show resolved Hide resolved
lib/src/push.dart Outdated Show resolved Hide resolved
lib/src/push.dart Show resolved Hide resolved
@TesteurManiak TesteurManiak requested a review from matehat April 9, 2024 09:12
@matehat matehat merged commit 2f9c2e5 into braverhealth:master Apr 9, 2024
1 check passed
@TesteurManiak TesteurManiak deleted the refactor/reduce-dependencies branch April 9, 2024 18:23
s6o pushed a commit to s6o/phoenix-socket-dart that referenced this pull request May 23, 2024
…raverhealth#72)

* refactor: remove dependency to pedantic

* refactor: removed equatable

* refactor: enforce typing of MessageSerializer callbacks

* refactor: removed dependency to meta

* chore: bump dev_dependencies

* refactor: removed dependency to collection

* refactor: removed dependency to quiver

* refactor: made PhoenixSocketEvent const

* refactor: set empty list for receivers

* refactor: one line addition to list

* refactor: one line clear

* refactor: feedbacks

* refactor: feedbacks

* refactor: expression bodies

* refactor: 1 line receivers assignation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants