-
Notifications
You must be signed in to change notification settings - Fork 87
remove built_value dependency from DevToolsRequest/DevToolsResponse #2742
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
base: main
Are you sure you want to change the base?
Conversation
|
autosubmit label was removed for dart-lang/webdev/2742, because Pull request dart-lang/webdev/2742 is not in a mergeable state. |
| class DevToolsRequest { | ||
| /// Identifies a given application, across tabs/windows. | ||
| String get appId; | ||
| final String? appId; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do these need to be non-nullable?
| } | ||
|
|
||
| @override | ||
| int get hashCode => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't the greatest way to calculate a hash code. Consider using Object.hash(...) instead.
|
|
||
| @override | ||
| int get hashCode => | ||
| success.hashCode ^ promptExtension.hashCode ^ error.hashCode; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here.
| } | ||
|
|
||
| static Object? _deserialize(dynamic decoded) { | ||
| if (decoded is List && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can use object destructuring:
if (decoded case ['DevToolsRequest', final Map<String, Object?> request]) {
return DevToolsRequest.fromJson(request);
}
DevToolsRequest/DevToolsResponse
This PR removes the
package:built_valuedependency fromDevToolsRequestandDevToolsResponseand replaces it with standard Dart JSON serialization.Changes
DevToolsRequestandDevToolsResponseas simple Dart classes with manual JSON serializationDevToolsRequestandDevToolsResponsefrom the@SerializersForannotation in serializers.dartdev_handler.dartto use the wire format['DevToolsRequest', json]and['DevToolsResponse', json]extension_debugger.dartto manually deserializeDevToolsRequestclient.dartto use named parameters andtoJson()for serializationdebug_session.dartin the extension to handle the new class structuredevtools_request.g.dartTesting
DebugEvent,ConnectRequest,RunRequest,BuildResult, and other RPC classesFixes dart-lang/sdk#62296