[GH-ISSUE #4904] [feature]: Update hoppscotch-selfhost-desktop to Tauri v2 #1848

Closed
opened 2026-03-16 22:04:34 +03:00 by kerem · 0 comments
Owner

Originally created by @ImNicolasTheDev on GitHub (Mar 18, 2025).
Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/4904

Is there an existing issue for this?

  • I have searched the existing issues

Summary

The package hoppscotch-selfhost-desktop should be updated to Tauri v2. The doc to update from Tauri v1 can be found here: https://v2.tauri.app/start/migrate/from-tauri-1/
Some work needs to be done to update the rust code, as mentioned in this issue:

TLDR is basically that, the references in hoppscotch-desktop would have to be updated to v2 of tauri (right now rc.1 is available, which is suboptimal). Also after performing the migration, more code changes in packages/hoppscotch-selfhost-desktop/src/platform/auth.ts would have to be made, as @tauri-apps/plugin-http (from v2) is not having both Body and getClientfrom in it, unlike previously was in @tauri-apps/api/http. Not sure if they will be providing this in the future or Auth will need to be redesigned in the end.

After some testing, I can give some hints to start the update (I'm stuck on updating the rust code in the src-tauri/src/):

  • Read entirely the documentation given above.
  • A lot of imports and functions needs to be changed, both in the src/ (typescript) and the src-tauri/src/ (rust). For example, on the typescript side, getWindow() does not exist in v2. You need to import import { getCurrentWindow } from "@tauri-apps/api/window".
    Another example would be in the rust side to not use listen_global(), but use tauri::Listener and replace by listen_any(), and not use emit_all() but use tauri::Emitter and replace by emit().
  • Also, I had to add the following dependencies to the package.json file in packages/hoppscotch-selfhost-desktop after the migration:
  "dependencies": {
    [...]
    "@tauri-apps/api": "^2.0.2",
    "@tauri-apps/cli": "2.3.1",
    "@tauri-apps/plugin-dialog": "^2.2.0",
    "@tauri-apps/plugin-fs": "^2.2.0",
    "@tauri-apps/plugin-http": "^2.3.0",
    "@tauri-apps/plugin-os": "^2.2.0",
    "@tauri-apps/plugin-shell": "^2.0.0",
    "@tauri-apps/plugin-store": "^2.2.0",
    [...]
  },

I'm now stuck to update the rust code, for which I don't have enough knowledge to do so. Help needed!

Why should this be worked on?

This should be high priority as it could resolve a lot of different errors faced by users, and more importantly be more up-to-date as other projects created in Hoppscotch (i.e.: hoppscotch agent).

Originally created by @ImNicolasTheDev on GitHub (Mar 18, 2025). Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/4904 ### Is there an existing issue for this? - [x] I have searched the existing issues ### Summary The package `hoppscotch-selfhost-desktop` should be updated to Tauri v2. The doc to update from Tauri v1 can be found here: https://v2.tauri.app/start/migrate/from-tauri-1/ Some work needs to be done to update the rust code, as mentioned [in this issue](https://github.com/hoppscotch/hoppscotch/issues/4235): > TLDR is basically that, the references in hoppscotch-desktop would have to be updated to v2 of tauri (right now rc.1 is available, which is suboptimal). Also after performing the migration, more code changes in [packages/hoppscotch-selfhost-desktop/src/platform/auth.ts](https://github.com/hoppscotch/hoppscotch/blob/4fd6d6ddb4333e3d237f48d3ce01136d9f3f7f94/packages/hoppscotch-selfhost-desktop/src/platform/auth.ts) would have to be made, as `@tauri-apps/plugin-http` (from v2) is not having both `Body` and `getClientfrom` in it, unlike previously was in `@tauri-apps/api/http`. Not sure if they will be providing this in the future or Auth will need to be redesigned in the end. After some testing, I can give some hints to start the update (I'm stuck on updating the rust code in the `src-tauri/src/`): - Read **entirely** the documentation given above. - A lot of imports and functions needs to be changed, both in the `src/` (typescript) and the `src-tauri/src/` (rust). For example, on the typescript side, `getWindow()` does not exist in v2. You need to import `import { getCurrentWindow } from "@tauri-apps/api/window"`. Another example would be in the rust side to not use `listen_global()`, but use `tauri::Listener` and replace by `listen_any()`, and not use `emit_all()` but use `tauri::Emitter` and replace by `emit()`. - Also, I had to add the following dependencies to the `package.json` file in `packages/hoppscotch-selfhost-desktop` after the migration: ```js "dependencies": { [...] "@tauri-apps/api": "^2.0.2", "@tauri-apps/cli": "2.3.1", "@tauri-apps/plugin-dialog": "^2.2.0", "@tauri-apps/plugin-fs": "^2.2.0", "@tauri-apps/plugin-http": "^2.3.0", "@tauri-apps/plugin-os": "^2.2.0", "@tauri-apps/plugin-shell": "^2.0.0", "@tauri-apps/plugin-store": "^2.2.0", [...] }, ``` I'm now stuck to update the rust code, for which I don't have enough knowledge to do so. Help needed! ### Why should this be worked on? This should be **high priority** as it could resolve a lot of different errors faced by users, and more importantly be more up-to-date as other projects created in Hoppscotch (i.e.: hoppscotch agent).
kerem 2026-03-16 22:04:34 +03:00
  • closed this issue
  • added the
    feature
    label
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hoppscotch#1848
No description provided.