Skip to content

Remove usage of custom marshaller #40169

@alexdima

Description

@alexdima

tl;dr - You shall not use URI in signatures or the types referenced from extHost.protocol.ts anymore. Use UriComponents and URI.revive instead

We use a custom marshaller in the extension host <-> renderer communication layer. It treats URI and RegExp specially, and makes them like JSON primitive types. This is helpful, for example, when passing an argument of type URI over the wire, you know for a fact that on the receiving side, the object is an instance of URI.

However, this is expensive, as it needs to run on each and every object sent over the wire, in a deep, recursive manner. It is very easy to avoid using the custom marshaller, simply replace the usage of URI with UriComponents which is JSON friendly (an interface without methods). Then, in the implementation, you can use URI.revive(...) to get back a real URI.

For RegExp objects (extremely rare usage), you're gonna have to roll your own strategy.

All edits should result in removing ProxyType.CustomMarshaller from the proxies defined in extHost.protocol.ts.

See b64355b for an example adoption


Remaining: 12 out of 49:

Metadata

Metadata

Assignees

Labels

debtCode quality issuesperf

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions