Skip to content

refactor: take advantage of structured clone algorithm in the remote module - #20427

Merged
jkleinsc merged 1 commit into
masterfrom
miniak/simplify-remote
Oct 10, 2019
Merged

jkleinsc merged 1 commit into
masterfrom
miniak/simplify-remote

Conversation

@miniak

@miniak miniak commented Oct 4, 2019 •

Copy link
Copy Markdown
Contributor

Description of Change

Take advantage of structured clone algorithm based IPC introduced by #20214:

  • Date, ArrayBuffer and ArrayBufferView can now be serialized as values.
  • Keeping special handling to preserve Buffer, otherwise it will be converted to UInt8Array.
  • Use native serialization for Boolean, Number, String and RegExp.
  • Error is now serialized natively. Preserve custom properties in the remote module.

Checklist

Release Notes

Notes: The remote module now properly serializes Boolean, Number, String and RegExp instances.

@electron-cation electron-cation Bot added the new-pr 🌱 PR opened recently label Oct 4, 2019
@miniak miniak mentioned this pull request Oct 4, 2019
6 tasks done
@miniak miniak added the wip ⚒ label Oct 4, 2019
@miniak miniak self-assigned this Oct 4, 2019
@electron-cation electron-cation Bot removed the new-pr 🌱 PR opened recently label Oct 5, 2019
@miniak
miniak force-pushed the miniak/simplify-remote branch 3 times, most recently from 22a6894 to d4d7b2b Compare October 9, 2019 18:27
@miniak
miniak changed the base branch from cloneable-message-ipc to master October 9, 2019 18:28
@miniak miniak removed the wip ⚒ label Oct 9, 2019
@miniak
miniak requested a review from nornagon October 9, 2019 18:29
@miniak
miniak marked this pull request as ready for review October 9, 2019 18:29
@miniak

miniak commented Oct 9, 2019 •

Copy link
Copy Markdown
Contributor Author

@nornagon can you please review? I am planning to address error / exception serialization separately. There is some duplicate code there.

@miniak
miniak requested review from deepak1556 and zcbenz October 9, 2019 18:32
Comment thread lib/browser/remote/server.ts Resolved
Comment thread lib/browser/remote/server.ts Resolved
@miniak
miniak force-pushed the miniak/simplify-remote branch 2 times, most recently from 88a2e1d to 11d9444 Compare October 9, 2019 20:33
@miniak miniak added the wip ⚒ label Oct 9, 2019
@miniak

miniak commented Oct 9, 2019

Copy link
Copy Markdown
Contributor Author

@nornagon do we mind loosing the from property indicating which process the Error came from, which was added by the old errorUtils serializer?

@miniak
miniak force-pushed the miniak/simplify-remote branch from 11d9444 to f4e474e Compare October 9, 2019 21:15
Comment thread lib/common/remote/type-utils.ts Resolved

@nornagon nornagon left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nice cleanup. remote is still a jungle but at least it's trending less jungle-y!

Comment thread lib/renderer/api/remote.js Resolved
@miniak miniak removed the wip ⚒ label Oct 9, 2019
@jkleinsc
jkleinsc merged commit b92163d into master Oct 10, 2019
@release-clerk

release-clerk Bot commented Oct 10, 2019

Copy link
Copy Markdown

Release Notes Persisted

The remote module now properly serializes Boolean, Number, String and RegExp instances.

@jkleinsc
jkleinsc deleted the miniak/simplify-remote branch October 10, 2019 13:59
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.

3 participants