How to retrieve component's properties in order reflecting the UI setting?

componentPropertyDefinitions is a “new” way to return defined properties of the ComponentNode or ComponentSetNode.

Unfortunately, the object it returns has keys (= property names) sorted in unknown order, rather than reflecting order set in the UI.

Deprecated variantGroupProperties seems to keep the order of variants sorted as in the UI. It really helps e.g. in organizing variants accoring to intended order.

Is there any way to retrieve component’s properties in the order, that was set up in the UI?

Additional reference: Version 1, Update 49

I realized that variantGroupProperties is not predictable as well – in terms of retrieving variant order.

However, I found an ugly trick. I can get variants in proper order when I use componentProperties on an InstanceNode. This way I can “silently” create any instance from component set and read ordered properties from it.

I don’t like it, so maybe someone would find better solution to this.