Socket
Socket
Sign inDemoInstall

@remote-ui/core

Package Overview
Dependencies
2
Maintainers
3
Versions
86
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.3.0 to 1.4.0

LICENSE.md

6

build/cjs/index.js

@@ -54,2 +54,8 @@ "use strict";

});
Object.defineProperty(exports, "KIND_ROOT", {
enumerable: true,
get: function get() {
return _types.KIND_ROOT;
}
});
Object.defineProperty(exports, "KIND_COMPONENT", {

@@ -56,0 +62,0 @@ enumerable: true,

2

build/cjs/root.js

@@ -45,2 +45,4 @@ "use strict";

var remoteRoot = {
kind: _types.KIND_ROOT,
get children() {

@@ -47,0 +49,0 @@ return children.get(remoteRoot);

12

build/cjs/types.js

@@ -6,3 +6,3 @@ "use strict";

});
exports.KIND_TEXT = exports.KIND_COMPONENT = exports.RemoteKind = exports.UPDATE_REMOVE = exports.UPDATE_INSERT = exports.ACTION_UPDATE_PROPS = exports.ACTION_UPDATE_TEXT = exports.ACTION_REMOVE_CHILD = exports.ACTION_INSERT_CHILD = exports.ACTION_MOUNT = void 0;
exports.KIND_TEXT = exports.KIND_COMPONENT = exports.KIND_ROOT = exports.UPDATE_REMOVE = exports.UPDATE_INSERT = exports.ACTION_UPDATE_PROPS = exports.ACTION_UPDATE_TEXT = exports.ACTION_REMOVE_CHILD = exports.ACTION_INSERT_CHILD = exports.ACTION_MOUNT = void 0;
var ACTION_MOUNT = 0;

@@ -22,10 +22,4 @@ exports.ACTION_MOUNT = ACTION_MOUNT;

exports.UPDATE_REMOVE = UPDATE_REMOVE;
var RemoteKind;
exports.RemoteKind = RemoteKind;
(function (RemoteKind) {
RemoteKind[RemoteKind["Text"] = 0] = "Text";
RemoteKind[RemoteKind["Component"] = 1] = "Component";
})(RemoteKind || (exports.RemoteKind = RemoteKind = {}));
var KIND_ROOT = 0;
exports.KIND_ROOT = KIND_ROOT;
var KIND_COMPONENT = 1;

@@ -32,0 +26,0 @@ exports.KIND_COMPONENT = KIND_COMPONENT;

@@ -54,2 +54,8 @@ "use strict";

});
Object.defineProperty(exports, "KIND_ROOT", {
enumerable: true,
get: function () {
return _types.KIND_ROOT;
}
});
Object.defineProperty(exports, "KIND_COMPONENT", {

@@ -56,0 +62,0 @@ enumerable: true,

@@ -23,2 +23,4 @@ "use strict";

const remoteRoot = {
kind: _types.KIND_ROOT,
get children() {

@@ -25,0 +27,0 @@ return children.get(remoteRoot);

@@ -6,3 +6,3 @@ "use strict";

});
exports.KIND_TEXT = exports.KIND_COMPONENT = exports.RemoteKind = exports.UPDATE_REMOVE = exports.UPDATE_INSERT = exports.ACTION_UPDATE_PROPS = exports.ACTION_UPDATE_TEXT = exports.ACTION_REMOVE_CHILD = exports.ACTION_INSERT_CHILD = exports.ACTION_MOUNT = void 0;
exports.KIND_TEXT = exports.KIND_COMPONENT = exports.KIND_ROOT = exports.UPDATE_REMOVE = exports.UPDATE_INSERT = exports.ACTION_UPDATE_PROPS = exports.ACTION_UPDATE_TEXT = exports.ACTION_REMOVE_CHILD = exports.ACTION_INSERT_CHILD = exports.ACTION_MOUNT = void 0;
const ACTION_MOUNT = 0;

@@ -22,10 +22,4 @@ exports.ACTION_MOUNT = ACTION_MOUNT;

exports.UPDATE_REMOVE = UPDATE_REMOVE;
let RemoteKind;
exports.RemoteKind = RemoteKind;
(function (RemoteKind) {
RemoteKind[RemoteKind["Text"] = 0] = "Text";
RemoteKind[RemoteKind["Component"] = 1] = "Component";
})(RemoteKind || (exports.RemoteKind = RemoteKind = {}));
const KIND_ROOT = 0;
exports.KIND_ROOT = KIND_ROOT;
const KIND_COMPONENT = 1;

@@ -32,0 +26,0 @@ exports.KIND_COMPONENT = KIND_COMPONENT;

export type { RemoteComponentType, PropsForRemoteComponent, AllowedChildrenForRemoteComponent, IdentifierForRemoteComponent, } from '@remote-ui/types';
export { retain, release } from '@remote-ui/rpc';
export { createRemoteComponent } from './component';
export { ACTION_MOUNT, ACTION_INSERT_CHILD, ACTION_REMOVE_CHILD, ACTION_UPDATE_PROPS, ACTION_UPDATE_TEXT, KIND_COMPONENT, KIND_TEXT, } from './types';
export { ACTION_MOUNT, ACTION_INSERT_CHILD, ACTION_REMOVE_CHILD, ACTION_UPDATE_PROPS, ACTION_UPDATE_TEXT, KIND_ROOT, KIND_COMPONENT, KIND_TEXT, } from './types';
export type { RemoteRoot, RemoteChannel, RemoteComponent, RemoteText, RemoteChild, Serialized, ActionArgumentMap, RemoteTextSerialization, RemoteComponentSerialization, } from './types';

@@ -6,0 +6,0 @@ export { createRemoteRoot } from './root';

@@ -14,2 +14,3 @@ "use strict";

Object.defineProperty(exports, "ACTION_UPDATE_TEXT", { enumerable: true, get: function () { return types_1.ACTION_UPDATE_TEXT; } });
Object.defineProperty(exports, "KIND_ROOT", { enumerable: true, get: function () { return types_1.KIND_ROOT; } });
Object.defineProperty(exports, "KIND_COMPONENT", { enumerable: true, get: function () { return types_1.KIND_COMPONENT; } });

@@ -16,0 +17,0 @@ Object.defineProperty(exports, "KIND_TEXT", { enumerable: true, get: function () { return types_1.KIND_TEXT; } });

@@ -15,2 +15,3 @@ "use strict";

const remoteRoot = {
kind: types_1.KIND_ROOT,
get children() {

@@ -17,0 +18,0 @@ return children.get(remoteRoot);

@@ -15,9 +15,12 @@ import { RemoteComponentType, IdentifierForRemoteComponent, PropsForRemoteComponent } from '@remote-ui/types';

export declare const UPDATE_REMOVE = 1;
export declare const KIND_ROOT = 0;
export declare const KIND_COMPONENT = 1;
export declare const KIND_TEXT = 2;
export declare type Id = string;
export interface ActionArgumentMap {
[ACTION_MOUNT]: [(RemoteTextSerialization | RemoteComponentSerialization)[]];
[ACTION_INSERT_CHILD]: [Id | undefined, number, RemoteTextSerialization | RemoteComponentSerialization];
[ACTION_REMOVE_CHILD]: [Id | undefined, number];
[ACTION_UPDATE_TEXT]: [Id, string];
[ACTION_UPDATE_PROPS]: [Id, object];
[ACTION_INSERT_CHILD]: [Id | undefined, number, RemoteTextSerialization | RemoteComponentSerialization];
[ACTION_REMOVE_CHILD]: [Id | undefined, number];
[ACTION_MOUNT]: [(RemoteTextSerialization | RemoteComponentSerialization)[]];
}

@@ -27,6 +30,2 @@ export interface RemoteChannel {

}
export declare enum RemoteKind {
Text = 0,
Component = 1
}
declare type AllowedRemoteChildren<Children, Root extends RemoteRoot<any, any>> = Children extends RemoteComponentType<string, any, any> ? RemoteComponent<Children, Root> : never;

@@ -37,2 +36,3 @@ declare type ExtractChildren<Type> = Type extends RemoteComponentType<string, any, infer Children> ? Children : never;

export interface RemoteRoot<AllowedComponents extends RemoteComponentType<string, any> = RemoteComponentType<any, any>, AllowedChildrenTypes extends RemoteComponentType<string, any> | boolean = true> {
readonly kind: typeof KIND_ROOT;
readonly children: readonly AllowedChildren<AllowedChildrenTypes, RemoteRoot<AllowedComponents, AllowedChildrenTypes>>[];

@@ -46,4 +46,2 @@ appendChild(child: AllowedChildren<AllowedChildrenTypes, RemoteRoot<AllowedComponents, AllowedChildrenTypes>, true>): void | Promise<void>;

}
export declare const KIND_COMPONENT = 1;
export declare const KIND_TEXT = 2;
export interface RemoteComponent<Type extends RemoteComponentType<string, any>, Root extends RemoteRoot<any, any>> {

@@ -50,0 +48,0 @@ readonly kind: typeof KIND_COMPONENT;

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.KIND_TEXT = exports.KIND_COMPONENT = exports.RemoteKind = exports.UPDATE_REMOVE = exports.UPDATE_INSERT = exports.ACTION_UPDATE_PROPS = exports.ACTION_UPDATE_TEXT = exports.ACTION_REMOVE_CHILD = exports.ACTION_INSERT_CHILD = exports.ACTION_MOUNT = void 0;
exports.KIND_TEXT = exports.KIND_COMPONENT = exports.KIND_ROOT = exports.UPDATE_REMOVE = exports.UPDATE_INSERT = exports.ACTION_UPDATE_PROPS = exports.ACTION_UPDATE_TEXT = exports.ACTION_REMOVE_CHILD = exports.ACTION_INSERT_CHILD = exports.ACTION_MOUNT = void 0;
exports.ACTION_MOUNT = 0;

@@ -11,8 +11,4 @@ exports.ACTION_INSERT_CHILD = 1;

exports.UPDATE_REMOVE = 1;
var RemoteKind;
(function (RemoteKind) {
RemoteKind[RemoteKind["Text"] = 0] = "Text";
RemoteKind[RemoteKind["Component"] = 1] = "Component";
})(RemoteKind = exports.RemoteKind || (exports.RemoteKind = {}));
exports.KIND_ROOT = 0;
exports.KIND_COMPONENT = 1;
exports.KIND_TEXT = 2;

@@ -10,2 +10,11 @@ # Changelog

## [1.4.0] - 2020-10-01
- Added a `kind` field to `RemoteRoot` to distinguish it from other remote nodes (its value is always the newly-exported `KIND_REMOTE_ROOT` constant) ([pull request](https://github.com/Shopify/remote-ui/pull/23)).
## [1.3.0] - 2020-08-31
- `RemoteRoot#createComponent()` now checks whether the passed component is supported if the `components` option was provided `createRemoteRoot()` ([pull request](https://github.com/Shopify/remote-ui/pull/20)).
- Only nodes created by `RemoteRoot#createComponent()` or `RemoteRoot#createText()` can be added to a tree of remote components ([pull request](https://github.com/Shopify/remote-ui/pull/20)).
## [1.2.2] - 2020-06-25

@@ -12,0 +21,0 @@

{
"name": "@remote-ui/core",
"version": "1.3.0",
"version": "1.4.0",
"publishConfig": {

@@ -25,3 +25,4 @@ "access": "public",

"@remote-ui/types": "^1.0.4"
}
},
"gitHead": "9838e4d0c298683543eab9fc3a5aaeafd3750ac3"
}

@@ -17,2 +17,3 @@ export type {

ACTION_UPDATE_TEXT,
KIND_ROOT,
KIND_COMPONENT,

@@ -19,0 +20,0 @@ KIND_TEXT,

@@ -8,2 +8,3 @@ import {RemoteComponentType} from '@remote-ui/types';

ACTION_UPDATE_TEXT,
KIND_ROOT,
KIND_COMPONENT,

@@ -54,2 +55,3 @@ KIND_TEXT,

const remoteRoot: Root = {
kind: KIND_ROOT,
get children() {

@@ -56,0 +58,0 @@ return children.get(remoteRoot) as any;

@@ -26,7 +26,10 @@ import {

export const KIND_ROOT = 0;
export const KIND_COMPONENT = 1;
export const KIND_TEXT = 2;
export type Id = string;
export interface ActionArgumentMap {
[ACTION_UPDATE_TEXT]: [Id, string];
[ACTION_UPDATE_PROPS]: [Id, object];
[ACTION_MOUNT]: [(RemoteTextSerialization | RemoteComponentSerialization)[]];
[ACTION_INSERT_CHILD]: [

@@ -38,3 +41,4 @@ Id | undefined,

[ACTION_REMOVE_CHILD]: [Id | undefined, number];
[ACTION_MOUNT]: [(RemoteTextSerialization | RemoteComponentSerialization)[]];
[ACTION_UPDATE_TEXT]: [Id, string];
[ACTION_UPDATE_PROPS]: [Id, object];
}

@@ -49,7 +53,2 @@

export enum RemoteKind {
Text,
Component,
}
type AllowedRemoteChildren<

@@ -94,2 +93,3 @@ Children,

> {
readonly kind: typeof KIND_ROOT;
readonly children: readonly AllowedChildren<

@@ -154,5 +154,2 @@ AllowedChildrenTypes,

export const KIND_COMPONENT = 1;
export const KIND_TEXT = 2;
export interface RemoteComponent<

@@ -159,0 +156,0 @@ Type extends RemoteComponentType<string, any>,

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

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

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc