firebase-ios-sdk icon indicating copy to clipboard operation
firebase-ios-sdk copied to clipboard

[FR]: Add certain support for swift wasm

Open jesus-mg-ios opened this issue 2 years ago • 2 comments

Description

Swift wasm has been growing during the last few years, and it could be a good opportunity for apple developers to create websites reusing a great amount of code.

I propose giving support to it at least in two features: Firebase Firestore (basic support without persistence and observers) and firebase auth (very basic also).

https://swiftwasm.org

API Proposal

No response

Firebase Product(s)

Authentication, Firestore

jesus-mg-ios avatar Feb 17 '23 15:02 jesus-mg-ios

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

google-oss-bot avatar Feb 17 '23 15:02 google-oss-bot

Currently Firebase is written in a mix of C++, Objective-C, Objective-C++ and Swift. While the C++ and and Swift targets could compile to wasm, the Objective-C parts cannot. But there's an ongoing effort to port auth to pure Swift (see the auth-swift branch). With that in place it would be closer to be possible to compile to wasm. Unfortunately all the objective-c compatibility in the Swift code needs to be removed too, so it's not certain that it's feasible for the Firebase team to maintain too versions. But it will definitely be possible to fork the project and make it build on Linux, android, windows and wasm. Wrt Firestore I think it would be easier to wrap the REST APIs. And this might even be the easiest path forward for authentication too. You can use the identity platform rest APIs to authenticate and get an id token for the firestore rest APIs.

mortenbekditlevsen avatar Feb 18 '23 12:02 mortenbekditlevsen