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

Wasm/JS Resources, relative path #3413

Closed
dima-avdeev-jb opened this issue Jul 26, 2023 · 1 comment · Fixed by #3852
Closed

Wasm/JS Resources, relative path #3413

dima-avdeev-jb opened this issue Jul 26, 2023 · 1 comment · Fixed by #3852
Assignees
Labels

Comments

@dima-avdeev-jb
Copy link
Contributor

dima-avdeev-jb commented Jul 26, 2023

We need to add the ability to use a relative path to resources in the resource library in the JS sourceset.

The problem might be with this line of code:

Related slack discussion: https://kotlinlang.slack.com/archives/C01F2HV7868/p1689461585746039

@dima-avdeev-jb dima-avdeev-jb added enhancement New feature or request web labels Jul 26, 2023
@eymar eymar self-assigned this Aug 2, 2023
eymar added a commit that referenced this issue Oct 24, 2023
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 #3413 (currently it bothers our users)
@eymar
Copy link
Collaborator

eymar commented Oct 24, 2023

The fix is expected to be available in 1.5.10-rc02

eymar added a commit that referenced this issue Oct 24, 2023
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 #3413 (currently it bothers our users)

(cherry picked from commit 7380229)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants