hotwired / hotwire-native-site

Hotwire Native
9 stars 5 forks source link

Show a global path config rule so it's more clear how rule cascading works #14

Closed jayohms closed 1 month ago

jayohms commented 6 months ago

In all of our apps, we now use a global rule at the top of the our path config files to explicitly specify path config properties if there are no subsequent matching rules. I find this helpful to understand the concept as rules get more granular below the global rule.

Can we use this approach in the documentation? Here's what it'd look like:

{ 
  "rules": [
    {
      "patterns": [
        ".*"
      ],
      "properties": {
        "context": "default",
        "presentation": "default",
        "pull_to_refresh_enabled": true
      }
    },
    {
      "patterns": [
        "/new$"
      ],
      "properties": {
        "context": "modal",
        "pull_to_refresh_enabled": false
      }
    }
  ]
}
joemasilotti commented 6 months ago

Yeah, I think there could definitely be a section on cascading rules. But I'm not quite sure the best spot for it just yet.

Can you do a review of the existing path configuration documentation (overview, reference, and iOS) first? I think having a second set of eyes might make it more clear where this should go, after (most likely) restructuring some of the existing documentation.