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

Cocoapods integration #91

Merged
merged 47 commits into from
May 19, 2023
Merged

Cocoapods integration #91

merged 47 commits into from
May 19, 2023

Conversation

nakajima
Copy link
Contributor

@nakajima nakajima commented Apr 18, 2023

Overview

Issue: xmtp/xmtp-react-native-old#10

This PR represents the changes needed to package xmtp-ios into an XMTP cocoapod.

The major changes are:

  1. Replace references to 'xmtp/proto' with buf Use Buf to generate proto code #93
  2. Use the XMTPRust cocoapod to replace gRPC and other non-cocoapod-compatible code such as some secp256k1 operations (xmtp-rust-swift)
  3. Change ApiClient and other Swift classes to accommodate XMTPRust, specifically in KeyUtil.swift and for signature verification logic

Diagram

See https://github.com/xmtp/xmtp-rust-swift#diagram

Releases

From this branch we've released:

  • 0.1.3-beta0 - this is the first XMTP cocoapod release, targeting XMTPRust 0.1.2-beta0 which did unnecessary JSON serialization in the Rust<>Swift boundary and had broken streaming (only got first item). Pagination info not returned by API.
  • 0.2.0-alpha0 - do not use, this release did not properly handle Pagination info from query and therefore only returns the first 100 elements of a query
  • 0.2.1-alpha0 - targets XMTPRust 0.2.2-beta0 - Does not use serialization in Rust<>Swift boundary, instead converts between RustVec and Data. Returns pagination info in query and has working streaming.

Tests

  • Ensure all unit tests pass (with a local node)
  • Added new PaginationTests which exercise Pagination, one of the trickier parts of the ApiClient migration to Rust code
  • XCode cloud keeps failing, seems related to misconfigured XMTP scheme

Michael Xu and others added 21 commits May 10, 2023 17:31
* wip: does not build yet, no progress on subscribe needs AsyncIterator

* fix: some tests pass, subscribe still not implemented

* feat: initialize rust client outside of GRPCApiClient

* feat: partial integration of newest Rust<>Swift bindings

* feat: implement polling subscribe

* test: add test for content in testStreamingMessagesFromV2Conversations

* feat: working if you comment out NotificationService logic

* Get tests building again

* Cleanups

* Format

* Ignore pods

* Updates

* Update package.resolved

* Fix lint

* Fix more lint

* update pod

* Bump XMTPRust version

* Get example app building again

* Move everything to cocoapods

* Get rid of cocoapods for the example app

* Try to get XMTP buildable for testing

* Fix test building

* wip: tests seemed to pass

* fix: reset the cocoapod

* fix: tests pass with new paging info changes, removed some printlns, need to address QueryResponse ownership

* fix: upgrade to XMTPRust=0.2.2-beta0 to attempt to fix Package.resolved issue in Xcode cloud

* fix: delete Package.resolved from xcshareddata

* fix: attempt to use Package.resolved from a passing commit

* fix: open Example app and let swift re-resolve

* fix: use package.resolved after running example app successfully

* fix: try to undo changes to XMTP.xcscheme

---------

Co-authored-by: Michael Xu <[email protected]>
@michaelx11 michaelx11 force-pushed the cocoapods-integration branch from e2776e7 to 25353ef Compare May 11, 2023 00:51
@michaelx11 michaelx11 marked this pull request as ready for review May 17, 2023 01:35
@michaelx11 michaelx11 requested a review from a team as a code owner May 17, 2023 01:35
@michaelx11
Copy link
Contributor

@nakajima - thoughts on the Example app? I think it's half-configured for Cocoapods and half-configured for Swift Package Manager. I get redefinition errors unless I nuke all the pods in the Podfile.

@nplasterer nplasterer merged commit dc2040a into main May 19, 2023
@nplasterer nplasterer deleted the cocoapods-integration branch May 19, 2023 19:16
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.

4 participants