Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Camelcase all keys #4163

Closed
lucaswoj opened this issue Feb 1, 2017 · 3 comments
Closed

Camelcase all keys #4163

lucaswoj opened this issue Feb 1, 2017 · 3 comments
Labels
breaking change ⚠️ Requires a backwards-incompatible change to the API cross-platform 📺 Requires coordination with Mapbox GL Native (style specification, rendering tests, etc.)

Comments

@lucaswoj
Copy link
Contributor

lucaswoj commented Feb 1, 2017

From @lucaswoj on December 23, 2016 14:41

Working with Mapbox style spec objects in Javascript is less ergonomic because all the dashcase properties must be quoted when they are used as identifiers.

var layer = { 'line-color': 'blue' }
layer['line-color']

vs

var layer = { lineColor: 'blue' }
layer.lineColor

They look odd in conjunction with the camelcased source properties #175

Copied from original issue: mapbox/mapbox-gl-style-spec#638

@lucaswoj lucaswoj added the breaking change ⚠️ Requires a backwards-incompatible change to the API label Feb 1, 2017
@lucaswoj
Copy link
Contributor Author

lucaswoj commented Feb 1, 2017

From @tmcw on December 23, 2016 14:58

Oof, that is one breaking change, but I support it 100%. We used dashes in CartoCSS too, from the CSS lineage, and in simplestyle-spec, and they're just inconvenient for no reason. This would also bring property names closer to what @1ec5 wants on the native side.

@lucaswoj
Copy link
Contributor Author

lucaswoj commented Feb 1, 2017

From @1ec5 on December 23, 2016 18:5

I have no opinion either way. Camel case is always applied systematically, so it poses no barrier to people developing against our Android, iOS, or macOS SDKs, where we’ve exposed symbolic constants or method names instead of requiring strings to be hard-coded (as JavaScript does). Besides, the Android SDK uses SCREAMING_SNAKE_CASE too.

@1ec5 1ec5 added the cross-platform 📺 Requires coordination with Mapbox GL Native (style specification, rendering tests, etc.) label Feb 3, 2017
@jfirebaugh
Copy link
Contributor

Closing here; see #6584.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change ⚠️ Requires a backwards-incompatible change to the API cross-platform 📺 Requires coordination with Mapbox GL Native (style specification, rendering tests, etc.)
Projects
None yet
Development

No branches or pull requests

3 participants