dropbox / dropbox/pilot

Make model conform to Hashable

Open
#158 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Swift
Stars
113
Forks
19
PR merge metrics
No merged PRs in 30d

Description

Building on the work in #157 we can remove ModelVersion and ModelVersionMixer entirely from Pilot by making model conform to Hashable as part of its requirements.

Pros:
- Very common that we want `Hashable` (or at bare minimum `Equatable`) for our models,
- Swift 4.2 autogen'ing conformance for simple structs makes this not a pain for most models
- Makes things feel more swifty (having a separate hasher is definitely a drag in the post 4.2 world)

Cons:
- Forces `Equatable` for models (not sure this is actually bad but could be perceived to be higher bar than `ModelVersion` implementation)
- Can't separate out hashing for pilots benefit from generic hashing function (this is mostly a good thing, but we exploited this once or twice in $RIP_SECRET_PROJECT to drop noisy user updates for example)
- Breaking change

I'm solidly pro but wanted to check for feedback before proceeding (cc @wkiefer)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.