Skip to content

1.5.10-dev1246

Pre-release
Pre-release
Compare
Choose a tag to compare
@jb-compose-bot jb-compose-bot released this 25 Oct 12:52
CfW: Allow web resource routing configuration (#3852)

This commit changes the default resource routing behaviour:
- It used to search for a file in the root directory (on a domain level)
- After this change, it will search for a file relatively to the current
url segment

Besides that, we add a small configuration to let developers change the
default behaviour when needed.

___

usage examples:

```kotlin
// 1
configureWebResources {
   setResourceFactory { path -> urlResource("/myApp1/resources/$path") }
}

// 2
configureWebResources {
  setResourcelFactory { path -> urlResource("https://mycdn.com/myApp1/res/$path") }
}
 ```

___
This will fix https://github.com/JetBrains/compose-multiplatform/issues/3413 (currently it bothers our users)

(cherry picked from commit 73802292cecf9db4bb972421ea8a19a1301c6820)