Skip to content

Conversation

@markphelps
Copy link
Contributor

Summary

This PR splits the monolithic Dart SDK into 3 platform-specific packages to address pub.dev's 100MB size limit restriction that was preventing package publication.

Problem

The current single Dart SDK package bundles native libraries for all platforms (Android, iOS, Linux, macOS, Windows), resulting in a package size of 105MB+ which exceeds pub.dev's 100MB limit. This prevents the package from being published to pub.dev.

Solution

Split the SDK into 3 platform-specific packages:

  • flipt_client (v1.1.0): Desktop/server platforms (Linux, macOS, Windows) ~48MB
  • flipt_client_android (v0.1.0): Android-specific package ~12MB
  • flipt_client_ios (v0.1.0): iOS-specific package ~40MB

Changes

Package Structure

  • Created separate package directories for flipt-client-dart-android and flipt-client-dart-ios
  • Each package contains only the native libraries for its target platform
  • All packages share the same Dart API for consistency

Base Package Updates

  • Removed Android and iOS platform support from base flipt_client package
  • Added platform detection that throws helpful errors directing mobile users to the correct package
  • Updated pubspec.yaml to remove mobile platform declarations

Build System Updates

  • Modified package/ffi/sdks/dart.go to build 3 separate packages
  • Each package includes only its platform-specific native libraries
  • Build process handles packaging for all three packages

Release System Updates

  • Added DartAndroidSDK and DartiOSSDK classes to release scripts
  • Updated release.py to support all three Dart packages
  • Each package can be versioned and released independently

Documentation

  • Created README files for each new package with platform-specific installation instructions
  • Updated main package README to guide users to the appropriate package for their platform
  • Clear migration path for existing users

Benefits

✅ All packages stay under pub.dev's 100MB limit
✅ Reduced download size for users (only get libraries for their platform)
✅ Maintains same API across all packages
✅ Allows independent versioning and releases per platform
✅ No breaking changes for desktop/server users

Testing

  • Verified all packages resolve dependencies correctly with flutter pub get
  • Package structure follows Dart/Flutter conventions
  • Build scripts compile without errors

Migration

  • Desktop/server users: No changes needed, continue using flipt_client
  • Android developers: Switch to flipt_client_android
  • iOS developers: Switch to flipt_client_ios
  • Base package provides helpful error messages for mobile platforms

Fixes #1139

Split the monolithic Dart SDK into 3 platform-specific packages to
address pub.dev's 100MB size limit:

- flipt_client: Desktop/server platforms (Linux, macOS, Windows) ~48MB
- flipt_client_android: Android-specific package ~12MB
- flipt_client_ios: iOS-specific package ~40MB

Key changes:
- Created separate package structures for Android and iOS
- Updated base package to exclude mobile platforms with helpful errors
- Modified build scripts to handle 3 separate package builds
- Updated release scripts to support new package structure
- Added platform detection to guide users to correct package

This allows each package to stay under pub.dev's size limit while
maintaining the same API across all platforms.

Signed-off-by: Mark Phelps <[email protected]>
@markphelps markphelps requested a review from a team as a code owner September 14, 2025 16:59
@dosubot dosubot bot added the size:XXL This PR changes 1000+ lines, ignoring generated files. label Sep 14, 2025
@markphelps markphelps marked this pull request as draft September 14, 2025 17:00
@dosubot dosubot bot added the enhancement New feature or request label Sep 14, 2025
@dosubot
Copy link

dosubot bot commented Sep 14, 2025

Related Documentation

Checked 3 published document(s). No updates required.

You have 3 draft document(s). Publish docs to keep them always up-to-date

How did I do? Any feedback?  Join Discord

@codecov-commenter
Copy link

codecov-commenter commented Sep 14, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.67%. Comparing base (f701007) to head (82cf2b9).
⚠️ Report is 676 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1318      +/-   ##
==========================================
- Coverage   80.36%   74.67%   -5.69%     
==========================================
  Files           8       10       +2     
  Lines        4165     4422     +257     
==========================================
- Hits         3347     3302      -45     
- Misses        818     1120     +302     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request size:XXL This PR changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Figure out how to trim Dart SDK size

2 participants