Skip to content

Conversation

@Guardiola31337
Copy link
Contributor

@Guardiola31337 Guardiola31337 commented Apr 20, 2020

Description

This PR adds internal package to libdirections-hybrid, libdirections-offboard, libdirections-onboard and libnavigation-base. It also bumps dokka dependency version to 0.10.1

Splitting #2417 in different PRs

As this is going to be a big refactor the plan here is to open small PRs and move stuff incrementally making the review easier. Even trying to do so this first PR included changes in 67 files (mostly moving files around)

  • I have added any issue links
  • I have added all related labels (bug, feature, new API(s), SEMVER, etc.)
  • I have added the appropriate milestone and project boards

Goal

The goal here is to add internal package to 1.0 modules and the APIs designed only for local usage

Implementation

  • Move classes around to internal package
  • Add internal modifier
  • Fix package across codebase
  • Move RouteProgressObserver into libnavigation-base
  • Bump dokka dependency version to 0.10.1 in dependencies.gradle

Testing

  • I have tested locally (including SNAPSHOT upstream dependencies if needed) through testapp/demo app and run all activities to avoid regressions
  • I have tested via a test drive, or a simulation/mock location app
  • New and existing unit tests pass locally with my changes

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have updated the CHANGELOG including this PR

@Guardiola31337 Guardiola31337 added ✓ ready for review Core Work related to core navigation and integrations. labels Apr 20, 2020
@Guardiola31337 Guardiola31337 added this to the v1.0.0 milestone Apr 20, 2020
@Guardiola31337 Guardiola31337 requested a review from a team April 20, 2020 22:43
@Guardiola31337 Guardiola31337 self-assigned this Apr 20, 2020
@codecov-io
Copy link

codecov-io commented Apr 20, 2020

Codecov Report

Merging #2811 into master will increase coverage by 0.01%.
The diff coverage is 0.00%.

@@             Coverage Diff              @@
##             master    #2811      +/-   ##
============================================
+ Coverage     35.04%   35.05%   +0.01%     
  Complexity     2102     2102              
============================================
  Files           541      541              
  Lines         19322    19322              
  Branches       1829     1829              
============================================
+ Hits           6771     6774       +3     
+ Misses        11740    11738       -2     
+ Partials        811      810       -1     

@Guardiola31337 Guardiola31337 added the backwards incompatible Requires a SEMVER major version change. label Apr 20, 2020
Copy link
Contributor

@RingerJK RingerJK left a comment

Choose a reason for hiding this comment

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

Please check dokka configuration, because packages were changed so need to change them at dokka config 👀

* information.
*
* The latest route progress object can be obtained through the [RouteProgressObserver].
* The latest route progress object can be obtained through the [com.mapbox.navigation.base.trip.RouteProgressObserver.RouteProgressObserver].
Copy link
Contributor

Choose a reason for hiding this comment

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

typo

Suggested change
* The latest route progress object can be obtained through the [com.mapbox.navigation.base.trip.RouteProgressObserver.RouteProgressObserver].
* The latest route progress object can be obtained through the [com.mapbox.navigation.base.trip.RouteProgressObserver].

@file:JvmName("MapboxRouteOptionsUtils")

package com.mapbox.navigation.base.extensions
package com.mapbox.navigation.base.internal.extensions
Copy link
Contributor

@RingerJK RingerJK Apr 21, 2020

Choose a reason for hiding this comment

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

should fun RouteOptions.Builder.applyDefaultParams and fun RouteOptions.Builder.coordinates be internal?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thought about this too and IMO everything should be private until proven otherwise 😅 In other words, it's better to keep it internal and if customers request this we can always make it public afterwards (but not the other way around as we'd break SemVer 😉).

Copy link
Contributor

Choose a reason for hiding this comment

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

it cannot be internal, examples uses it. The same as above

@@ -1,4 +1,4 @@
package com.mapbox.navigation.base.extensions
package com.mapbox.navigation.base.internal.extensions
Copy link
Contributor

Choose a reason for hiding this comment

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

why do we need this internal?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Same as above. All these extensions are only used internally and I don't think they're that useful for developers as they can create their own. The less public APIs, the better. Otherwise we need to maintain them, we cannot change them without breaking SemVer, etc.

@Guardiola31337 Guardiola31337 force-pushed the pg-1.0-internal-refactor branch from bef249d to 3e11249 Compare April 21, 2020 13:41
@Guardiola31337 Guardiola31337 requested a review from a team April 21, 2020 13:42
@Guardiola31337
Copy link
Contributor Author

Addressed feedback. This is ready for another round of 👀 @mapbox/navigation-android

@Guardiola31337 Guardiola31337 force-pushed the pg-1.0-internal-refactor branch 2 times, most recently from 9fe521c to 994c0bc Compare April 21, 2020 14:18
@Guardiola31337 Guardiola31337 mentioned this pull request Apr 21, 2020
10 tasks
@file:JvmName("ContextEx")

package com.mapbox.navigation.base.extensions
package com.mapbox.navigation.base.internal.extensions
Copy link
Contributor

Choose a reason for hiding this comment

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

it cannot be internal, examples uses it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

examples is our test app, we can use it 😉

… libdirections-onboard and libnavigation-base and bump dokka dependency version to 0.10.1
@Guardiola31337 Guardiola31337 force-pushed the pg-1.0-internal-refactor branch from 994c0bc to 7c9fa60 Compare April 21, 2020 15:26
@Guardiola31337 Guardiola31337 requested a review from a team April 21, 2020 17:22
@Guardiola31337 Guardiola31337 merged commit 0f7cfe8 into master Apr 21, 2020
@Guardiola31337 Guardiola31337 deleted the pg-1.0-internal-refactor branch April 21, 2020 18:28
@@ -1,4 +1,4 @@
package com.mapbox.navigation.core.trip.session
package com.mapbox.navigation.base.trip

Choose a reason for hiding this comment

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

Any particular reason this was exposed? The observer is still tied to the MapboxTripSession, which is internal. Is there a scenario where the observer would be used without using core?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved it so it lives near the RouteProgress and the rest of contracts and models (as it is one of the main observers accessed by most of the modules and needed publicly for clients). Although, that's a great point. Currently MapboxTripSession lives in libnavigation-core and I can't think of any use case in which you might want to use the observer alone. Can move it back to libnavigation-core as part of the missing internal package refactoring #2417 of libnavigation-core 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backwards incompatible Requires a SEMVER major version change. Core Work related to core navigation and integrations.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants