-
Notifications
You must be signed in to change notification settings - Fork 5
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
Extract navigation-fragments
module from core
module
#51
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…navigation-related code
…the global configuration
cc @jhutarek mentioning you here, since I can only request one reviewer (while the repo is still private) |
mbarta
approved these changes
Jun 10, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good 💪 I only left a couple of suggestions ;)
navigation-fragments/src/main/java/dev/hotwire/navigation/config/Hotwire.kt
Outdated
Show resolved
Hide resolved
navigation-fragments/src/main/java/dev/hotwire/navigation/destinations/HotwireNavDestination.kt
Outdated
Show resolved
Hide resolved
…gation module to extend the Hotwire.* configuration options
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR extracts all the navigation + fragment concerns into a separate
navigation-fragments
module, so it's completely isolated from thecore
module. This new module will need to be consumed as a separate dependency by apps to obtain all the navigation + fragment features.The
core
module now only includes the basicTurbo
+Bridge
APIs and all theirWebView
concerns.This sets us up in the future to introduce new navigation/compose modules that can be used by an app instead of the
navigation-fragments
module. Thecore
module now has no knowledge of navigation concerns or references to fragments.The
navigation-fragments
module depends oncore
, but not the other way around. Since apps can now configure their entire app using theHotwire.*
object (seeDemoApplication.kt
), I had to separate the configuration namespace into two parts:navigation-fragments
module:Hotwire.*
core
module:HotwireCore.*
This allows the
core
module to access configuration options related tocore
features and thenavigation-fragment
module to access all configuration options.There's still future work that can be done to consolidate some code across the two modules, but from what I can tell those are all internal code concerns — not a public API concern. So we can continue to chip away at simplifying/streamlining down the road. Feel free to note any opportunities you see, but I may prefer to perform that work in future PRs if the public API isn't affected.
Note: I recommend pulling down the project so you can see the whole module structure so it's easier to the organization and packages.
Another note: I haven't setup artifact publishing support for this new module yet. I'll worry about that in another PR.
Closes #43