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

Extract navigation-fragments module from core module #51

Merged
merged 12 commits into from
Jun 13, 2024
Merged

Conversation

jayohms
Copy link
Contributor

@jayohms jayohms commented Jun 6, 2024

This PR extracts all the navigation + fragment concerns into a separate navigation-fragments module, so it's completely isolated from the core 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 basic Turbo + Bridge APIs and all their WebView 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. The core module now has no knowledge of navigation concerns or references to fragments.

The navigation-fragments module depends on core, but not the other way around. Since apps can now configure their entire app using the Hotwire.* object (see DemoApplication.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 to core features and the navigation-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

@jayohms jayohms requested a review from mbarta June 6, 2024 14:54
@jayohms
Copy link
Contributor Author

jayohms commented Jun 6, 2024

cc @jhutarek mentioning you here, since I can only request one reviewer (while the repo is still private)

Copy link

@mbarta mbarta left a 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 ;)

@jayohms jayohms merged commit 6f6be7b into main Jun 13, 2024
1 check passed
@jayohms jayohms deleted the navigation-module branch June 13, 2024 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Extract navigation to a separate navigation-fragments module
2 participants