-
-
Notifications
You must be signed in to change notification settings - Fork 738
refactor: Migrating from Newtonsoft.Json to System.Text.Json #917
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
refactor: Migrating from Newtonsoft.Json to System.Text.Json #917
Conversation
|
Can you resolve the conflicts? I know its annoying, but right now due to the conflicts it does not show the true diff (many of the changes are already in |
|
Yes, absolutely! |
|
@Denny09310 - this doesn't look right. The PR is still including my commits. You need to rebase onto the develop branch, instead of submitting with merge commit. |
b1c3f66 to
dfe04f1
Compare
|
Hope to have done everything right. Sorry but I don't use GitHub at this level frequently so I don't know how to do everything 😅 |
All perfect now, thanks! |
|
What was it, what made the one test fail? |
It was |
…directly instead of JsonSerializer.Deserialize(JsonElement), removed some unused attributes
|
@softworkz @FlorianRappl Okay, probably something I was doing wrong long before this PR, I'm going to replace all the |
…ting except mixed arrays
|
As the commit description says, I've refactored all |
Of course if we know the |
FlorianRappl
left a comment
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.
LGTM - thanks for the superb work @Denny09310 !
|
@Denny09310, @FlorianRappl There is an error in this PR. IpcMain.cs public void Send(BrowserWindow browserWindow, string channel, params object[] data)
{
BridgeConnector.Socket.Emit("sendToIpcRenderer", browserWindow, channel, data);
}This causes data to always be sent as array, to reproduce fire a demo app -> "Get app and system information" -> "Get screen information". This will fail to show correct display size, a quick debug shows that IpcMain sends Demo app code: Electron.IpcMain.On("screen-info", async (args) =>
{
var display = await Electron.Screen.GetPrimaryDisplayAsync();
var mainWindow = Electron.WindowManager.BrowserWindows.First();
Electron.IpcMain.Send(mainWindow, "got-screen-info", display.Size);
}); |
|
Great catch. Yes, needs to be fixed. Thanks for spotting. |
False alarm, this is not a new bug and was present before the change to |
|
I ran all version all the way back to start of refactoring, all have the same problem with sending Tried everything but cannot figure out the reason for this behaviour. |
This PR replaces Newtonsoft.Json with the built-in System.Text.Json. The tests were taken from @softworkz’s branch and all are passing, except for the two already noted in issue #913.