feat: add Flutter Web WASM support with OPFS interop extensions#176
feat: add Flutter Web WASM support with OPFS interop extensions#176
Conversation
…ository first before cex repository (#167) * fix(market-data-manager): default to KomodoPriceRepository Binance CexRepository supports a limited number of symbols and no longer lists KMD price history after the delisting * refactor(market-data-manager): deduplicate and clarify intent * refactor(review): remove zero check and add log statements also simplify the priceIfKnown function
Switch KDF to `dev` to allow usage of unreleased changes (particularly related to fees/priorities)
|
Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing Touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Pull Request Overview
This PR adds OPFS (Origin Private File System) interop extensions for Flutter web and consolidates web storage implementations in the dragon_logs package by migrating from legacy web APIs to modern standards.
- Implements OPFS JavaScript interop extensions with proper async iterator support for WASM compatibility
- Consolidates web storage by removing the legacy WebLogStorage class and using WebLogStorageWasm for all web builds
- Updates dependencies to use modern web APIs (
package:webinstead ofdart:htmlanddart:js)
Reviewed Changes
Copilot reviewed 13 out of 18 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/dragon_logs/lib/src/storage/opfs_interop.dart | New OPFS JavaScript interop extensions providing missing async iterator methods |
| packages/dragon_logs/lib/src/storage/web_log_storage_wasm.dart | New unified WASM-compatible web storage implementation using modern JS interop |
| packages/dragon_logs/lib/src/storage/web_log_storage.dart | Removed legacy web storage implementation |
| packages/dragon_logs/lib/src/storage/platform_instance/log_storage_web_platform.dart | Updated to use consolidated WebLogStorageWasm implementation |
| packages/dragon_logs/pubspec.yaml | Updated dependencies and version, removed legacy packages |
| packages/komodo_defi_types/lib/src/utils/mnemonic_validator.dart | Enhanced BIP39 mnemonic validation with proper checksum verification |
| packages/komodo_defi_sdk/lib/src/market_data/market_data_manager.dart | Added fallback logic between Komodo and CEX price repositories |
This commit implements comprehensive Flutter Web WASM support by: - Adding opfs_interop.dart with FileSystemDirectoryHandle extensions for values(), keys(), and entries() methods - Implementing JSAsyncIterator type definitions for proper JavaScript interop - Creating WebLogStorageWasm implementation compatible with both JS and WASM targets - Consolidating platform implementations to use unified WASM-compatible storage - Removing redundant WebLogStorage in favor of cross-compatible implementation - Updating platform configuration files for seamless WASM integration The implementation provides backwards compatibility with JavaScript compilation while enabling full WASM support through browser File System APIs that work consistently across both compilation targets. BREAKING CHANGE: WebLogStorage class has been removed in favor of WebLogStorageWasm
3a1e088 to
77ff4b2
Compare
|
Visit the preview URL for this PR (updated for commit 2b09291): https://komodo-defi-sdk--pr176-add-flutter-web-wasm-7cn7n15g.web.app (expires Tue, 12 Aug 2025 23:00:17 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: 7f9f5ac39928f333b6e8fcefb7138575e24ed347 |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Add GitHub authentication token support across all components that make GitHub API requests to resolve rate limiting issues during builds. Changes: - feat(coin-updates): add githubToken parameter to CoinConfigProvider - feat(coin-updates): support GitHub auth in CoinConfigRepository.withDefaults - fix(build-transformer): add debug logging for GitHub API authentication - fix(wallet-cli): auto-use GITHUB_API_PUBLIC_READONLY_TOKEN env variable - style(build-transformer): fix lint issues with cascade operations The CoinConfigProvider was making unauthenticated GitHub API requests, contributing to rate limit errors. All GitHub API clients now properly use the GITHUB_API_PUBLIC_READONLY_TOKEN environment variable when available, increasing rate limits from 60 to 5,000 requests per hour. Fixes: Rate limit exceeded errors during build process
cc7db0d to
5c27d5a
Compare
Roll KDF to the latest `dev` to ensure we are using the latest revision of all unreleased features.
Summary
This PR adds comprehensive Flutter Web WASM support to the Komodo DeFi SDK Flutter framework, implementing OPFS (Origin Private File System) interop extensions while also addressing several critical issues including API rate limiting and type safety improvements.
What's Changed
🚀 Major Features
dart:html/dart:jstodart:js_interopandpackage:web🔧 Critical Fixes
📦 Technical Implementation
OPFS Interop Extensions (
opfs_interop.dart)WASM-Compatible Storage (
web_log_storage_wasm.dart)GitHub API Improvements
Packages Modified
dragon_logskomodo_defi_frameworkkomodo_coin_updateskomodo_defi_sdkkomodo_wallet_build_transformerkomodo_wallet_cliBreaking Changes
file_system_access_apiandjsdependencies>=3.7.0for extension types supportWebLogStorageclass replaced withWebLogStorageWasmMigration Guide
For dragon_logs users:
>=3.7.0WebLogStorageimports should be replaced withWebLogStorageWasmFor build processes:
GITHUB_API_PUBLIC_READONLY_TOKENenvironment variable to avoid rate limits>=3.29.0 <3.36.0Browser Support
Supports all modern browsers with File System API:
Testing & Validation
dart analyze)Related Issues
Type of Change: ✨ New Feature + 🐛 Bug Fixes⚠️ Yes (
Breaking Change:
dragon_logsonly, with migration path)Documentation Updated: ✅ Yes