-
Notifications
You must be signed in to change notification settings - Fork 3
feat: Encapsulate Platform Conditional Exports #583
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
feat: Encapsulate Platform Conditional Exports #583
Conversation
- Create entry point files for 7 modules:
- ip_getter, url_helper, export_selector, get_log_selector,
client_type, assign_ip (new entry points)
- Add mobile_assign_ip.dart (no-op implementation for native)
- Update 17 consumer files to use clean single imports
- Add platform-conditional-exports-audit.md documentation
This eliminates exposed conditional imports in consumer files.
Consumers now only need to import the entry point file.
Modules encapsulated:
1. ip_getter (5 consumers)
2. url_helper (5 consumers)
3. export_selector (2 consumers)
4. get_log_selector (1 consumer)
5. client_type (1 consumer)
6. assign_ip (3 consumers)
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
||||||||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||
User description
Summary
Encapsulated all platform-specific conditional imports into entry point files, eliminating exposed
if (dart.library.*)patterns in consumer files.Changes
New Entry Point Files Created (7 files)
lib/core/utils/ip_getter/ip_getter.dartlib/util/url_helper/url_helper.dart(refactored)lib/util/export_selector/export_selector.dartlib/util/get_log_selector/get_log_selector.dartlib/constants/client_type/client_type.dartlib/core/utils/assign_ip/assign_ip.dartlib/core/utils/assign_ip/mobile_assign_ip.dart(no-op native impl)Consumer Files Updated (17 files)
All consumer files now use clean single-line imports instead of conditional imports.
Benefits
Documentation
See
doc/audit/platform-conditional-exports-audit.mdfor full audit report.Verification
flutter analyzepassesflutter build websucceedsRelated Issue
Closes #582
PR Type
Enhancement
Description
Encapsulate platform-specific conditional imports into 7 new entry point files
Update 17 consumer files to use clean single-line imports instead of conditional logic
Add comprehensive audit documentation for platform conditional exports and service decoupling
Update UI kit library dependency from v2.10.3 to v2.10.4
Diagram Walkthrough
File Walkthrough
24 files
New entry point for IP getter moduleRefactored to entry point with conditional exportsNew stub implementation for URL helperNew entry point for assign IP moduleNew no-op mobile implementation for assign IPNew entry point for export selector moduleNew entry point for get log selector moduleNew entry point for client type constantsUpdate to use client_type entry pointUpdate to use url_helper entry pointUpdate to use ip_getter entry pointUpdate to use ip_getter entry pointUpdate to use ip_getter entry pointUpdate to use assign_ip entry pointUpdate to use url_helper entry pointUpdate to use assign_ip entry pointUpdate to use url_helper entry pointUpdate to use export_selector entry pointUpdate to use assign_ip entry pointUpdate to use url_helper entry pointUpdate to use url_helper entry pointUpdate to use ip_getter entry pointUpdate to use ip_getter entry pointUpdate to use export and log selector entry points2 files
Comprehensive audit report for platform conditional exportsService decoupling audit documenting JNAP coupling status1 files
Update UI kit library dependency to v2.10.4