Skip to content

Conversation

kblok
Copy link
Member

@kblok kblok commented Oct 21, 2025

Breaking Change: EvaluateExpression and EvalauteFunction with no generic type will return no value. That's because the default type of CDP is a JsonElement and the default type of BiDi is a RemoteValue.

@kblok kblok changed the base branch from master to v21 October 21, 2025 18:17
@kblok kblok requested a review from Copilot October 21, 2025 18:17
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements BiDi (Browser Bidirectional) protocol support for JsonValue operations, introducing a breaking change where EvaluateExpression and EvaluateFunction methods without generic type parameters now return Task instead of Task<JsonElement?>. This change accommodates the different default return types between CDP (Chrome DevTools Protocol) which returns JsonElement and BiDi which returns RemoteValue.

Key changes:

  • Modified method signatures to return Task instead of Task<JsonElement?> for non-generic evaluation methods
  • Implemented JsonValueAsync support in BidiJSHandle with primitive value deserialization
  • Updated type handling in BidiRealm to support object type instead of JsonElement?

Reviewed Changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
IPage.cs, IFrame.cs, WebWorker.cs, Page.cs, Frame.cs, Realm.cs, IsolatedWorld.cs Changed return type from Task<JsonElement?> to Task for non-generic EvaluateExpressionAsync and EvaluateFunctionAsync methods
BidiRealm.cs Updated type handling to use object instead of JsonElement?, fixed struct property setting with boxing/unboxing, and changed non-generic evaluation methods to throw NotImplementedException
BidiJSHandle.cs Implemented JsonValueAsync method with primitive value deserialization support including string, int, double, bool, decimal, and DateTime types
Test files Updated test assertions to use generic type parameters where previously relying on non-generic methods
TestExpectations.local.json Removed test expectation rule that was marking jshandle.spec jsonValue tests as failing for webDriverBiDi

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

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.

1 participant