8000 Hide serialization implemenation to client apps by svara · Pull Request #5 · hotwired/strada-ios · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Hide serialization implemenation to client apps #5

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 8000 you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Aug 2, 2023
Merged

Conversation

svara
Copy link
Collaborator
@svara svara commented Jul 26, 2023

This PR hides the serialization by introducing an internal InternalMessage class and extracts the related code from the Message.
The public Message's data has changed from [String: AnyHashable] to String. This way we discourage users of pulling out values individually.

Other changes:

  • Added tests for InternalMessage.
  • Updated tests for Message.
  • Added a couple of extensions.

@svara svara requested a review from jayohms July 26, 2023 13:48
Copy link
Collaborator
@jayohms jayohms left a comment

Choose a reason for hiding this comment

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

Lovely! And thanks for the extra tests 👍

Comment on lines +76 to +79
// public func reply(to message: Message, with data: MessageData) {
// let replyMessage = message.replacing(data: data)
// callBridgeFunction("send", arguments: [replyMessage.toJSON()])
// }
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is an interesting approach, I didn't realize that there was a reply() in the iOS library. Let's leave this commented out for now to see if we want to offer this in both the iOS and Android libraries. I do like the language that it makes it clear that you're replying to a previously handled message. I'll think about this some more.

Copy link
Collaborator
@jayohms jayohms left a comment

Choose a reason for hiding this comment

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

Looks great, thank you @svara!

@svara svara merged commit a64c81d into main Aug 2, 2023
@jayohms jayohms deleted the internal-message branch September 27, 2023 19:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0