Proposal for refactoring variant definition architecture #1647
+231
−168
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR outlines a proposed architectural refactoring of variant definitions within the MeshCore ecosystem. The t114 variant has been refactored as a proof-of-concept implementation. This proposal seeks to determine whether this architectural pattern should be adopted for all variant definitions. before investing more effort into it.
Current variant definitions suffer from significant maintainability challenges. The prevalent practice of copying and pasting configuration sections between variants has resulted in fragmented, inconsistent definitions.
This implementation introduces a modular environment composition system designed to maximize reusability and simplify the creation of new board targets. The refactored t114 variant demonstrates how board targets can be assembled from pre-built, reusable components rather than defined as monolithic configurations.
The core innovation is a library of standardized environment modules that can be mixed and matched to build new targets. Instead of starting from scratch or copying entire configurations, developers can now select base components, combine functionality and customize only what's necessary . This approach makes building new targets significantly easier and faster as common functionality is packaged into reusable modules that can be included with a single reference.
The modular architecture also improves consistency across targets. When a module is updated or improved, all targets using that module benefit automatically. This eliminates the need to manually propagate version upgrades or enhancements across dozens of individual variant files.
@ripplebiz @liamcottle @recrof @fdlamotte