Skip to content

[bug] use register_listener instead of registerListener. #12486

@GlosZhao

Description

@GlosZhao

Describe the bug

When using addPluginListener, I found that registerListener is not allowed. Upon further investigation, I discovered that addPluginListener internally uses registerListener. I believe this does not conform to Rust's naming conventions, and it should be corrected to the previous register_listener.

Reproduction

return invoke(`plugin:${plugin}|registerListener`, { event, handler }).then(

Expected behavior

use register_listener instead of registerListener.

Full tauri info output

[✔] Environment
    - OS: Mac OS 15.1.1 arm64 (X64)
    ✔ Xcode Command Line Tools: installed
    ✔ rustc: 1.83.0 (90b35a623 2024-11-26) (Homebrew)
    ✔ cargo: 1.83.0
    ✔ rustup: 1.27.1 (2024-04-24)
    ✔ Rust toolchain: 
    - node: 18.20.2
    - pnpm: 9.10.0
    - npm: 10.5.0

[-] Packages
    - tauri 🦀: 2.1.1
    - tauri-build 🦀: 2.0.3
    - wry 🦀: 0.47.2
    - tao 🦀: 0.30.8
    - @tauri-apps/api : 2.0.0 (outdated, latest: 2.2.0)
    - @tauri-apps/cli : 2.0.3 (outdated, latest: 2.2.5)

[-] Plugins
    - tauri-plugin-shell 🦀: 2.0.2
    - @tauri-apps/plugin-shell : 2.0.0 (outdated, latest: 2.2.0)
    - tauri-plugin-http 🦀: 2.0.3
    - @tauri-apps/plugin-http : 2.0.0 (outdated, latest: 2.2.0)
    - tauri-plugin-os 🦀: 2.0.1
    - @tauri-apps/plugin-os : 2.0.0 (outdated, latest: 2.2.0)
    - tauri-plugin-fs 🦀: 2.0.3
    - @tauri-apps/plugin-fs : not installed!

[-] App
    - build-type: bundle
    - CSP:  xxxx
    - frontendDist: ../dist
    - devUrl: http://localhost:1420/
    - framework: Vue.js
    - bundler: Vite

Stack trace


Additional context

I am not clear about the rationale behind this change. I would appreciate it if I could receive a response explaining the reasoning.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions