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

How to load ressource at runtime? #97

Closed
wiiznokes opened this issue Dec 11, 2023 · 7 comments · Fixed by #106
Closed

How to load ressource at runtime? #97

wiiznokes opened this issue Dec 11, 2023 · 7 comments · Fixed by #106

Comments

@wiiznokes
Copy link
Contributor

Is there plan to make a loader ressource path or somethings? It would be usefull.

@denjell-crabnebula
Copy link
Contributor

denjell-crabnebula commented Dec 12, 2023

These are generally taken care of by the framework, I humbly recommend https://tauri.app

It has two methods that might be helpful.

https://tauri.app/v1/guides/building/sidecar
https://tauri.app/v1/guides/building/resources

@denjell-crabnebula
Copy link
Contributor

Of course if I misunderstood your question, please feel free to reopen and clarify what you need. :)

@wiiznokes
Copy link
Contributor Author

I'm not using tauri 🥲
What about a new crate that tauri could depend on? Like app_updater ?

@denjell-crabnebula
Copy link
Contributor

That's what this is generally for, but we hadn't planned to rebuild Tauri in every possible way with cargo packager. I understand your request, of course. This is not currently planned, but a PR or a more fleshed out feature request with details might be worth considering.

@wiiznokes
Copy link
Contributor Author

wiiznokes commented Dec 12, 2023

I would be happy to make a PR for that. I'm thinking it just a crate that search CARGO_PACKAGER_FORMAT env variable, and provide a impl for each formats.

What would be the name of this crate tho ?

a more fleshed out feature request

You mean in this issue, or there is another process i'm not aware of ?

@amr-crabnebula
Copy link
Collaborator

amr-crabnebula commented Dec 13, 2023

Unfortunately, since cargo-packager is just a tool and not supposed to be a dependency of your app, this has to be done in one of two ways:

  • a separate crate e.g. cargo-packager-resource-resolver
  • outline and document how the resources are copied over in the final bundle and maybe provide and example of a resource resolver implementation that can be copy/pasted.

@wiiznokes
Copy link
Contributor Author

Ok, I will try to works on the first option when i find time, thanks

@amr-crabnebula amr-crabnebula linked a pull request Jan 23, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants