Giter Club home page Giter Club logo

plugins-workspace's People

Contributors

ahkohd avatar amrbashir avatar beanow avatar cijiugechu avatar dependabot[bot] avatar dklassic avatar dreaming-codes avatar fabianlars avatar fitztrev avatar github-actions[bot] avatar i-c-b avatar jbolda avatar jojobyte avatar jonaskruckenberg avatar legend-master avatar lucasfernog avatar lucasfernog-crabnebula avatar mattiloh avatar mikoto2000 avatar morajabi avatar naman-crabnebula avatar otamam818 avatar pashokitsme avatar pewsheen avatar renovate-bot avatar renovate[bot] avatar simonhyll avatar thewh1teagle avatar tillmann-crabnebula avatar unbeauvoyage avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

plugins-workspace's Issues

[store] store.save() does not work

Cargo toml:

[build-dependencies]
tauri-build = { version = "1.0.0-rc.4", features = [] }

[dependencies]
serde_json = "1.0"
serde = { version = "1.0", features = ["derive"] }
tauri = { version = "1.0.0-rc.4", features = ["clipboard-all", "dialog-all", "fs-read-file", "fs-write-file", "shell-all", "window-all"] }

[dependencies.tauri-plugin-store]
git = "https://github.com/tauri-apps/tauri-plugin-store"
branch = "dev"

[features]
# by default Tauri runs in production mode
# when `tauri dev` runs it is executed with `cargo run --no-default-features` if `devPath` is an URL
default = [ "custom-protocol" ]
# this feature is used used for production builds where `devPath` points to the filesystem
# DO NOT remove this
custom-protocol = [ "tauri/custom-protocol" ]

main.rs:

#![cfg_attr(
  all(not(debug_assertions), target_os = "windows"),
  windows_subsystem = "windows"
)]

use tauri_plugin_store::PluginBuilder;

fn main() {
  tauri::Builder::default()
    .plugin(PluginBuilder::default().build())
    .run(tauri::generate_context!())
    .expect("error while running tauri application");
}

package.json:

{
  "dependencies": {
    "tauri-plugin-store-api": "github:tauri-apps/tauri-plugin-store#dev",
  }
}

React code:

const store = new Store('.settings.dat');

let storeBases = await store.get('bases') as number[];
storeBases = storeBases ? [...storeBases, baseToAdd] : [baseToAdd];
await store.set('bases', storeBases);
await store.save();

The store operations work till the app is running (navigating away or into this page).
But the settings file is not persisted on disk and subsequent runs have a blank store.
I also have both readFile and writeFile enabled in the allowList.

[window-state] error: could not compile `tauri-runtime-wry` due to 2 previous errors

I added tauri-plugin-window-state to Cargo.toml as seen below

[build-dependencies]
tauri-build = { version = "1.0.0-rc.4", features = [] }

[dependencies]
serde_json = "1.0"
serde = { version = "1.0", features = ["derive"] }
# fails to build even if I use the below
# tauri = { git = "https://github.com/tauri-apps/tauri", branch = "next", features = ["api-all"] }
tauri = { version = "1.0.0-rc.4", features = ["api-all"] }
toml = "0.5"
tauri-plugin-window-state = { git = "https://github.com/tauri-apps/tauri-plugin-window-state", tag = "tauri-plugin-window-
state-v0.1.0" }

When I added this, wry could not be compiled for some reason???

   Compiling tauri-runtime-wry v0.2.1 (https://github.com/tauri-apps/tauri/?branch=next#43348652)
error[E0277]: the trait bound `ICoreWebView2FocusChangedEventHandler: IntoParam<'_, webview2_com_sys::Microsoft::Web::WebView2::Win32::ICoreWebView2FocusChangedEventHandler>` is not satisfied
    --> C:\Users\maste\.cargo\git\checkouts\tauri-9dcc2f9152472c1a\4334865\core\tauri-runtime-wry\src\lib.rs:1715:15
     |
1714 |               controller.GotFocus(
     |                          -------- required by a bound introduced by this call
1715 | /               FocusChangedEventHandler::create(Box::new(move |_, _| {
1716 | |                 let _ = proxy.send_event(Message::Webview(
1717 | |                   id,
1718 | |                   WebviewMessage::WebviewEvent(WebviewEvent::Focused(true)),
1719 | |                 ));
1720 | |                 Ok(())
1721 | |               })),
     | |_________________^ the trait `IntoParam<'_, webview2_com_sys::Microsoft::Web::WebView2::Win32::ICoreWebView2FocusChangedEventHandler>` is not implemented for `ICoreWebView2FocusChangedEventHandler`
     |
     = help: the following implementations were found:
               <&ICoreWebView2FocusChangedEventHandler as IntoParam<'a, IUnknown>>
               <ICoreWebView2FocusChangedEventHandler as IntoParam<'a, IUnknown>>

error[E0277]: the trait bound `ICoreWebView2FocusChangedEventHandler: IntoParam<'_, webview2_com_sys::Microsoft::Web::WebView2::Win32::ICoreWebView2FocusChangedEventHandler>` is not satisfied
    --> C:\Users\maste\.cargo\git\checkouts\tauri-9dcc2f9152472c1a\4334865\core\tauri-runtime-wry\src\lib.rs:1729:15
     |
1728 |               controller.LostFocus(
     |                          --------- required by a bound introduced by this call
1729 | /               FocusChangedEventHandler::create(Box::new(move |_, _| {
1730 | |                 let _ = proxy.send_event(Message::Webview(
1731 | |                   id,
1732 | |                   WebviewMessage::WebviewEvent(WebviewEvent::Focused(false)),
1733 | |                 ));
1734 | |                 Ok(())
1735 | |               })),
     | |_________________^ the trait `IntoParam<'_, webview2_com_sys::Microsoft::Web::WebView2::Win32::ICoreWebView2FocusChangedEventHandler>` is not implemented for `ICoreWebView2FocusChangedEventHandler`
     |
     = help: the following implementations were found:
               <&ICoreWebView2FocusChangedEventHandler as IntoParam<'a, IUnknown>>
               <ICoreWebView2FocusChangedEventHandler as IntoParam<'a, IUnknown>>

For more information about this error, try `rustc --explain E0277`.
error: could not compile `tauri-runtime-wry` due to 2 previous errors

[stronghold] Installation fails

Hi there,

thanks for providing the plugin! I'd like to try it out, but installation fails.
First of, the README mentions version v0.1.0 for the manifest dependencies, but refers to the renamed name of the plugin which was introduced with v0.2.0. That just needs adjustment.

When installing v0.2.0 I cannot resolve iota-stronghold, anything I can do here?

    Updating git repository `https://github.com/iotaledger/stronghold.rs`
error: no matching package found
searched package name: `iota-stronghold`
perhaps you meant:      iota_stronghold
location searched: https://github.com/iotaledger/stronghold.rs?branch=dev
required by package `tauri-plugin-stronghold v0.1.0 (https://github.com/tauri-apps/tauri-plugin-stronghold?tag=v0.2.0#6749525a)`
    ... which satisfies git dependency `tauri-plugin-stronghold`
    ```

Thanks!

[sql] What version should I install?

Hello, I want to try this plugin, I have installed the same version as in your readme file, but it ended up getting an error Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'notify').

Can someone tell me what commit should I use to install this package?

Project detail :

  • "vue": "^2.6.14"
  • "vue-cli-plugin-tauri": "~1.0.0-rc.1"
  • "tauri-plugin-sql-api": "github:tauri-apps/tauri-plugin-sql#2be17fae3832e55a18c0beaf7b76f341e7a755da",

[window-state] window state does not record maximize correctly

Here is a video clip to show the issue

2022-05-17.00-32-14.mp4

Its not a high quality recording, but should be enough to see what I'm doing

This is a brand new app created from create-tauri-app, and the only modification is adding window-state plugin.

expected behavior:
reopen a maximized app should stay in maximized

[window-state] On Windows, closing a minimized window causes the app to be stuck in an invalid state

On Windows, minimizing an app causes a WindowEvent::Resized event to be fired with {width: 0, height: 0} and a WindowEvent::Moved event to be fired with {x: -32000, y: -32000} (not sure if that's a static value or somehow related to monitor size). If the window is closed while minimized, the plugin persists these values to disk which causes the app to be stuck in an invisible state until the .window-state file is deleted. I also tested this on Linux and neither event is fired on minimize so it doesn't cause an issue. I'd be happy to attempt to fix this, but not sure if this is something that should be fixed upstream in Tao. Thanks!

Tauri info:

Operating System - Windows, version 10.0.19043 X64
Webview2 - 94.0.992.47

Node.js environment
  Node.js - 16.6.2
  @tauri-apps/cli - 1.0.0-beta.10
  @tauri-apps/api - 1.0.0-beta.8

Global packages
  npm - 7.20.3
  yarn - 1.22.11

Rust environment
  rustc - 1.55.0
  cargo - 1.55.0

App directory structure
/node_modules
/public
/src
/src-tauri

App
  tauri.rs - 1.0.0-beta.8
  build-type - bundle
  CSP - default-src blob: data: filesystem: ws: wss: http: https: tauri: 'unsafe-eval' 'unsafe-inline' 'self' img-src: 'self'
  distDir - ../build
  devPath - http://localhost:3000
  framework - React

[localhost] error: could not compile tauri-runtime-wry due to 2 previous errors[bug]

Describe the bug

I added tauri-plugin-localhost to Cargo.toml as seen below

[package]
name = "app"
version = "0.1.0"
description = "A Tauri App"
authors = ["you"]
license = ""
repository = ""
default-run = "app"
edition = "2021"
rust-version = "1.57"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[build-dependencies]
tauri-build = { version = "1.0.0-rc.5", features = [] }

[dependencies]
serde_json = "1.0"
serde = { version = "1.0", features = ["derive"] }
tauri = { version = "1.0.0-rc.5", features = ["api-all"] }
tauri-plugin-window-state = { git = "https://github.com/tauri-apps/tauri-plugin-window-state", branch = "dev" }
tauri-plugin-localhost = { git = "https://github.com/tauri-apps/tauri-plugin-localhost", branch = "dev" }

[features]
# by default Tauri runs in production mode
# when `tauri dev` runs it is executed with `cargo run --no-default-features` if `devPath` is an URL
default = [ "custom-protocol" ]
# this feature is used used for production builds where `devPath` points to the filesystem
# DO NOT remove this
custom-protocol = [ "tauri/custom-protocol" ]

Reproduction

wry could not be compiled for some reason?

error[E0277]: the trait bound `ICoreWebView2FocusChangedEventHandler: IntoParam<'_, webview2_com_sys::Microsoft::Web::We
bView2::Win32::ICoreWebView2FocusChangedEventHandler>` is not satisfied
    --> C:\Users\Administrator\.cargo\git\checkouts\tauri-9dcc2f9152472c1a\4334865\core\tauri-runtime-wry\src\lib.rs:171
5:15
     |
1714 |               controller.GotFocus(
     |                          -------- required by a bound introduced by this call
1715 | /               FocusChangedEventHandler::create(Box::new(move |_, _| {
1716 | |                 let _ = proxy.send_event(Message::Webview(
1717 | |                   id,
1718 | |                   WebviewMessage::WebviewEvent(WebviewEvent::Focused(true)),
1719 | |                 ));
1720 | |                 Ok(())
1721 | |               })),
     | |_________________^ the trait `IntoParam<'_, webview2_com_sys::Microsoft::Web::WebView2::Win32::ICoreWebView2Focu
sChangedEventHandler>` is not implemented for `ICoreWebView2FocusChangedEventHandler`
     |
     = help: the following implementations were found:
               <&ICoreWebView2FocusChangedEventHandler as IntoParam<'a, IUnknown>>
               <ICoreWebView2FocusChangedEventHandler as IntoParam<'a, IUnknown>>
note: required by a bound in `webview2_com_sys::Microsoft::Web::WebView2::Win32::ICoreWebView2Controller::GotFocus`
    --> C:\Users\Administrator\.cargo\registry\src\github.com-1ecc6299db9ec823\webview2-com-sys-0.13.0\src\Microsoft\Web
\WebView2\Win32\mod.rs:3512:17
     |
3512 |         Param0: ::windows::core::IntoParam<'a, ICoreWebView2FocusChangedEventHandler>,
     |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `
webview2_com_sys::Microsoft::Web::WebView2::Win32::ICoreWebView2Controller::GotFocus`

error[E0277]: the trait bound `ICoreWebView2FocusChangedEventHandler: IntoParam<'_, webview2_com_sys::Microsoft::Web::We
bView2::Win32::ICoreWebView2FocusChangedEventHandler>` is not satisfied
    --> C:\Users\Administrator\.cargo\git\checkouts\tauri-9dcc2f9152472c1a\4334865\core\tauri-runtime-wry\src\lib.rs:172
9:15
     |
1728 |               controller.LostFocus(
     |                          --------- required by a bound introduced by this call
1729 | /               FocusChangedEventHandler::create(Box::new(move |_, _| {
1730 | |                 let _ = proxy.send_event(Message::Webview(
1731 | |                   id,
1732 | |                   WebviewMessage::WebviewEvent(WebviewEvent::Focused(false)),
1733 | |                 ));
1734 | |                 Ok(())
1735 | |               })),
     | |_________________^ the trait `IntoParam<'_, webview2_com_sys::Microsoft::Web::WebView2::Win32::ICoreWebView2Focu
sChangedEventHandler>` is not implemented for `ICoreWebView2FocusChangedEventHandler`
     |
     = help: the following implementations were found:
               <&ICoreWebView2FocusChangedEventHandler as IntoParam<'a, IUnknown>>
               <ICoreWebView2FocusChangedEventHandler as IntoParam<'a, IUnknown>>
note: required by a bound in `webview2_com_sys::Microsoft::Web::WebView2::Win32::ICoreWebView2Controller::LostFocus`
    --> C:\Users\Administrator\.cargo\registry\src\github.com-1ecc6299db9ec823\webview2-com-sys-0.13.0\src\Microsoft\Web
\WebView2\Win32\mod.rs:3543:17
     |
3543 |         Param0: ::windows::core::IntoParam<'a, ICoreWebView2FocusChangedEventHandler>,
     |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `
webview2_com_sys::Microsoft::Web::WebView2::Win32::ICoreWebView2Controller::LostFocus`

For more information about this error, try `rustc --explain E0277`.
error: could not compile `tauri-runtime-wry` due to 2 previous errors

Expected behavior

No response

Platform and versions

Environment
  › OS: Windows 10.0.17134 X64
  › Webview2: 99.0.1150.55
  › MSVC:
      - Visual Studio ���ɹ��� 2019
  › Node.js: 14.17.0
  › npm: 6.14.13
  › pnpm: Not installed!
  › yarn: 1.22.17
  › rustup: 1.24.3
  › rustc: 1.59.0
  › cargo: 1.59.0
  › Rust toolchain: stable-x86_64-pc-windows-msvc

Packages
  › @tauri-apps/cli [NPM]: 1.0.0-rc.7
  › @tauri-apps/api [NPM]: 1.0.0-rc.3
  › tauri [RUST]: 1.0.0-rc.5 (unknown lockfile),
  › tauri-build [RUST]: 1.0.0-rc.5,
  › tao [RUST]: no manifest (unknown lockfile),
  › wry [RUST]: no manifest (unknown lockfile),

App
  › build-type: bundle
  › CSP: unset
  › distDir: ../dist
  › devPath: http://localhost:12354/
  › framework: Vue.js
  › bundler: Webpack

App directory structure
  ├─ .git
  ├─ build
  ├─ dist
  ├─ doc
  ├─ libs
  ├─ node_modules
  ├─ src
  └─ src-tauri
Done in 17.57s.

Stack trace

No response

Additional context

No response

[sql] Support update hook in sqlite3

Hi!
I am trying to build a desktop app by using tauri.
And I need to store data locally and sync data to server when local data changes.
Through some research, I find sqlite3 have native update hook.

[sql] Support/parse nested json with serde_json::from_value

I'm playing with tauri-plugin-sql and thinking about moving my app (https://github.com/iohzrd/identia) to using it but I've noticed that columns that contain JS objects don't get parsed and are returned as strings.

It would be nice to automatically parse nested objects so that no extra parsing is required in JS land.

This is something I was able to accomplish using serde_json::from_value, as can be seen here. I'm happy to implement it myself and submit a pull request, but I figured I'd start a conversation, so we can come to the optimal solution. I.e. should we target BLOB, STRING etc...

[shell] Show in finder/explorer

Describe the problem

The shell.open API can be used to open local files (in their respective app) or opening a directory in the finder/explorer-equivalent. In addition to this, I need to "show in finder", i.e. open a directory with a set of files/directories selected.

Describe the solution you'd like

At a minimum, a function that accepts one file or directory and opens its containing directory with that file/dir selected. Ideally, multiple files can be provided, but I think this may be harder to do cross-platform.

Alternatives considered

No response

Additional context

If API additions are difficult, I'm also interested in workarounds.

[sql] null values are returned as empty strings

Given a table items in a SQLite database:

let items = await db.select('SELECT * FROM items')
console.log(items)
// [{ parent_uid: "", ...}, ...]

parent_uid is null in the database but the query returns an empty string instead of null.

[sql] How to install

I tried to install tauri-plugin-sql but am running into some problems. Not sure what I misunderstood, what may not be well enough documented and where I simply made mistakes. I am a complete tauri / rust noob.

1 Installation

I did the following:

1.1 tauri

Installed tauri into my existing app according to the instructions.

1.2 tauri-plugin-sql

Installed tauri-plugin-sql

yarn add github:tauri-apps/tauri-plugin-sql#488558717b77d8a2bcb37acfd2eca9658aeadc8e

as shown in the readme.

While doing this I ran into a discrepancy: the package.json entry is

"tauri-plugin-sql": "github:tauri-apps/tauri-plugin-sql#488558717b77d8a2bcb37acfd2eca9658aeadc8e"

instead of

"tauri-plugin-sql-api": "github:tauri-apps/tauri-plugin-sql#v0.1.0"

My package.json now looks like this:

{
  "name": "kapla5",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@tauri-apps/api": "^1.0.0-beta.8",
    "bootstrap": "4.5.3",
    "date-fns": "2.23.0",
    "exceljs": "4.3.0",
    "jquery": "3.6.0",
    "lodash": "4.17.21",
    "mobx": "6.3.3",
    "mobx-react": "7.2.0",
    "mobx-react-lite": "3.2.1",
    "mobx-state-tree": "5.0.2",
    "moment": "2.29.1",
    "prop-types": "15.7.2",
    "react": "17.0.2",
    "react-datepicker": "4.2.1",
    "react-dom": "17.0.2",
    "react-dropzone": "11.3.4",
    "react-error-boundary": "3.1.3",
    "react-icons": "4.2.0",
    "react-linkify": "0.x",
    "react-scripts": "4.0.3",
    "react-select": "4.3.1",
    "react-split-pane": "0.1.92",
    "react-textarea-autosize": "8.3.3",
    "react-virtualized": "9.22.3",
    "reactstrap": "8.10.0",
    "styled-components": "5.3.1",
    "tauri-plugin-sql": "github:tauri-apps/tauri-plugin-sql#488558717b77d8a2bcb37acfd2eca9658aeadc8e",
    "use-debounce": "7.0.0",
    "use-detect-print": "0.0.2",
    "username": "6.0.0",
    "web-vitals": "1.0.1"
  },
  "devDependencies": {
    "@tauri-apps/cli": "^1.0.0-beta.10",
    "@testing-library/jest-dom": "5.11.4",
    "@testing-library/react": "11.1.0",
    "@testing-library/user-event": "12.1.10",
    "prettier": "2.4.0"
  },
  "peerDependencies": {
    "popper.js": "1.16.1",
    "react-is": "17.0.2"
  },
  "scripts": {
    "dev": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject",
    "tauri": "tauri"
  },
  "eslintConfig": {
    "extends": [
      "react-app",
      "react-app/jest"
    ]
  }
}

1.3 edit ´src-tauri/Cargo.toml´

The readme shows:

[dependencies.tauri-plugin-sql]
git = "https://github.com/tauri-apps/tauri-plugin-sql"
tag = "v0.1.0"
features = ["sqlite"] # or "postgres", or "mysql"
#branch = "main"

I tried to get it working using:

[dependencies.tauri-plugin-sql]
git = "https://github.com/tauri-apps/tauri-plugin-sql"
commit = "488558717b77d8a2bcb37acfd2eca9658aeadc8e"
features = ["sqlite"]
branch = "release"

as v0.1.0 does not seem to exist.

My ´src-tauri/Cargo.toml´ now looks like this:

[package]
name = "app"
version = "0.1.0"
description = "A Tauri App"
authors = ["you"]
license = ""
repository = ""
default-run = "app"
edition = "2018"
build = "src/build.rs"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[build-dependencies]
tauri-build = { version = "1.0.0-beta.4" }

[dependencies]
serde_json = "1.0"
serde = { version = "1.0", features = ["derive"] }
tauri = { version = "1.0.0-beta.8", features = ["api-all"] }

[dependencies.tauri-plugin-sql]
git = "https://github.com/tauri-apps/tauri-plugin-sql"
commit = "488558717b77d8a2bcb37acfd2eca9658aeadc8e"
features = ["sqlite"]
branch = "release"

[features]
default = [ "custom-protocol" ]
custom-protocol = [ "tauri/custom-protocol" ]

I tried to write this like it is done for tauri itself. But got messages saying, commit had been ommited. Which seems to still be a problem, see the result further down. It could very well be that:

  • I got the way to refer to a commit wrong
  • I am referring to the wrong commit?

1.4 edit ´src-tauri/src/main.rs´

The readme says:

use tauri_plugin_sql::TauriSql;

fn main() {
    tauri::Builder::default()
        .plugin(TauriSql::default())
        .build()
        .run();
}

My file now looks like this:

#![cfg_attr(
  all(not(debug_assertions), target_os = "windows"),
  windows_subsystem = "windows"
)]

use tauri_plugin_sql::TauriSql;

fn main() {
  tauri::Builder::default()
  .plugin(TauriSql::default())
    .run(tauri::generate_context!())
     .expect("error while running tauri application");
}

I had to change from the readme example as that did not work. Being a complete rust noob it could very well be that there is a mistake here.

2 Result

When I run yarn tauri dev I get:

PS C:\Users\alexa\kapla5> yarn tauri dev
yarn run v1.22.17
$ tauri dev
 app:spawn Running "C:\Users\alexa\kapla5\node_modules\@tauri-apps\cli\bin\tauri-cli.exe tauri dev" +0ms

warning: unused manifest key: dependencies.tauri-plugin-sql.commit
   Compiling app v0.1.0 (C:\Users\alexa\kapla5\src-tauri)
    Finished dev [unoptimized + debuginfo] target(s) in 3.28s
     Running `target\debug\app.exe`

The problem is: A tauri window opens but it can't access the site.
In the console this error appears:

crbug/1173575, non-JS module files deprecated.

I tried to dumb down my code to the absolute minimum. As I am converting an electron app I replaced the entire app part by rendering <div>hello world</div> without importing tauri-plugin-sql anywhere yet.

[sql] Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'notify')

Both mysql and sqlite have this problem

error

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'notify')

Cargo.toml

[dependencies.tauri-plugin-sql]
git = "https://github.com/tauri-apps/tauri-plugin-sql"
rev = "f9c5c1c1043b4aa46a4a38f798ea10a4403eaf92"
features = ["sqlite"]

package.json
···json
"dependencies": {
"tauri-plugin-sql-api": "github:tauri-apps/tauri-plugin-sql#f9c5c1c1043b4aa46a4a38f798ea10a4403eaf92",
}
···

src-tauri/src/main

#![cfg_attr(
  all(not(debug_assertions), target_os = "windows"),
  windows_subsystem = "windows"
)]

use tauri_plugin_sql::{Migration, MigrationKind, TauriSql};

fn main() {
  tauri::Builder::default()
    .plugin(TauriSql::default().add_migrations(
      "sqlite:test.db",
      vec![Migration {
        version: 1,
        description: "create todo",
        sql: include_str!("../migrations/1.sql"),
        kind: MigrationKind::Up,
      }],
    ))
    .run(tauri::generate_context!())
    .expect("error while running tauri application");
}

frontend

let db: Database;
const onConnectDB = async () => {
  db = await Database.load('sqlite:test.db');
  const result = await db.execute('SELECT * FROM todos');
  console.log('result:', result);
};

system info

Operating System - Windows, version 10.0.19044 X64
Webview2 - 98.0.1108.43
Visual Studio Build Tools:
   - Visual Studio ���ɹ��� 2019   
   - Visual Studio Enterprise 2022

Node.js environment
  Node.js - 14.19.0
  @tauri-apps/cli - 1.0.0-rc.2
  @tauri-apps/api - 1.0.0-rc.0

Global packages
  npm - 6.14.16
  pnpm - 6.30.1
  yarn - 1.22.17

Rust environment
  rustc - 1.58.1
  cargo - 1.58.0

Rust environment
  rustup - 1.24.3
  rustc - 1.58.1
  cargo - 1.58.0
  toolchain - stable-x86_64-pc-windows-msvc 

App directory structure
/.git
/.history
/.husky
/.idea
/config
/dist
/node_modules
/public
/scripts
/src
/src-tauri
/types

App
  tauri.rs - 1.0.0-rc.0
  build-type - bundle
  CSP - default-src 'self'
  distDir - ../dist
  devPath - http://localhost:3366/
  framework - Vue.js

[stronghold] Yubi Key Support?

There isn't much documentation for yubi key on stronghold or here.
Is support for hardware keys in (such as yubi key)?

[sql] TAURI with tauri-plugin-sql throws this error when invoking the plugin on the JAVASCRIPT side

ERROR in ./src/App.js
Module parse failed: The top-level-await experiment is not enabled (set experiments.topLevelAwait: true to enabled it)
File was processed with these loaders:

  • ./node_modules/@pmmmwh/react-refresh-webpack-plugin/loader/index.js
  • ./node_modules/babel-loader/lib/index.js
  • ./node_modules/source-map-loader/dist/cjs.js
    You may need an additional loader to handle the result of these loaders.
    Error: The top-level-await experiment is not enabled (set experiments.topLevelAwait: true to enabled it)
    at /home/mokhtar/restopos/node_modules/webpack/lib/dependencies/HarmonyDetectionParserPlugin.js:54:11
    at Hook.eval [as call] (eval at create (/home/mokhtar/restopos/node_modules/tapable/lib/HookCodeFactory.js:19:10), :7:16)
    at Hook.CALL_DELEGATE [as _call] (/home/mokhtar/restopos/node_modules/tapable/lib/Hook.js:14:14)
    at JavascriptParser.walkAwaitExpression (/home/mokhtar/restopos/node_modules/webpack/lib/javascript/JavascriptParser.js:2314:29)
    at JavascriptParser.walkExpression (/home/mokhtar/restopos/node_modules/webpack/lib/javascript/JavascriptParser.js:2244:10)
    at JavascriptParser.walkVariableDeclaration (/home/mokhtar/restopos/node_modules/webpack/lib/javascript/JavascriptParser.js:2098:33)
    at JavascriptParser.walkStatement (/home/mokhtar/restopos/node_modules/webpack/lib/javascript/JavascriptParser.js:1592:10)
    at JavascriptParser.walkStatements (/home/mokhtar/restopos/node_modules/webpack/lib/javascript/JavascriptParser.js:1453:9)
    at JavascriptParser.parse (/home/mokhtar/restopos/node_modules/webpack/lib/javascript/JavascriptParser.js:3338:9)
    at /home/mokhtar/restopos/node_modules/webpack/lib/NormalModule.js:1082:26
    @ ./src/index.js 7:0-24 11:33-36

[window-state] Does not work with custom titlebar (appWindow.close)

When I close the app with appWindow.close and reopen the app, the window position is not preserved.

It seems that closing app with appWindow.close does not trigger a CloseRequested event, so the state is not read.

If I close the window with system titlebar and reopen the app, the window position is preserved. So I can confirm it's about appWindow.close.

[authenticator] error in the example

  1. run the example
  2. tauri-plugin-authenticator/examples/svelte-app on  dev [!] is 📦 v1.0.0 via  v16.4.1 took 3m23s
    ❯ yarn tauri dev
  3. open http://localhost:5000
  4. open chrome devtools:
  5. got the exception and the "register" button no effect:-
    index.js:15 Uncaught (in promise) TypeError: Cannot read property 'notify' of undefined
    at index.js:15
    at new Promise ()
    at index.js:15
    at index.js:15
    at Object.next (index.js:15)
    at index.js:15
    at new Promise ()
    at index.js:15
    at e (index.js:15)
    at t.init (index.js:15)

[store] How do i get or set from the store in rust?

Dearest Maintainer,

I would like to use this store for configuration. The app I am creating has a UI and CLI. I am unsure how I can access the config from rust right now. Any advice would be appreciated.

Thanks for you work on this.
Becker

[sql] node run err , only run browser or app env ?

Hello, I run it with node cmd test , get this :

ts-node ../src/store/sqlite/tauriSql.ts
  • tauriSql.ts
import Database from 'tauri-plugin-sql-api'

// sqlite. The path is relative to `tauri::api::path::BaseDirectory::App`.

let db: Database;

async function connect(): Promise<Database> {
    db = await Database.load('sqlite:test.db');
    return db;
}

async function all(): Promise<any[]> {
    const db = await connect();
    return await db.select('SELECT * FROM todos');
}

export function xxx() {
    console.log(all().then(res => console.log(res)))
}

xxx()

ReferenceError: window is not defined
    at /Users/nonacosa/code/sofun/xxx/node_modules/@tauri-apps/api/tauri-a5e1eaa6.cjs:15:1717
    at r (/Users/nonacosa/code/sofun/xxx/node_modules/@tauri-apps/api/tauri-a5e1eaa6.cjs:15:1851)
    at /Users/nonacosa/code/sofun/xxx/node_modules/@tauri-apps/api/tauri-a5e1eaa6.cjs:15:2151
    at new Promise (<anonymous>)
    at /Users/nonacosa/code/sofun/xxx/node_modules/@tauri-apps/api/tauri-a5e1eaa6.cjs:15:2118
    at /Users/nonacosa/code/sofun/xxx/node_modules/@tauri-apps/api/tauri-a5e1eaa6.cjs:15:1527
    at Object.next (/Users/nonacosa/code/sofun/xxx/node_modules/@tauri-apps/api/tauri-a5e1eaa6.cjs:15:1632)
    at /Users/nonacosa/code/sofun/xxx/node_modules/@tauri-apps/api/tauri-a5e1eaa6.cjs:15:569
    at new Promise (<anonymous>)
    at e (/Users/nonacosa/code/sofun/xxx/node_modules/@tauri-apps/api/tauri-a5e1eaa6.cjs:15:314)

so, It only works on browser ENV? because NodeJs have no window variable,How can I test with nodeJs?

[store] tag v0.01 does not exist

Taken From Readme

[dependencies.tauri-plugin-store]
git = "https://github.com/tauri-apps/tauri-plugin-store"
tag = "v0.1.0"
#branch = "main"

My Cargo.toml:


[package]
name = "app"
version = "0.1.0"
description = "A Tauri App"
authors = ["you"]
license = ""
repository = ""
default-run = "app"
edition = "2018"
build = "src/build.rs"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[build-dependencies]
tauri-build = { version = "1.0.0-beta.4" }

[dependencies]
serde_json = "1.0"
serde = { version = "1.0", features = ["derive"] }
tauri = { version = "1.0.0-beta.8", features = ["api-all", "system-tray"] }

[features]
default = [ "custom-protocol" ]
custom-protocol = [ "tauri/custom-protocol" ]


[dependencies.tauri-plugin-store]
git = "https://github.com/tauri-apps/tauri-plugin-store"
tag = "v0.1.0"
#branch = "main"

Results in the error:


error: failed to get `tauri-plugin-store` as a dependency of package `app v0.1.0 (D:\Programming\Github Restoration Project\Dynamic-Wallpaper\src-tauri)`

Caused by:
  failed to load source for dependency `tauri-plugin-store`

Caused by:
  Unable to update https://github.com/tauri-apps/tauri-plugin-store?tag=v0.1.0

Caused by:
  failed to find tag `v0.1.0`

Caused by:
  reference 'refs/remotes/origin/tags/v0.1.0' not found; class=Reference (4); code=NotFound (-3)

This repo has no tags or releases and the latest commit causes version conflicts with the latest tauri release version

[window-state] Window size went so small when opening the app second time without resizing it.

Reproduce steps:

  1. Use this plugin on an app
  2. Make sure that there's no state stored locally
  3. Start a window and DON'T resize the window
  4. Close it
  5. Reopen that window, the size will become so small (It's 16px x 59px in my case).

After trying to check what actually happened, I noticed that, if I never resize that and there's no state stored, the value of the state variable on https://github.com/tauri-apps/tauri-plugin-window-state/blob/dev/src/lib.rs#L95 has the value of {"main": WindowMetadata { width: 0, height: 0, x: 0, y: 0 }}, maybe this is why it's went so small the next time opening it.

Hope will be fixed soon! Thanks!

[log] Some feedback and confusion after trying use this plugin

  1. How can I make log from tauri-rust-end? It seems this plugin only for front-end's log. I try to re-export log module inside tauri-plugin-log, but not work.😭

  2. When using with_colors, the log file and the FE console.log appears the color code which is unwanted.

  • console.log
    image
  • log file
    image
  • terminal
    image
  1. Check the log message, the log from FE but why the target shows tauri-plugin-log?

  2. Why the terminal show logs from tao package?

    image
// here is my config of using this plugin
.plugin(
  LoggerBuilder::new()
    .rotation_strategy(RotationStrategy::KeepAll)
    .max_file_size(4000)
    .targets([LogTarget::LogDir, LogTarget::Stdout, LogTarget::Webview])
    // .filter(|meta| meta.target().eq("tauri_plugin_log"))
    .with_colors(ColoredLevelConfig {
      error: Color::Red,
      warn: Color::Yellow,
      debug: Color::White,
      info: Color::BrightGreen,
      trace: Color::Cyan,
    })
    .build(),
)

[fs-watch] Dependecy Error with tauri 1.0.0-beta.8

Using the latest Tauri release, I get a dependency error when trying to use the plugin:

error: failed to select a version for `webkit2gtk-sys`.
    ... required by package `wry v0.12.2 (https://github.com/tauri-apps/wry?rev=a3829035a3e49e76db77b0db6924e147831124c7#a3829035)`
    ... which satisfies git dependency `wry` of package `tauri-runtime-wry v0.2.1 (https://github.com/tauri-apps/tauri?branch=next#8ab8d529)`
    ... which satisfies git dependency `tauri-runtime-wry` of package `tauri v1.0.0-beta.8 (https://github.com/tauri-apps/tauri?branch=next#8ab8d529)`
    ... which satisfies git dependency `tauri` of package `tauri-plugin-fs-watch v0.1.0 (https://github.com/tauri-apps/tauri-plugin-fs-watch?branch=release#4c4897a3)`
    ... which satisfies git dependency `tauri-plugin-fs-watch` of package `app v0.1.0 (/Users/johannesklauss/Documents/Github/SyraAudio/Platforms/Wave-Desktop/src-tauri)`
versions that meet the requirements `^0.16` are: 0.16.0

the package `webkit2gtk-sys` links to the native library `web_kit2`, but it conflicts with a previous package which links to `web_kit2` as well:
package `webkit2gtk-sys v0.14.0`
    ... which satisfies dependency `ffi = "^0.14"` (locked to 0.14.0) of package `webkit2gtk v0.14.0`
    ... which satisfies dependency `webkit2gtk = "^0.14"` (locked to 0.14.0) of package `wry v0.12.2`
    ... which satisfies dependency `wry = "^0.12"` (locked to 0.12.2) of package `tauri-runtime-wry v0.2.1`
    ... which satisfies dependency `tauri-runtime-wry = "^0.2.1"` (locked to 0.2.1) of package `tauri v1.0.0-beta.8`
    ... which satisfies dependency `tauri = "^1.0.0-beta.8"` (locked to 1.0.0-beta.8) of package `app v0.1.0 (/Users/johannesklauss/Documents/Github/SyraAudio/Platforms/Wave-Desktop/src-tauri)`
Only one package in the dependency graph may specify the same links value. This helps ensure that only one copy of a native library is linked in the final binary. Try to adjust your dependencies so that only one package uses the links ='webkit2gtk-sys' value. For more information, see https://doc.rust-lang.org/cargo/reference/resolver.html#links.

failed to select a version for `webkit2gtk-sys` which could resolve this conflict

I am not sure how to fix that issue

[store] use `load` method error

When I call store.load() after using store.save() to disk.

Failed to deserialize store. Bincode does not support the serde::Deserializer::deserialize_any method

[localhost] Support HTTP Methods?

I'm very thankful for this plugin! Rather than roll my own, I could see one possible enhancement being support for HTTP methods?

If I'm reading the lib.rs correctly, currently the path routes the request to a given Tauri command. What if we enhanced this slightly to also route based on HTTP method as is usually done?

The benefit is of course security for whatever client is making the request ("security first" as they say...)

I know this one is hot-off-the-press, so of course this might even be a feature you're already planning and that's good too!

[window-state] Compile fails with tauri-1.0.0-rc.5.

Cargo.toml

[build-dependencies]
tauri-build = { version = "1.0.0-rc.5", features = [] }

[dependencies]
serde_json = "1.0.79"
serde = { version = "1.0.136", features = [ "derive" ] }
tauri = { version = "1.0.0-rc.5", features = [ "api-all" ] }

[dependencies.tauri-plugin-window-state]
git = "https://github.com/tauri-apps/tauri-plugin-window-state"

I get the following error message:

   Compiling tauri-plugin-window-state v0.1.0 (https://github.com/tauri-apps/tauri-plugin-window-state#9e57d4bd)
error[E0308]: mismatched types
  --> /Users/Foo/.cargo/git/checkouts/tauri-plugin-window-state-26e55ae178072d0f/9e57d4b/src/lib.rs:88:7
   |
87 |     window.on_window_event(move |e| match e {
   |                                           - this expression has type `&tauri_runtime::window::WindowEvent`
88 |       WindowEvent::Moved(position) => {
   |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected enum `tauri_runtime::window::WindowEvent`, found enum `tauri::WindowEvent`

error[E0308]: mismatched types
   --> /Users/Foo/.cargo/git/checkouts/tauri-plugin-window-state-26e55ae178072d0f/9e57d4b/src/lib.rs:108:7
    |
87  |     window.on_window_event(move |e| match e {
    |                                           - this expression has type `&tauri_runtime::window::WindowEvent`
...
108 |       WindowEvent::Resized(size) => {
    |       ^^^^^^^^^^^^^^^^^^^^^^^^^^ expected enum `tauri_runtime::window::WindowEvent`, found enum `tauri::WindowEvent`

For more information about this error, try `rustc --explain E0308`.
error: could not compile `tauri-plugin-window-state` due to 2 previous errors

[log] Window stuck after click window close button

When clicking the window close button, the window gets stuck and the mouse pointer becomes like this:

And the log prints this:

[2022-05-09][16:05:52][tao::platform_impl::platform::window][TRACE] Dropping `UnownedWindow` (0x600001af5eb0)
[2022-05-09][16:05:52][tao::platform_impl::platform::window][TRACE] Dropping `UnownedWindow` (0x600001af5eb0)

This problem does not occur when tauri-plugin-log is removed.

System: Apple M1 + macOS 12.3.1
tauri-plugin-log revision: d1fba58 (release branch)
Tauri version: 1.0.0-rc.6 to 1.0.0-rc.9 all have this problem

src-tauri/src/main.rs
#![cfg_attr(
    all(not(debug_assertions), target_os = "windows"),
    windows_subsystem = "windows"
)]

use tauri_plugin_log::{LogTarget, LoggerBuilder};
use tauri_plugin_store::PluginBuilder;

fn main() {
    tauri::Builder::default()
        // .plugin(PluginBuilder::default().build())
        .plugin(
            LoggerBuilder::new()
                .target(LogTarget::LogDir)
                .target(LogTarget::Stdout)
                .target(LogTarget::Webview)
                .build(),
        )
        .run(tauri::generate_context!())
        .expect("error while running tauri application");
}
Cargo.toml
[package]
name = "app"
version = "0.1.0"
description = "A Tauri App"
authors = ["you"]
license = ""
repository = ""
default-run = "app"
edition = "2021"
rust-version = "1.57"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[build-dependencies]
tauri-build = { version = "1.0.0-rc.8", features = [] }

[dependencies]
serde_json = "1.0"
serde = { version = "1.0", features = ["derive"] }
tauri = { version = "1.0.0-rc.9", features = ["api-all"] }
tauri-plugin-store = { git = "https://github.com/tauri-apps/tauri-plugin-store.git", rev = "29585d5" }
tauri-plugin-log = { git = "https://github.com/tauri-apps/tauri-plugin-log.git", rev = "d1fba58", features = ["colored"] }

[features]
# by default Tauri runs in production mode
# when `tauri dev` runs it is executed with `cargo run --no-default-features` if `devPath` is an URL
default = [ "custom-protocol" ]
# this feature is used used for production builds where `devPath` points to the filesystem
# DO NOT remove this
custom-protocol = [ "tauri/custom-protocol" ]
Screenshot on stuck image
Full log
[2022-05-09][16:01:14][tao::platform_impl::platform::window][TRACE] Creating new window
[2022-05-09][16:01:14][tao::platform_impl::platform::window][TRACE] Creating new window
[2022-05-09][16:01:14][tao::platform_impl::platform::view][TRACE] Triggered `viewDidMoveToWindow`
[2022-05-09][16:01:14][tao::platform_impl::platform::view][TRACE] Triggered `viewDidMoveToWindow`
[2022-05-09][16:01:14][tao::platform_impl::platform::view][TRACE] Completed `viewDidMoveToWindow`
[2022-05-09][16:01:14][tao::platform_impl::platform::view][TRACE] Completed `viewDidMoveToWindow`
[2022-05-09][16:01:14][tao::platform_impl::platform::view][TRACE] Triggered `validAttributesForMarkedText`
[2022-05-09][16:01:14][tao::platform_impl::platform::view][TRACE] Triggered `validAttributesForMarkedText`
[2022-05-09][16:01:14][tao::platform_impl::platform::view][TRACE] Completed `validAttributesForMarkedText`
[2022-05-09][16:01:14][tao::platform_impl::platform::view][TRACE] Completed `validAttributesForMarkedText`
[2022-05-09][16:01:14][tao::platform_impl::platform::view][TRACE] Triggered `validAttributesForMarkedText`
[2022-05-09][16:01:14][tao::platform_impl::platform::view][TRACE] Triggered `validAttributesForMarkedText`
[2022-05-09][16:01:14][tao::platform_impl::platform::view][TRACE] Completed `validAttributesForMarkedText`
[2022-05-09][16:01:14][tao::platform_impl::platform::view][TRACE] Completed `validAttributesForMarkedText`
[2022-05-09][16:01:14][tao::platform_impl::platform::view][TRACE] Triggered `validAttributesForMarkedText`
[2022-05-09][16:01:14][tao::platform_impl::platform::view][TRACE] Triggered `validAttributesForMarkedText`
[2022-05-09][16:01:14][tao::platform_impl::platform::view][TRACE] Completed `validAttributesForMarkedText`
[2022-05-09][16:01:14][tao::platform_impl::platform::view][TRACE] Completed `validAttributesForMarkedText`
[2022-05-09][16:01:14][tao::platform_impl::platform::window][TRACE] Locked shared state in `set_fullscreen`
[2022-05-09][16:01:14][tao::platform_impl::platform::window][TRACE] Locked shared state in `set_fullscreen`
[2022-05-09][16:01:14][tao::platform_impl::platform::window][TRACE] Unlocked shared state in `set_fullscreen`
[2022-05-09][16:01:14][tao::platform_impl::platform::window][TRACE] Unlocked shared state in `set_fullscreen`
[2022-05-09][16:01:14][tao::platform_impl::platform::view][TRACE] Triggered `validAttributesForMarkedText`
[2022-05-09][16:01:14][tao::platform_impl::platform::view][TRACE] Triggered `validAttributesForMarkedText`
[2022-05-09][16:01:14][tao::platform_impl::platform::view][TRACE] Completed `validAttributesForMarkedText`
[2022-05-09][16:01:14][tao::platform_impl::platform::view][TRACE] Completed `validAttributesForMarkedText`
[2022-05-09][16:01:14][tao::platform_impl::platform::view][TRACE] Triggered `validAttributesForMarkedText`
[2022-05-09][16:01:14][tao::platform_impl::platform::view][TRACE] Triggered `validAttributesForMarkedText`
[2022-05-09][16:01:14][tao::platform_impl::platform::view][TRACE] Completed `validAttributesForMarkedText`
[2022-05-09][16:01:14][tao::platform_impl::platform::view][TRACE] Completed `validAttributesForMarkedText`
[2022-05-09][16:01:14][tao::platform_impl::platform::view][TRACE] Triggered `validAttributesForMarkedText`
[2022-05-09][16:01:14][tao::platform_impl::platform::view][TRACE] Triggered `validAttributesForMarkedText`
[2022-05-09][16:01:14][tao::platform_impl::platform::view][TRACE] Completed `validAttributesForMarkedText`
[2022-05-09][16:01:14][tao::platform_impl::platform::view][TRACE] Completed `validAttributesForMarkedText`
[2022-05-09][16:01:14][tao::platform_impl::platform::view][TRACE] Triggered `viewDidMoveToWindow`
[2022-05-09][16:01:14][tao::platform_impl::platform::view][TRACE] Triggered `viewDidMoveToWindow`
[2022-05-09][16:01:14][tao::platform_impl::platform::view][TRACE] Completed `viewDidMoveToWindow`
[2022-05-09][16:01:14][tao::platform_impl::platform::view][TRACE] Completed `viewDidMoveToWindow`
[2022-05-09][16:01:14][tao::platform_impl::platform::app_delegate][TRACE] Triggered `applicationDidFinishLaunching`
[2022-05-09][16:01:14][tao::platform_impl::platform::app_delegate][TRACE] Triggered `applicationDidFinishLaunching`
[2022-05-09][16:01:14][tao::platform_impl::platform::app_state][TRACE] Activating visible window
[2022-05-09][16:01:14][tao::platform_impl::platform::app_state][TRACE] Activating visible window
[2022-05-09][16:01:14][tao::platform_impl::platform::app_delegate][TRACE] Completed `applicationDidFinishLaunching`
[2022-05-09][16:01:14][tao::platform_impl::platform::app_delegate][TRACE] Completed `applicationDidFinishLaunching`
[2022-05-09][16:01:14][tao::platform_impl::platform::window_delegate][TRACE] Triggered `windowDidBecomeKey:`
[2022-05-09][16:01:14][tao::platform_impl::platform::window_delegate][TRACE] Triggered `windowDidBecomeKey:`
[2022-05-09][16:01:14][tao::platform_impl::platform::window_delegate][TRACE] Completed `windowDidBecomeKey:`
[2022-05-09][16:01:14][tao::platform_impl::platform::window_delegate][TRACE] Completed `windowDidBecomeKey:`
[2022-05-09][16:01:16][tao::platform_impl::platform::window_delegate][TRACE] Triggered `windowShouldClose:`
[2022-05-09][16:01:16][tao::platform_impl::platform::window_delegate][TRACE] Triggered `windowShouldClose:`
[2022-05-09][16:01:16][tao::platform_impl::platform::window_delegate][TRACE] Completed `windowShouldClose:`
[2022-05-09][16:01:16][tao::platform_impl::platform::window_delegate][TRACE] Completed `windowShouldClose:`
[2022-05-09][16:01:16][tao::platform_impl::platform::window][TRACE] Dropping `UnownedWindow` (0x6000002ec7e0)
[2022-05-09][16:01:16][tao::platform_impl::platform::window][TRACE] Dropping `UnownedWindow` (0x6000002ec7e0)

[stronghold] get_store_record

When my app start for the first time. I have no records stored.
I try to get these record to check if exists.

 let url = "https://myurl.com"
 let snapshot_path: PathBuf = PathBuf::from("./.config");
    stronghold_init(snapshot_path.clone(), "password".to_string()).await?;
    let url_record: String = get_value(snapshot_path, Location::generic("url", "url" )).await?;
    println!("myvalue : {} ", url_record);
    if url_record == "" {
       //the goal is to save url when no exist
        save_value(snapshot_path,Location::generic("url", "url" ), url, None);
        println!("no value");
    }
    else {
        println!("value !!");
    }
async fn stronghold_init(snapshot_path: PathBuf, password: String) -> Result<()> {
    let api = stronghold::Api::new(snapshot_path.clone());
    api.load(password_to_key(&password)).await?;
    Ok(())
}
pub async fn get_value(
    snapshot_path: PathBuf,
    location: Location,
  ) -> Result<String> {
        let api = stronghold::Api::new(&snapshot_path);
        let store: stronghold::Store = api.get_store(MyStore", vec![]);
        let record = store.get_record(location.into()).await?;
        Ok(record)
}

So the expected record is "".
I have to see, at least, myvalue into the console. But get nothing. The get_value fn return nothing when record does not exist

[stronghold] Rust api

There is a javascript example how to use api.
It could be awesome to do the same thing with rust.

[positioner] Add tray features

  1. Add these variants to Position
enum Position {
   // other members
   TrayLeft {
      position: PhysicalPosition<i32>,
      size: PhysicalSize<i32>
   },
   TrayBottomLeft {
      position: PhysicalPosition<i32>,
      size: PhysicalSize<i32>
   },
   TrayRight {
      position: PhysicalPosition<i32>,
      size: PhysicalSize<i32>
   },
   TrayBottomRight {
      position: PhysicalPosition<i32>,
      size: PhysicalSize<i32>
   },
   TrayCenter {
      position: PhysicalPosition<i32>,
      size: PhysicalSize<i32>
   },
   TrayBottomCenter {
      position: PhysicalPosition<i32>,
      size: PhysicalSize<i32>
   }
}

And maybe implement From for these? Or maybe define a better struct like:

struct TrayPosition {
   position: PhysicalPosition<i32>,
   size: PhysicalSize<i32>
}
  1. guard behind system-tray flag that enables the same flag on tauri

[fs-watch] _unwatch in example doesn't seem to work: missing field `event`

Thanks for making this plugin!

I'm trying to run this example:

https://github.com/tauri-apps/tauri-plugin-fs-watch/blob/f29bba3da845223fa3b9b59e5a17477ca3f93c72/examples/svelte-app/src/App.svelte#L20-L25

using the following code

    <button
      on:click={async () => await _unwatch().catch((error) => console.log(error))}
      disabled={stopWatching === null}
    >

but I'm getting the following error when I click on the button that calls _unwatch:

Screen Shot 2022-03-24 at 1 36 03 PM

I think it has to do with this block but I'm not sure.

https://github.com/tauri-apps/tauri-plugin-fs-watch/blob/f29bba3da845223fa3b9b59e5a17477ca3f93c72/webview-src/index.ts#L54-L56

Any suggestions on how to proceed?

[sql] type = $1 is invalid,No results

export const selectList = async (type: string) => {
return await dbPath.select('select * from project where type = $1 and status = 0 order by create_date desc', [ type ])
}

[sql] is this already usable?

I am having problems implementing this plugin:

PS C:\Users\alexa\kapla5> yarn tauri dev          
yarn run v1.22.17
$ tauri dev
 app:spawn Running "C:\Users\alexa\kapla5\node_modules\@tauri-apps\cli\bin\tauri-cli.exe tauri dev" +0ms

warning: unused manifest key: dependencies.tauri-plugin-sql.commit
   Compiling sqlx-core v0.5.10
   Compiling app v0.1.0 (C:\Users\alexa\kapla5\src-tauri)
error[E0599]: no variant or associated item named `OutOfMemory` found for enum `ErrorKind` in the current scope
   --> C:\Users\alexa\.cargo\registry\src\github.com-1ecc6299db9ec823\sqlx-core-0.5.10\src\sqlite\connection\establish.rs:107:32
    |
107 |                 io::ErrorKind::OutOfMemory,
    |                                ^^^^^^^^^^^ variant or associated item not found in `ErrorKind`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0599`.
error: could not compile `sqlx-core`

But I am getting the impression that it might not be ready yet (tauri-apps/tauri-plugin-sql#7).

Should it work when following the instructions?

[sql] Documentation Request

Please provide a screenshot of how the app should look when running in the README.md.

For context, I have built this to act as a learning tool for me. Was hoping to contribute back another example app using VueJS just to round things out but while I'm immediately able to run the app and it gives me an input field to put in a TODO but pressing return or the button results in no listing of TODO's.

Since this is a native app, I went to the macOS console app to find an error and indeed found a three of the same error type:

<TCCDProcess: identifier=todos_app-65a2bb5f228f9abf, pid=30688, auid=501, euid=501, binary_path=/Applications/todos-app.app/Contents/MacOS/todos-app> attempted to call TCCAccessRequest for kTCCServiceAccessibility without the recommended com.apple.private.tcc.manager.check-by-audit-token entitlement

Now this probably makes sense but to encourage users to dip in and get started I think failures like this will give the wrong signal. Not really sure how to parse what's missing here but hopefully there is something compact that could go into the README here too to avoid newbie's like myself hitting a wall.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.