fix: don't ship global api bundle if withGlobalTauri is false#13033
Conversation
Package Changes Through 85ad03aThere are 12 changes which include tauri with minor, tauri-runtime with minor, tauri-runtime-wry with minor, tauri-utils with minor, tauri-cli with minor, @tauri-apps/cli with minor, @tauri-apps/api with minor, tauri-build with minor, tauri-plugin with minor, tauri-bundler with minor, tauri-codegen with minor, tauri-macros with minor Planned Package VersionsThe following package releases are the planned based on the context of changes in this pull request.
Add another change file through the GitHub UI by following this link. Read about change files or the docs at github.com/jbolda/covector |
…apps#13033) * fix: don't ship global api bundle if withGlobalTauri is false * Comment and prettier
…apps#13033) * fix: don't ship global api bundle if withGlobalTauri is false * Comment and prettier
|
I remember that in I want to upstream the runtime configuration |
Yeah, I think so, but only for the ones in tauri not the plugins, this PR just combined the logic together so that they are now bundled together |
|
So in reality, was I just taking advantage of a "bug"? |
I can't say if that was a bug or not to be honest since it can really be augured both ways
I don't think that's a good idea, that means we'll have to ship the scripts no matter what
Since it affects what we inject to the app's code directly, I think it makes more sense to stay in
If all you want is to set it to false through |
|
My idea is to add a feature similar to My use case is to precompile Tauri as a dynamic library or executable, so that users don't need a Rust compiler. I'll create a PR to try implementing this feature. It's somewhat similar to: impl Context {
/// tauri_dir: absolute path to `src-tauri/`
fn load_runtime_context(&mut self, tauri_dir: PathBuf);
}
This is somewhat similar to Python's initialization, where compile-time configuration is used by default, but some parts can be configured at runtime. |
|
Look at what we have in I don't fully understand what exactly you want to do with generating contexts at runtime though, like do you want to ship the app with all the config and capability files? (or it's just easier for the pytauri to work without the help of |
|
What I want is: I only ship a precompiled executable (or dynamic library), and users provide their own Not sure if I explained this clearly. |
|
Here is a practical usage example: https://github.com/pytauri/pytauri/tree/main/examples/tauri-app-wheel/python/src/tauri_app_wheel The prebuilt binary is downloaded from PyPI, while the Currently, I have hacked the |
|
I see now, after skimming through the code, correctly me if I'm wrong though So you're trying to mimic the |
Exactly.
There might be a slight difference from what I had in mind. If I understand correctly, it's impossible to avoid using macros entirely, because something always needs to be embedded (such as I'll submit a PR later, as long as someone is available to review it. |
Another effort to reduce bloat, we're currently shipping
bundle.global.js(~40KB currently) no matter if it's used or not, this PR changes it to use our existing codeplugin_global_api_scriptsfor the core plugins as wellReference: #12820