Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(core): add shadow APIs #6206

Merged
merged 13 commits into from
Feb 7, 2023
Merged

feat(core): add shadow APIs #6206

merged 13 commits into from
Feb 7, 2023

Conversation

amrbashir
Copy link
Member

@amrbashir amrbashir commented Feb 6, 2023

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Docs
  • New Binding issue #___
  • Code style update
  • Refactor
  • Build-related changes
  • Other, please describe:

Does this PR introduce a breaking change?

  • Yes, and the changes were approved in issue #___
  • No

Checklist

  • When resolving issues, they are referenced in the PR's title (e.g fix: remove a typo, closes #___, #___)
  • A change file is added if any packages will require a version bump due to this PR per the instructions in the readme.
  • I have added a convincing reason for adding this feature, if necessary

Other information

@amrbashir amrbashir requested a review from a team as a code owner February 6, 2023 14:26
@lucasfernog
Copy link
Member

@amrbashir maybe you meant to open this against the next branch?

@amrbashir
Copy link
Member Author

yeah my bad

@amrbashir amrbashir changed the base branch from dev to next February 6, 2023 21:03
@amrbashir amrbashir requested a review from a team as a code owner February 6, 2023 21:03
@amrbashir
Copy link
Member Author

not sure why the CI fails, I can't replicate the error it shows locally

@lucasfernog lucasfernog merged commit a81750d into next Feb 7, 2023
@lucasfernog lucasfernog deleted the feat/shadow branch February 7, 2023 22:38
@aleksey-hoffman
Copy link

aleksey-hoffman commented Apr 8, 2023

@lucasfernog are types added later? The shadow property wasn't added to the window type.
It is not working in tauri-v2.0.0-alpha.6

image

@lucasfernog
Copy link
Member

lucasfernog commented Apr 8, 2023

@aleksey-hoffman did you update @tauri-apps/api to 2.0.0-alpha.2 and @tauri-apps/cli to 2.0.0-alpha.6?

@aleksey-hoffman
Copy link

aleksey-hoffman commented Apr 8, 2023

@lucasfernog my package.json looks like this:

 "dependencies": {
    "@tauri-apps/api": "2.0.0-alpha.2",
  },
  "devDependencies": {
    "@tauri-apps/cli": "^1.2.3",
  }

When I try to upgrade @tauri-apps/cli like this:

    "@tauri-apps/cli": "2.0.0-alpha.6",

I get the following error on npm run tauri dev:

error: failed to select a version for `tauri`.
    ... required by package `app v0.1.0 (C:\app\src-tauri)`
versions that meet the requirements `^1.2.4` (locked to 1.2.4) are: 1.2.4

the package `app` depends on `tauri`, with features: `native-tls` but `tauri` does not have these features.


failed to select a version for `tauri` which could resolve this conflict

@aleksey-hoffman
Copy link

aleksey-hoffman commented Apr 8, 2023

@lucasfernog my Cargo.toml looks like this:

[package]
name = "app"
version = "0.1.0"
default-run = "app"
edition = "2021"
rust-version = "1.64"

[build-dependencies]
tauri-build = { version = "1.2.1", features = [] }

[dependencies]
serde_json = "1.0"
serde = { version = "1.0", features = ["derive"] }
tauri = { version = "1.2.4", features = ["path-all", "protocol-asset", "system-tray", "window-center", "window-close", "window-create", "window-hide", "window-maximize", "window-minimize", "window-print", "window-request-user-attention", "window-set-always-on-top", "window-set-cursor-grab", "window-set-cursor-icon", "window-set-cursor-position", "window-set-cursor-visible", "window-set-decorations", "window-set-focus", "window-set-fullscreen", "window-set-icon", "window-set-ignore-cursor-events", "window-set-max-size", "window-set-min-size", "window-set-position", "window-set-resizable", "window-set-size", "window-set-skip-taskbar", "window-set-title", "window-show", "window-start-dragging", "window-unmaximize", "window-unminimize"] }

@lucasfernog
Copy link
Member

You must change tauri = { version = "1.2.4" to tauri = { version = "2.0.0-alpha.6" and tauri-build = { version = "1.2.1" to tauri-build = { version = "2.0.0-alpha.3". You're not using the 2.0 branch at all, and this feature is only available on the 2.0 alpha. You might need to change more stuff since 2.0 has a couple breaking changes.

@aleksey-hoffman
Copy link

@lucasfernog

I upgraded cli:

cargo install tauri-cli --version "^2.0.0-alpha"

Then, once I tried upgrading the tauri versions I got the following error (after running either of these commands):

cargo add tauri@2.0.0-alpha.6
cargo add tauri-build@2.0.0-alpha.3 --build

Error:

error: failed to select a version for `webkit2gtk`.
    ... required by package `wry v0.27.0`
    ... which satisfies dependency `wry = "^0.27"` of package `tauri-runtime-wry v0.13.0-alpha.3`
    ... which satisfies dependency `tauri-runtime-wry = "^0.13.0-alpha.3"` of package `tauri v2.0.0-alpha.6`
    ... which satisfies dependency `tauri = "^2.0.0-alpha.6"` of package `app v0.1.0 (C:\app\src-tauri)`
versions that meet the requirements `^0.19.2` are: 0.19.2

all possible versions conflict with previously selected packages.

  previously selected package `webkit2gtk v0.19.1`
    ... which satisfies dependency `webkit2gtk = "^0.19.1"` of package `tauri v2.0.0-alpha.6`
    ... which satisfies dependency `tauri = "^2.0.0-alpha.6"` of package `app v0.1.0 (C:\app\src-tauri)`

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

@lucasfernog
Copy link
Member

Try removing your Cargo.lock file or running rustup update.

@aleksey-hoffman
Copy link

aleksey-hoffman commented Apr 8, 2023

@lucasfernog deleted lock and ran rustup update.

I can update to the following versions:

[build-dependencies]
tauri-build = { version = "2.0.0-alpha.3", ...

[dependencies]
tauri = { version = "2.0.0-alpha.2" ...

But trying to update to the newer once, throwing the wry webkit2gtk error specified in the previous message.

Does it need a newer version of rust? I'm using 1.64, on latest Windows 11

@aleksey-hoffman
Copy link

@lucasfernog I found that the problem is caused by this plugin:

tauri-plugin-store = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "dev" }

If I change the branch to "next", it's working

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants