Closed Mati365 closed 5 years ago
Could you provide a repro where this is an issue?
@eps1lon nope, due to most modern browsers preserve insert order for string keys(for now) :)
Let me rephrase that: Could you provide a repro where this is an issue if the order would not be preserved?
Overall I think this is more of an issue for jss
. for .. in
has no order specified at all so I don't think they intended for the order to matter. Looks like you're relying on an implementation detail.
@Mati365 Don't worry, we are good: http://2ality.com/2015/10/property-traversal-order-es6.html.
You can see the browsers support in https://kangax.github.io/compat-table/es6/#own_property_order.
Source
https://github.com/mui-org/material-ui/blob/master/packages/material-ui/src/Grid/Grid.js#L52
Expected Behavior
inject class name styles to Map or something else with guaranteed key order
Current Behavior
grid class names are injected info plain object without guaranteed key order
Context
styles in JSS are placed in
for in
loop: https://github.com/cssinjs/jss/blob/master/packages/jss/src/StyleSheet.js#L42but
for in
loop inobject
does not guaranteed key order https://stackoverflow.com/a/38218582