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: on page load handler #980

Merged
merged 21 commits into from
Jul 23, 2023
Merged

Conversation

jhutchins
Copy link
Contributor

@jhutchins jhutchins commented Jun 25, 2023

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Docs
  • Code style update
  • Refactor
  • Build-related changes
  • Other, please describe:

Does this PR introduce a breaking change?

  • Yes
  • No

Checklist

  • This PR will resolve #___
  • 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
  • It can be built on all targets and pass CI/CD.

Other information

@jhutchins
Copy link
Contributor Author

I haven't added the change files yet and I need to test the Mac implementation, which I'm the most uncertain about, but thought I'd put this out there for early feedback.

@jhutchins jhutchins marked this pull request as ready for review June 26, 2023 17:46
@jhutchins jhutchins requested a review from a team as a code owner June 26, 2023 17:46
src/webview/wkwebview/mod.rs Outdated Show resolved Hide resolved
src/webview/mod.rs Outdated Show resolved Hide resolved
src/webview/mod.rs Outdated Show resolved Hide resolved
src/webview/webview2/mod.rs Show resolved Hide resolved
@jhutchins
Copy link
Contributor Author

I've added all three handlers and I believe addressed all concerns and comments.

@jhutchins jhutchins requested a review from amrbashir June 29, 2023 01:20
src/webview/mod.rs Outdated Show resolved Hide resolved
src/webview/mod.rs Outdated Show resolved Hide resolved
src/webview/android/binding.rs Outdated Show resolved Hide resolved
src/webview/android/kotlin/RustWebViewClient.kt Outdated Show resolved Hide resolved
src/webview/android/kotlin/RustWebViewClient.kt Outdated Show resolved Hide resolved
src/webview/android/mod.rs Outdated Show resolved Hide resolved
src/webview/mod.rs Outdated Show resolved Hide resolved
src/webview/webview2/mod.rs Outdated Show resolved Hide resolved
src/webview/webview2/mod.rs Outdated Show resolved Hide resolved
src/webview/wkwebview/mod.rs Outdated Show resolved Hide resolved
src/webview/android/kotlin/RustWebViewClient.kt Outdated Show resolved Hide resolved
@jhutchins
Copy link
Contributor Author

I'm just going to remove the handler for navigation starting.

@jhutchins jhutchins requested a review from amrbashir July 16, 2023 13:07
amrbashir
amrbashir previously approved these changes Jul 17, 2023
@amrbashir
Copy link
Member

LGTM but I will keep the PR open a while for @wusyong and @lucasfernog to give their approvals too

@wusyong
Copy link
Member

wusyong commented Jul 18, 2023

LGTM but there's still a clippy error.

@lucasfernog
Copy link
Member

I would consider using a single event function with_on_page_load_handler with an enum payload PageLoadEvent { Started, Finished } instead of two separate functions.

@jhutchins
Copy link
Contributor Author

@wusyong There is a clippy error, but I'm not sure how you all would like it resolved. The error is due to new lints applied to old code, not anything that I added. The issue is a structure that is a unit class for some environment and not for others so default is used to create it, but using default to build a unit struct is now a clippy violation. I think the most straight forward is to add a lint exclusion, but it's possible you want a different solution.

@lucasfernog I could make that change.

@jhutchins
Copy link
Contributor Author

@lucasfernog I made those changes to the public API.

@wusyong I opted to just just allow the clippy violation, but could do something else.

wusyong
wusyong previously approved these changes Jul 20, 2023
@wusyong wusyong requested a review from lucasfernog July 20, 2023 13:57
@wusyong wusyong merged commit 7a353c7 into tauri-apps:dev Jul 23, 2023
7 checks passed
@github-actions github-actions bot mentioned this pull request Jul 23, 2023
@jhutchins jhutchins deleted the feat/on-load-hook branch July 24, 2023 19:09
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.

5 participants