Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

[ios, macos] Deprecate trafficDayStyleURL and trafficNightStyleURL#9918

Merged
fabian-guerra merged 3 commits into
release-ios-v3.6.0-android-v5.1.0from
fabian-update-core-styles
Sep 15, 2017
Merged

[ios, macos] Deprecate trafficDayStyleURL and trafficNightStyleURL#9918
fabian-guerra merged 3 commits into
release-ios-v3.6.0-android-v5.1.0from
fabian-update-core-styles

Conversation

@fabian-guerra
Copy link
Copy Markdown
Contributor

@fabian-guerra fabian-guerra commented Sep 5, 2017

Deprecates styles according to the latest spec.

@fabian-guerra fabian-guerra self-assigned this Sep 5, 2017
@fabian-guerra fabian-guerra requested a review from 1ec5 September 5, 2017 20:16
@fabian-guerra fabian-guerra added this to the ios-v3.6.3 milestone Sep 5, 2017
Comment thread platform/darwin/src/MGLStyle.mm Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These comments say “Emerald”.

@fabian-guerra fabian-guerra force-pushed the fabian-update-core-styles branch from 9b2cfcf to 3934c78 Compare September 5, 2017 22:03
Comment thread platform/darwin/src/MGLStyle.h Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change renames the selector from -trafficDayStyleURLWithVersion: to -trafficDayStyleURL. This is a backwards-incompatible change. Consider retaining the original method name but deprecating it nonetheless.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@1ec5 I'm deprecating + (NSURL *)trafficDayStyleURL; and deleting trafficDayStyleURLWithVersion:(NSInteger)version is that ok or should I keep the later?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We shouldn’t delete anything without a major version bump. So we’ll need to keep both symbols and mark them both as deprecated.

@fabian-guerra fabian-guerra force-pushed the fabian-update-core-styles branch 2 times, most recently from 4474f33 to 6738042 Compare September 7, 2017 23:24
@kkaefer kkaefer added iOS Mapbox Maps SDK for iOS macOS Mapbox Maps SDK for macOS labels Sep 11, 2017
[MGLStyle satelliteStyleURL],
[MGLStyle satelliteStreetsStyleURL],
[MGLStyle trafficDayStyleURL],
[MGLStyle trafficNightStyleURL],
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For consistency with iosapp, we might as well keep the styles-as-URLs here, too.

styleURL = [MGLStyle trafficDayStyleURL];
break;
case 8:
styleURL = [MGLStyle trafficNightStyleURL];
Copy link
Copy Markdown
Contributor

@1ec5 1ec5 Sep 14, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The menu items themselves are defined in MapDocument.xib (for the toolbar) and MainMenu.xib (for the View menu). Removing the backing code without removing the UI elements leads to the assertion below when interacting with the UI elements.

@fabian-guerra fabian-guerra force-pushed the fabian-update-core-styles branch from 6738042 to efafdfa Compare September 14, 2017 17:48
Comment thread platform/macos/app/MapDocument.m Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To clarify, it’s fine to remove the deprecated styles from macosapp – after all, Emerald isn’t listed – but you need to remove them completely. Otherwise, any inconsistencies between this code and the XIBs could result in a crash.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed or kept, we should do the same here and in iosapp.

Comment thread platform/darwin/test/MGLStyleTests.mm Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be a good idea to add a \b where the ; was, to ensure that all the methods have the same parameter name (and not something like versions).

Comment thread platform/darwin/test/MGLStyleTests.mm Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should continue to test these versioned methods as long as they’re part of the API. To work around the deprecation warnings, use pragmas.

@fabian-guerra fabian-guerra force-pushed the fabian-update-core-styles branch from efafdfa to d392203 Compare September 15, 2017 18:09
Copy link
Copy Markdown
Contributor

@friedbunny friedbunny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but I defer to @1ễc5.

@fabian-guerra fabian-guerra force-pushed the fabian-update-core-styles branch from d392203 to 5a4e0c0 Compare September 15, 2017 18:35
Comment thread platform/darwin/src/MGLStyle.mm Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[MGLStyle trafficDayStyleURLWithVersion:1] ends up returning Traffic Day v2. This could be a breaking change for any developers calling this method.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@1ec5 I may misunderstood this but is it possible return a versioned style now that is deprecated? in the docs I wrote https://github.com/mapbox/mapbox-gl-native/pull/9918/files#diff-1d168de285fc4ba01ce48c4236f0b3ceR298

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-trafficDayStyleURLWithVersion: should return whatever version is specified, like it always has. -trafficDayStyleURL should return version 2. Both methods should be deprecated but should continue to work like they always have.

@fabian-guerra fabian-guerra force-pushed the fabian-update-core-styles branch from 5a4e0c0 to 0114484 Compare September 15, 2017 20:14
@fabian-guerra fabian-guerra force-pushed the fabian-update-core-styles branch from 0114484 to d369f8d Compare September 15, 2017 20:16
Copy link
Copy Markdown
Contributor

@1ec5 1ec5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interestingly, it looks like we were never testing the unversioned traffic methods in the first place.


/**
Returns the URL to the given version of the
Returns the URL to to the version 2 of the
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: “to to”.

@fabian-guerra fabian-guerra merged commit b2e33a4 into release-ios-v3.6.0-android-v5.1.0 Sep 15, 2017
@fabian-guerra fabian-guerra deleted the fabian-update-core-styles branch September 15, 2017 21:00
mappy-mobile pushed a commit to Mappy/mapbox-gl-native that referenced this pull request Oct 3, 2017
….1.4

* release-ios-v3.6.0-android-v5.1.0: (36 commits)
  [android] [auto] Update properties to version 5.1.4 in preparation for build.
  [android] - latLngBounds test
  [android] - update changelog for 5.1.4 release.
  bump MAS version number to 2.2.3 (mapbox#9901)
  [android] fix is download complete (a download is complete when count and required resources match and the download state is inactive) (mapbox#9913)
  [android] - avoid adding duplicate points to bounds
  [android] Clear out mapCallback's OnMapReadyCallbacks on onDestroy
  [android] - harden offline region deletion
  Do not check connection if it is local request
  [android] - disable rotation gesture when pinch zooming
  macos-v0.5.1
  [ios] Bump podspec to 3.6.4 (mapbox#10059)
  [android, ios, macos] Updated translations
  [core] make sure tiles are not treated as complete until all worker operations completed
  [core] keep tiles renderable even if a subsequent error occurs
  [ios] Be sure to get a BOOL value for nullable dict keys
  iosv3.6.3 podspec bump (mapbox#10008)
  [ios, macos] Deprecate trafficDayStyleURL and trafficNightStyleURL (mapbox#9918)
  [ios] Use constraints to manage ornament view placement (again)  (mapbox#9995)
  [ios] Canned spam coming from Transifex
  ...

# Conflicts:
#	platform/android/MapboxGLAndroidSDK/proguard-rules.pro
#	platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapGestureDetector.java
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

iOS Mapbox Maps SDK for iOS macOS Mapbox Maps SDK for macOS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants