-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Remove Hardcoded Version Numbers - Implement Native-as-Source Version Management
Problem
The application currently has hardcoded version numbers scattered across the codebase, which leads to:
-
Version drift: App version is defined in multiple places:
- Android
build.gradle(versionName) - iOS
project.pbxproj(MARKETING_VERSION) package.jsonfiles- Hardcoded strings in TypeScript files (
FormulusMessageHandlers.ts,FormulusInterfaceDefinition.ts)
- Android
-
Maintenance burden: Developers must manually update versions in multiple locations, increasing the risk of:
- Forgetting to update a location
- Version mismatches between platforms
- Inconsistent versioning across the monorepo
-
No single source of truth: It's unclear which file is authoritative, making releases error-prone.
Current State
Hardcoded Versions Found:
ode/formulus/src/webview/FormulusMessageHandlers.ts:'0.1.0-native'ode/formulus/src/webview/FormulusInterfaceDefinition.ts:'1.1.0'ode/formulus-formplayer/src/FormulusInterfaceDefinition.ts:'1.1.0'
Native Configs:
- Android:
android/app/build.gradle→versionName = "1.0" - iOS:
ios/Formulus.xcodeproj/project.pbxproj→MARKETING_VERSION = 1.0
Requirements
- Single source of truth: Native platform configs (Android
versionName, iOSMARKETING_VERSION) should be the authoritative source - No hardcoded versions: Remove all hardcoded version strings from source code
- Automatic sync: Version should propagate automatically to:
- React Native app code (via
AppVersionServiceor generated constants) - Web component (
formulus-formplayer) - Any other consumers
- React Native app code (via
- Build-time generation: Version constants should be generated at build time, not runtime
- Interface version separation: API/interface compatibility version should be separate from app version (manually maintained, bumped on breaking changes)
Expected Solution
Implement a version management system that:
- Reads version from native configs (Android
build.gradleas primary, iOS as validation) - Generates
version.tsfiles at build time for bothformulusandformulus-formplayer - Uses
react-native-device-infofor runtime version retrieval (which reads from native) - Keeps interface version (
FORMULUS_INTERFACE_VERSION) separate and manually maintained - Integrates with existing build scripts (
prebuild,prestart)
Benefits
- ✅ Eliminates version drift
- ✅ Reduces manual maintenance
- ✅ Prevents release errors
- ✅ Clear, predictable versioning workflow
- ✅ Follows React Native best practices
Acceptance Criteria
- No hardcoded version strings in source code
- Native configs are the single source of truth
- Version automatically syncs to all consumers
- Build scripts regenerate version files automatically
- Interface version is separate from app version
- Documentation updated with versioning workflow
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request