Skip to content

Introduce runtime abstraction for faster initialization#53

Open
realfakenerd wants to merge 1 commit intozed-extensions:mainfrom
realfakenerd:runtime
Open

Introduce runtime abstraction for faster initialization#53
realfakenerd wants to merge 1 commit intozed-extensions:mainfrom
realfakenerd:runtime

Conversation

@realfakenerd
Copy link
Contributor

Re-opening the #49 here in a new branch, i think it will be better organized this way

This commit introduces a new `Runtime` abstraction to manage execution environments for the language server and package installation.

The `Runtime` enum currently supports `Bun` (if found on the system path) and falls back to Zed's built-in `Node.js` runtime.

This change allows the extension to leverage Bun for potentially faster package management and server execution when available, while maintaining compatibility with the standard Node.js environment.

The following changes were made:
- Add `src/runtime.rs` defining the `Runtime` enum and its methods (`new`, `server_command`, `install_package`, `latest_package_version`, `installed_package_version`).
- Update `Cargo.toml` to include `serde` and `which` dependencies.
- Refactor `src/svelte.rs` to use the new `Runtime` for package installation checks, version lookups, and starting the language server process.
@cla-bot cla-bot bot added the cla-signed label Nov 4, 2025
Copy link
Contributor

@MrSubidubi MrSubidubi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As mentioned, I am not really a big fan of this, not because I think we shouldn't support this, but because I think this needs better support in core.

That said, while I am tempted to close this, we can perhaps discuss having this configurable for this extension if you can outline some benefits and if we were to make this opt-in instead of automatic behavior.

Could you elaborate briefly why you think this provides an advantage for users in the context of this extension? I'd also not like for this to become something we add to each extension, but would like your thoughts, because frankly, you'll have more context here. Thanks

@MrSubidubi MrSubidubi added the awaiting info Issue that needs more information from the user label Dec 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting info Issue that needs more information from the user cla-signed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants