-
Notifications
You must be signed in to change notification settings - Fork 87
Remove built_value dependency from DebugInfo #2739
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
Conversation
| extensionUrl: windowContext['\$dartExtensionUri'] as String?, | ||
| isInternalBuild: windowContext['\$isInternalBuild'] as bool?, | ||
| isFlutterApp: windowContext['\$isFlutterApp'] as bool?, | ||
| ).toJson(), |
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 we need to call .toJson() on the value passed t jsonEncode()? I'm not super familiar with the best practices here so maybe this is normal but it seems unnecessary based on the docs.
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.
You're absolutely right! Calling .toJson() before passing to jsonEncode() is redundant. Thanks
| final json = value is String | ||
| ? value | ||
| : value is DebugInfo | ||
| ? jsonEncode(value.toJson()) |
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.
ditto
dwds/web/client.dart
Outdated
| isInternalBuild: windowContext.$isInternalBuild, | ||
| isFlutterApp: windowContext.$isFlutterApp, | ||
| workspaceName: dartWorkspaceName, | ||
| ).toJson(), |
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.
ditto
|
Note: The callstack test failures are unrelated to this PR. They appear to be a regression in the current SDK dev release (3.11.0-260.0.dev) used by the bots, as they do not reproduce on the main branch. |
DebugInfo:
This PR removes the
package:built_valuedependency fromDebugInfoand replaces it with standard Dart JSON serialization.Changes
DebugInfoas a simple Dart class with manual JSON serializationDebugInfofrom the@SerializersForannotation in serializers.darttoJson()for serialization instead of the builder patternDebugInfoserialization/deserialization:serializers.deserializetoDebugInfo.fromJson()toJson()DebugInfoininterceptMessage<T>()DebugInfoin storage operationsdebug_info.g.dartTesting
ConnectRequest,HotReloadRequest,HotReloadResponse,HotRestartRequest,HotRestartResponse,ServiceExtensionRequest, andServiceExtensionResponseFixes dart-lang/sdk#62295