rx._x.asset improvements
Closes #3623
@benedikt-bartscher I've had a look at the changes and slept one night on it :) We have two different use cases that both deal with the asset folder:
- The file an URL is created for is already in the asset folder. In this case the function prepends the path with
"/assets/"and the presence of the file is checked. - The external asset use case where the file is located relative to the including
.pyfile and copied only whennot ENV_BACKEND_ONLYand the resulting file is returned as link.
On my option the automatic detection can be removed and then immediately raise an exception when shared=True, but the file is not located relative to the caller. A file name collision is very unlikely especially because assets/external is on .gitignore
Otherwise I think the implementation is cool.
One question: Is it wanted, that missing file presence of local assets should raise when ENV_BACKEND_ONLY? I thought that might be the case where no assets folder is present at all?
Marked this as draft until re-synced with main.
@masenf that's awesome, thank you very much. I will rebase our fork and report if everything still works