Description
To verify the fixes for the regressions introduced in the v10 core.Config system, a new test case has been added: test/siesta/tests/config/CircularDependencies.mjs.
This test specifically targets the atomicity of core.Base#set() and ensures that all config hooks and field setters have a consistent, updated view of the instance's state during a batched update.
What the Test Verifies
The test creates a TestComponent with multiple reactive configs, a non-reactive config, a public class field, and a public field with a custom setter (customProp).
It then calls instance.set() with new values for all of these properties simultaneously and asserts the following:
afterSet<Config>() Hooks: Each afterSet hook correctly sees the new values of all other configs and fields that were part of the same set() call.
- Custom Field Setters: The custom setter for
customProp also correctly sees the new values of all reactive configs and public fields from the same batch.
- Partial Updates: It verifies that when only a single config is updated, the other properties on the instance retain their previous values.
Benefit
This test provides a critical safety net to prevent future regressions in the complex config initialization logic. It ensures that the set() method behaves as a predictable, atomic operation, which is fundamental to the framework's reactivity model.
Description
To verify the fixes for the regressions introduced in the v10
core.Configsystem, a new test case has been added:test/siesta/tests/config/CircularDependencies.mjs.This test specifically targets the atomicity of
core.Base#set()and ensures that all config hooks and field setters have a consistent, updated view of the instance's state during a batched update.What the Test Verifies
The test creates a
TestComponentwith multiple reactive configs, a non-reactive config, a public class field, and a public field with a custom setter (customProp).It then calls
instance.set()with new values for all of these properties simultaneously and asserts the following:afterSet<Config>()Hooks: EachafterSethook correctly sees the new values of all other configs and fields that were part of the sameset()call.customPropalso correctly sees the new values of all reactive configs and public fields from the same batch.Benefit
This test provides a critical safety net to prevent future regressions in the complex config initialization logic. It ensures that the
set()method behaves as a predictable, atomic operation, which is fundamental to the framework's reactivity model.