@remote-ui/rpc
Advanced tools
Comparing version
@@ -123,6 +123,2 @@ 'use strict'; | ||
if (value instanceof ArrayBuffer) { | ||
return value; | ||
} | ||
if (Array.isArray(value)) { | ||
@@ -193,5 +189,7 @@ return value.map(value => decode(value, retainedBy)); | ||
return Object.keys(value).reduce((object, key) => ({ ...object, | ||
[key]: decode(value[key], retainedBy) | ||
}), {}); | ||
if (memory.isBasicObject(value)) { | ||
return Object.keys(value).reduce((object, key) => ({ ...object, | ||
[key]: decode(value[key], retainedBy) | ||
}), {}); | ||
} | ||
} | ||
@@ -198,0 +196,0 @@ |
# Changelog | ||
## 1.4.5 | ||
### Patch Changes | ||
- [#255](https://github.com/Shopify/remote-ui/pull/255) [`c89ffb7`](https://github.com/Shopify/remote-ui/commit/c89ffb780660bda113c5e76ca10e46d4ffaf6072) Thanks [@robin-drexler](https://github.com/robin-drexler)! - allow File and other object types to be send over the RPC layer | ||
## 1.4.4 | ||
@@ -4,0 +10,0 @@ |
{ | ||
"name": "@remote-ui/rpc", | ||
"description": "An RPC library with strong support for simulating the transfer of functions via postMessage", | ||
"version": "1.4.4", | ||
"version": "1.4.5", | ||
"publishConfig": { | ||
@@ -6,0 +6,0 @@ "access": "public" |
@@ -23,7 +23,7 @@ # `@remote-ui/rpc` | ||
Polyfills for all of these features (via [`core-js`](https://github.com/zloirock/core-js) and [regenerator-runtime](https://github.com/facebook/regenerator/tree/master/packages/regenerator-runtime)) are imported automatically with the “default” version of this package. If you have a build system that is smart about adding polyfills, you can configure it to [prefer (and process) a special build meant to minimize polyfills](../documentation/guides/polyfills.md). | ||
Polyfills for all of these features (via [`core-js`](https://github.com/zloirock/core-js) and [regenerator-runtime](https://github.com/facebook/regenerator/tree/master/packages/regenerator-runtime)) are imported automatically with the “default” version of this package. If you have a build system that is smart about adding polyfills, you can configure it to [prefer (and process) a special build meant to minimize polyfills](/documentation/guides/polyfills.md). | ||
## Usage | ||
Most developers will not need to know about `@remote-ui/rpc`. The [comprehensive example](../documentation/comprehensive-example.md) shows how a developer can use the higher-level abstractions available in `@remote-ui/core` and `@remote-ui/web-workers` to build a powerful, remote-ui-powered UI. However, users with more complex needs may need to use this library directly, such as those constructing remote environments around an object other than a web worker. | ||
Most developers will not need to know about `@remote-ui/rpc`. The [comprehensive example](/documentation/comprehensive-example.md) shows how a developer can use the higher-level abstractions available in `@remote-ui/core` and `@remote-ui/web-workers` to build a powerful, remote-ui-powered UI. However, users with more complex needs may need to use this library directly, such as those constructing remote environments around an object other than a web worker. | ||
@@ -30,0 +30,0 @@ ### `createEndpoint()` |
@@ -147,6 +147,2 @@ import { | ||
if (value instanceof ArrayBuffer) { | ||
return value; | ||
} | ||
if (Array.isArray(value)) { | ||
@@ -213,9 +209,11 @@ return value.map((value) => decode(value, retainedBy)); | ||
return Object.keys(value).reduce( | ||
(object, key) => ({ | ||
...object, | ||
[key]: decode((value as any)[key], retainedBy), | ||
}), | ||
{}, | ||
) as any; | ||
if (isBasicObject(value)) { | ||
return Object.keys(value).reduce( | ||
(object, key) => ({ | ||
...object, | ||
[key]: decode((value as any)[key], retainedBy), | ||
}), | ||
{}, | ||
) as any; | ||
} | ||
} | ||
@@ -222,0 +220,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
170702
0.13%2557
-0.12%