LuCI: Better way to store hidden data

On the documentation page for LuCI.form.HiddenValue there is stated that it is for legacy purpose and

With client side handling of forms, there are more efficient ways to store hidden state data.

But which ways? Can you please point me to some technique how to store hidden data without creating hidden form fields?

E.g. I would like to always overwrite certain value in the configuration with constant. Or I would like to precalculate some value from other fields.