Skip to content

Conversation

@jayohms
Copy link
Contributor

@jayohms jayohms commented Mar 25, 2025

This supersedes #79 with additional improvements.

Previously the JSON parser would only accept strings as possible values for properties. Because of this it was impossible to create a custom data structure inside the path-configuration file.

The iOS configuration parser does support non string values, intent here is to match parity with the other platform.

In doing so it allows for custom extension functions to be added to PathConfigurationProperties which allows developers to serialize their own data structures.

Additionally, now settings accepts custom data structures.

Previously the JSON parser would only accept strings as possible values for `properties`.
Because of this it was impossible to create a custom data structure inside the path-configuration file.
The iOS configuration parser does support non string values, matching parity with the other platform.

In doing so it allows for custom extension functions to be added to `PathConfigurationProperties` which allows
developers to serialize their own data structures.
* main: (60 commits)
  Support the path config `animated` option, bringing it in line with the available iOS option
  Extract the destination animation logic, since it's getting complex
  Fix demo app native screen toolbar
  Fix when navigating from a modal sheet dialog -> modal sheet dialog with an ADVANCE action. Only one dialog is now permitted on top of the stack, so if there's already an active dialog, it will be dismissed before navigating to the next dialog.
  Rename the new path config ClientConfig class to LoadOptions to match the iOS APi
  Update val name from dismissToDefaultContext -> dismissModalContext
  Adjust modal animations further, so navigating to a modal context or dismissing the modal context always animates, regardless of a "replace" action.
  Always show the modal navigation animation, even when navigating from modal -> modal
  Fix modal enter/exit animations
  Update code comment
  Change how a modal is dismissed with a visit proposal "replace" action. First, pop the modal (acting as a "replace" action), then "advance" to the new visit proposal url.
  Fix tiny context mix-up in CONTRIBUTING.md
  Allow CI tests to run on PRs from external contributors
  remove `HotwireTests`
  `ClientConfig` data class & refactor
  Allow passing an optional ClientConfig when calling Hotwire.loadPathConfiguration() to pass custom HTTP headers when loading the path configuration file.
  remove func from HotwireConfig
  remove old tests
  remove singleton
  `PathConfigurationClientConfig` internal & `HotwireConfig` sets
  ...

# Conflicts:
#	core/src/main/assets/json/test-configuration.json
#	core/src/main/kotlin/dev/hotwire/core/turbo/config/PathConfiguration.kt
#	core/src/test/kotlin/dev/hotwire/core/turbo/config/PathConfigurationTest.kt
@jayohms jayohms merged commit a38460f into main Mar 31, 2025
1 check passed
@jayohms jayohms deleted the customer-configuration-properties branch March 31, 2025 17:28
leonvogt added a commit to leonvogt/hotwire-native-dev-tools that referenced this pull request Apr 27, 2025
…strings

In this Hotwire Native Android PR: hotwired/hotwire-native-android#114, they changed the properties from `HashMap<String, String>` to `HashMap<String, Any>`.
Since `HashMap<String, Any>` can't be serializable without additional effort, we simply try to convert the values to strings
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.

3 participants