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

Move HybridWebView platform code to handlers #24479

Merged
merged 7 commits into from
Sep 23, 2024

Conversation

Eilon
Copy link
Member

@Eilon Eilon commented Aug 27, 2024

And run everything through the mappers.

Fixes #24269

@Eilon Eilon added the area-controls-hybridwebview HybridWebView control label Aug 27, 2024
@Eilon Eilon requested a review from a team as a code owner August 27, 2024 23:30
@Eilon
Copy link
Member Author

Eilon commented Aug 28, 2024

@mattleibow / @tj-devel709 - CI is green, just awaiting your review.

Copy link
Member

@mattleibow mattleibow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Semi-nitty, semi-not.

This code is looking much better, but a few changes will be needed to make the command be where all the action takes place. But, mostly there.

src/Core/src/Core/IHybridWebView.cs Outdated Show resolved Hide resolved
}


public static async void MapInvokeJavaScriptAsync(IHybridWebViewHandler handler, IHybridWebView hybridWebView, object? arg)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@PureWeen I think this needs that fakesync with the FireAndForget method - especially for logging?

This is a "pattern":

void MapSomething(IViewHandler handler, IView view, object args)
{
    MapSomethingAsync(handler, view, args).FireAndForget(handler);
}
Task MapSomethingAsync(IViewHandler handler, IView view, object args)
{
    // the real code
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Of course this means that either MapInvokeJavaScriptAsyncAsync will exist or a MapInvokeJavaScriptAsyncInternal :) Lovely, but secret lovely.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be the FireAndForget system to make sure errors are logged and does not accidentally crash some iOS situations.

src/Controls/src/Core/HybridWebView/HybridWebView.cs Outdated Show resolved Hide resolved
src/Controls/src/Core/HybridWebView/HybridWebView.cs Outdated Show resolved Hide resolved
src/Controls/src/Core/HybridWebView/HybridWebView.cs Outdated Show resolved Hide resolved
@Eilon
Copy link
Member Author

Eilon commented Aug 30, 2024

@mattleibow - I pushed an update based on our discussion. Please let me know if there's anything else necessary so we can merge.

And run everything through the mappers.

Fixes #24269
@Eilon
Copy link
Member Author

Eilon commented Sep 11, 2024

@mattleibow alright I think I've made all the suggested changes or replied with comments. Just waiting for CI to make the verdict.

@PureWeen PureWeen enabled auto-merge (squash) September 21, 2024 19:04
@rmarinho rmarinho merged commit 693e544 into net9.0 Sep 23, 2024
117 of 121 checks passed
@rmarinho rmarinho deleted the eilon/hwv-platform-cleanup branch September 23, 2024 12:07
rmarinho added a commit that referenced this pull request Sep 23, 2024
@rmarinho rmarinho restored the eilon/hwv-platform-cleanup branch September 23, 2024 15:04
rmarinho added a commit that referenced this pull request Sep 24, 2024
* Revert "Move HybridWebView platform code to handlers (#24479)"

This reverts commit 693e544.

* - disable HybridWebViewTests

---------

Co-authored-by: Shane Neuville <[email protected]>
@samhouts samhouts added the fixed-in-net9.0-nightly This may be available in a nightly release! label Oct 1, 2024
@rmarinho rmarinho deleted the eilon/hwv-platform-cleanup branch October 4, 2024 17:26
@samhouts samhouts added fixed-in-9.0.0-rc.2.24503.2 and removed fixed-in-net9.0-nightly This may be available in a nightly release! labels Oct 14, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Nov 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants