appwrite / sdk-for-flutter

[READ-ONLY] Official Appwrite Flutter SDK 💙
https://appwrite.io
BSD 3-Clause "New" or "Revised" License
363 stars 109 forks source link

🚀 Feature: WASM Support #214

Open lishaduck opened 1 month ago

lishaduck commented 1 month ago

🔖 Feature description

Update dependencies (& replace unmaintained dependencies, etc) to remove all dependence on dart:html, as it is not WASM compatible. You should use package:web & dart:js_interop for modern JS FFI.

🎤 Pitch

It allows migrating WASM-compatible apps to Appwrite, and migrating existing Appwrite apps to WASM. The WASM renderer is up to 3x faster[^1], and smaller[citation needed].

[^1]: Averaging 2x; source: https://medium.com/flutter/whats-new-in-flutter-3-22-fbde6c164fe3

👀 Have you spent some time to check if this issue has been raised before?

🏢 Have you read the Code of Conduct?

lishaduck commented 1 month ago

Known wasm-incompatible dependencies:

lishaduck commented 1 month ago

To work around this, put this in your pubspec.yaml:

dependency_overrides:
  flutter_web_auth_2: 4.0.0-alpha.8
  web_socket_channel: 3.0.1
lishaduck commented 1 month ago

Ok, looked into it more, looks like appwrite/sdk-generator#893 fixed the web_socket_channel, this repo just needs a re-gen (though it is unnecessarily breaking, v2 & v3 are virtually identical and you could support both with 0 effort). Appwrite shouldn't depend on alphas for flutter_web_auth_2, I can wait a few weeks.