Is your feature request related to a problem? Please describe.
The existing config system had a subtle issue where Neo.core.Config instances were not consistently initialized with their specific isEqual and mergeStrategy properties defined in static config descriptors. This could lead to Neo.isEqual being used universally, even when a custom equality check was intended. Furthermore, the initial population of reactive configs could sometimes bypass or redundantly trigger beforeSet/afterSet hooks, leading to unexpected behavior or inefficient processing.
Describe the solution you'd like
The solution implemented ensures that Neo.core.Config instances are properly initialized with their corresponding isEqual and mergeStrategy from the static config descriptors.
src/core/Config.mjs: The constructor and initDescriptor were refined to accept the full descriptor. initDescriptor now correctly sets isEqual and mergeStrategy on the Config instance, but critically, it no longer pre-populates the internal #value from the descriptor's default value. This ensures that the beforeSet/afterSet hooks for reactive configs are correctly triggered only on the first actual value assignment.
src/core/Base.mjs: The getConfig method was updated to pass the relevant configDescriptor directly to the Neo.core.Config constructor. This guarantees that each Config instance is aware of its specific isEqual and mergeStrategy from the outset.
This approach maintains the separation of concerns: mergeStrategy is applied only for initial values in Base.mjs#mergeConfig, while isEqual and change notifications for subsequent updates are handled by the Config instance itself via the generated setters in Neo.mjs#autoGenerateGetSet.
Describe alternatives you've considered
Initially, I considered having Neo.core.Config.set() handle the mergeStrategy for all updates, but this was clarified to be incorrect as mergeStrategy is strictly for initial value merging during instance creation. Another alternative involved passing the default value from staticConfig directly to the Config constructor, which would have led to redundant beforeSet/afterSet calls.
Is your feature request related to a problem? Please describe. The existing config system had a subtle issue where
Neo.core.Configinstances were not consistently initialized with their specificisEqualandmergeStrategyproperties defined in static config descriptors. This could lead toNeo.isEqualbeing used universally, even when a custom equality check was intended. Furthermore, the initial population of reactive configs could sometimes bypass or redundantly triggerbeforeSet/afterSethooks, leading to unexpected behavior or inefficient processing.Describe the solution you'd like The solution implemented ensures that
Neo.core.Configinstances are properly initialized with their correspondingisEqualandmergeStrategyfrom the static config descriptors.src/core/Config.mjs: TheconstructorandinitDescriptorwere refined to accept the full descriptor.initDescriptornow correctly setsisEqualandmergeStrategyon theConfiginstance, but critically, it no longer pre-populates the internal#valuefrom the descriptor's default value. This ensures that thebeforeSet/afterSethooks for reactive configs are correctly triggered only on the first actual value assignment.src/core/Base.mjs: ThegetConfigmethod was updated to pass the relevantconfigDescriptordirectly to theNeo.core.Configconstructor. This guarantees that eachConfiginstance is aware of its specificisEqualandmergeStrategyfrom the outset.This approach maintains the separation of concerns:
mergeStrategyis applied only for initial values inBase.mjs#mergeConfig, whileisEqualand change notifications for subsequent updates are handled by theConfiginstance itself via the generated setters inNeo.mjs#autoGenerateGetSet.Describe alternatives you've considered Initially, I considered having
Neo.core.Config.set()handle themergeStrategyfor all updates, but this was clarified to be incorrect asmergeStrategyis strictly for initial value merging during instance creation. Another alternative involved passing the default value fromstaticConfigdirectly to theConfigconstructor, which would have led to redundantbeforeSet/afterSetcalls.