Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@remote-ui/react

Package Overview
Dependencies
Maintainers
1
Versions
122
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@remote-ui/react - npm Package Compare versions

Comparing version 0.0.7 to 0.0.8

31

build/cjs/components.js
"use strict";
require("core-js/modules/es.object.assign");
Object.defineProperty(exports, "__esModule", {

@@ -10,29 +8,4 @@ value: true

var _react = _interopRequireDefault(require("react"));
var _controller = require("./controller");
var _jsxFileName = "/Users/lemon/dev/personal/remote-ui/packages/react/src/components.tsx";
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function createRemoteComponent(type) {
return process.env.NODE_ENV === 'production' ? type : createDevelopmentRemoteComponent(type);
}
function createDevelopmentRemoteComponent(type) {
function Component(props) {
var controller = (0, _controller.useController)();
var NativeComponent = controller.getNativeComponent(type);
return _react["default"].createElement(NativeComponent, Object.assign({}, props, {
__source: {
fileName: _jsxFileName,
lineNumber: 22
},
__self: this
}));
}
Component.displayName = type;
return Component;
function createRemoteComponent(componentType) {
return componentType;
}

4

build/cjs/host/controller.js

@@ -42,4 +42,4 @@ "use strict";

key: "get",
value: function get(name) {
return this.registry.get(name);
value: function get(type) {
return this.registry.get(type);
}

@@ -46,0 +46,0 @@ }]);

@@ -24,12 +24,12 @@ "use strict";

});
Object.defineProperty(exports, "ReactComponentFromRemoteComponent", {
Object.defineProperty(exports, "ReactPropsFromRemoteComponentType", {
enumerable: true,
get: function get() {
return _types.ReactComponentFromRemoteComponent;
return _types.ReactPropsFromRemoteComponentType;
}
});
Object.defineProperty(exports, "ReactPropsFromRemoteComponent", {
Object.defineProperty(exports, "ReactComponentTypeFromRemoteComponentType", {
enumerable: true,
get: function get() {
return _types.ReactPropsFromRemoteComponent;
return _types.ReactComponentTypeFromRemoteComponentType;
}

@@ -36,0 +36,0 @@ });

@@ -18,12 +18,12 @@ "use strict";

});
Object.defineProperty(exports, "ReactComponentFromRemoteComponent", {
Object.defineProperty(exports, "ReactPropsFromRemoteComponentType", {
enumerable: true,
get: function get() {
return _types.ReactComponentFromRemoteComponent;
return _types.ReactPropsFromRemoteComponentType;
}
});
Object.defineProperty(exports, "ReactPropsFromRemoteComponent", {
Object.defineProperty(exports, "ReactComponentTypeFromRemoteComponentType", {
enumerable: true,
get: function get() {
return _types.ReactPropsFromRemoteComponent;
return _types.ReactComponentTypeFromRemoteComponentType;
}

@@ -30,0 +30,0 @@ });

@@ -8,27 +8,12 @@ "use strict";

var _react = _interopRequireDefault(require("react"));
var _reconciler = _interopRequireDefault(require("./reconciler"));
var _controller = require("./controller");
var _jsxFileName = "/Users/lemon/dev/personal/remote-ui/packages/react/src/render.tsx";
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function render(element, root) {
var controller = new _controller.Controller(root);
var container = _reconciler["default"].createContainer(root, false, false);
_reconciler["default"].updateContainer(_react["default"].createElement(_controller.ControllerContext.Provider, {
value: controller,
__source: {
fileName: _jsxFileName,
lineNumber: 14
},
__self: this
}, element), container, null, function () {
_reconciler["default"].updateContainer(element, container, null, function () {
root.mount();
});
}

@@ -8,29 +8,4 @@ "use strict";

var _react = _interopRequireDefault(require("react"));
var _controller = require("./controller");
var _jsxFileName = "/Users/lemon/dev/personal/remote-ui/packages/react/src/components.tsx";
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function createRemoteComponent(type) {
return process.env.NODE_ENV === 'production' ? type : createDevelopmentRemoteComponent(type);
}
function createDevelopmentRemoteComponent(type) {
function Component(props) {
const controller = (0, _controller.useController)();
const NativeComponent = controller.getNativeComponent(type);
return _react.default.createElement(NativeComponent, Object.assign({}, props, {
__source: {
fileName: _jsxFileName,
lineNumber: 22
},
__self: this
}));
}
Component.displayName = type;
return Component;
function createRemoteComponent(componentType) {
return componentType;
}

@@ -14,4 +14,4 @@ "use strict";

get(name) {
return this.registry.get(name);
get(type) {
return this.registry.get(type);
}

@@ -18,0 +18,0 @@

@@ -24,12 +24,12 @@ "use strict";

});
Object.defineProperty(exports, "ReactComponentFromRemoteComponent", {
Object.defineProperty(exports, "ReactPropsFromRemoteComponentType", {
enumerable: true,
get: function () {
return _types.ReactComponentFromRemoteComponent;
return _types.ReactPropsFromRemoteComponentType;
}
});
Object.defineProperty(exports, "ReactPropsFromRemoteComponent", {
Object.defineProperty(exports, "ReactComponentTypeFromRemoteComponentType", {
enumerable: true,
get: function () {
return _types.ReactPropsFromRemoteComponent;
return _types.ReactComponentTypeFromRemoteComponentType;
}

@@ -36,0 +36,0 @@ });

@@ -18,12 +18,12 @@ "use strict";

});
Object.defineProperty(exports, "ReactComponentFromRemoteComponent", {
Object.defineProperty(exports, "ReactPropsFromRemoteComponentType", {
enumerable: true,
get: function () {
return _types.ReactComponentFromRemoteComponent;
return _types.ReactPropsFromRemoteComponentType;
}
});
Object.defineProperty(exports, "ReactPropsFromRemoteComponent", {
Object.defineProperty(exports, "ReactComponentTypeFromRemoteComponentType", {
enumerable: true,
get: function () {
return _types.ReactPropsFromRemoteComponent;
return _types.ReactComponentTypeFromRemoteComponentType;
}

@@ -30,0 +30,0 @@ });

@@ -8,27 +8,12 @@ "use strict";

var _react = _interopRequireDefault(require("react"));
var _reconciler = _interopRequireDefault(require("./reconciler"));
var _controller = require("./controller");
var _jsxFileName = "/Users/lemon/dev/personal/remote-ui/packages/react/src/render.tsx";
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function render(element, root) {
const controller = new _controller.Controller(root);
const container = _reconciler.default.createContainer(root, false, false);
_reconciler.default.updateContainer(_react.default.createElement(_controller.ControllerContext.Provider, {
value: controller,
__source: {
fileName: _jsxFileName,
lineNumber: 14
},
__self: this
}, element), container, null, () => {
_reconciler.default.updateContainer(element, container, null, () => {
root.mount();
});
}

@@ -1,3 +0,4 @@

import { ReactComponentFromRemoteComponent } from './types';
export declare function createRemoteComponent<Type extends string>(type: Type): ReactComponentFromRemoteComponent<Type>;
import { RemoteChild, RemoteComponentType } from '@remote-ui/core';
import { ReactComponentTypeFromRemoteComponentType } from './types';
export declare function createRemoteComponent<Type extends string, Props = {}, AllowedChildren extends RemoteChild | RemoteComponentType<any, any> = RemoteChild>(componentType: Type | RemoteComponentType<Type, Props, AllowedChildren>): RemoteComponentType<Type, Props, AllowedChildren> & ReactComponentTypeFromRemoteComponentType<RemoteComponentType<Type, Props, AllowedChildren>>;
//# sourceMappingURL=components.d.ts.map
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const react_1 = __importDefault(require("react"));
const controller_1 = require("./controller");
function createRemoteComponent(type) {
return process.env.NODE_ENV === 'production'
? type
: createDevelopmentRemoteComponent(type);
function createRemoteComponent(componentType) {
return componentType;
}
exports.createRemoteComponent = createRemoteComponent;
function createDevelopmentRemoteComponent(type) {
function Component(props) {
const controller = controller_1.useController();
const NativeComponent = controller.getNativeComponent(type);
return react_1.default.createElement(NativeComponent, Object.assign({}, props));
}
Component.displayName = type;
return Component;
}
import { ComponentType } from 'react';
import { RemoteComponentType } from '@remote-ui/core';
export declare class Controller<ComponentConfig extends {

@@ -8,4 +9,4 @@ [key: string]: ComponentType<any>;

constructor(components?: ComponentConfig);
get(name: string): ComponentType<any>;
get(type: string | RemoteComponentType<any, any, any>): import("react").ComponentClass<any, any> | import("react").FunctionComponent<any> | undefined;
}
//# sourceMappingURL=controller.d.ts.map

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

}
get(name) {
return this.registry.get(name);
get(type) {
return this.registry.get(type);
}
}
exports.Controller = Controller;
export { Receiver } from '@remote-ui/core';
export { Controller } from './controller';
export { Renderer } from './Renderer';
export { ReactComponentFromRemoteComponent, ReactPropsFromRemoteComponent, } from '../types';
export { ReactPropsFromRemoteComponentType, ReactComponentTypeFromRemoteComponentType, } from '../types';
export { ReceiverContext, ControllerContext } from './context';
export { useReceiver, useController } from './hooks';
//# sourceMappingURL=index.d.ts.map
export { render } from './render';
export { createRemoteComponent } from './components';
export { ReactComponentFromRemoteComponent, ReactPropsFromRemoteComponent, } from './types';
export { ReactPropsFromRemoteComponentType, ReactComponentTypeFromRemoteComponentType, } from './types';
//# sourceMappingURL=index.d.ts.map
import reactReconciler from 'react-reconciler';
import { RemoteRoot, RemoteText, RemoteComponent } from '@remote-ui/core';
declare const reconciler: reactReconciler.Reconciler<RemoteComponent<any, any>, RemoteText<any>, RemoteRoot<string, typeof import("@remote-ui/types").ANY_CHILD>, unknown>;
import { RemoteRoot, RemoteText, RemoteComponent, RemoteComponentType } from '@remote-ui/core';
declare const reconciler: reactReconciler.Reconciler<RemoteComponent<any, any>, RemoteText<any>, RemoteRoot<RemoteComponentType<any, any, typeof import("@remote-ui/types").ANY_CHILD>, typeof import("@remote-ui/types").ANY_CHILD>, unknown>;
export default reconciler;
//# sourceMappingURL=reconciler.d.ts.map

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

Object.defineProperty(exports, "__esModule", { value: true });
const react_1 = __importDefault(require("react"));
const reconciler_1 = __importDefault(require("./reconciler"));
const controller_1 = require("./controller");
function render(element, root) {
const controller = new controller_1.Controller(root);
const container = reconciler_1.default.createContainer(root, false, false);
reconciler_1.default.updateContainer(react_1.default.createElement(controller_1.ControllerContext.Provider, { value: controller }, element), container, null, () => {
reconciler_1.default.updateContainer(element, container, null, () => {
root.mount();

@@ -15,0 +12,0 @@ });

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

const PersonContext = react_1.createContext({ name: 'Mollie' });
function HostHelloWorld({ name }) {
function HostHelloWorld({ name, }) {
return react_1.default.createElement("div", null,

@@ -25,3 +25,3 @@ "Hello, ",

}
function HostWithPerson({ run }) {
function HostWithPerson({ run, }) {
const person = react_1.useContext(PersonContext);

@@ -49,3 +49,3 @@ react_1.useEffect(() => {

const remoteRoot = core_1.createRemoteRoot(receiver.dispatch, {
HelloWorld: {},
components: [RemoteHelloWorld],
});

@@ -72,3 +72,3 @@ function RemoteApp() {

const remoteRoot = core_1.createRemoteRoot(receiver.dispatch, {
WithPerson: {},
components: [RemoteWithPerson],
});

@@ -75,0 +75,0 @@ function RemoteApp() {

import { ReactNode, ComponentType } from 'react';
import { PropsForRemoteComponent } from '@remote-ui/core';
export declare type ReactPropsFromRemoteComponent<Type extends string> = PropsForRemoteComponent<Type> & {
import { RemoteComponentType, PropsForRemoteComponent } from '@remote-ui/core';
export declare type ReactPropsFromRemoteComponentType<Type extends RemoteComponentType<any, any, any>> = PropsForRemoteComponent<Type> & {
children?: ReactNode;
};
export declare type ReactComponentFromRemoteComponent<Type extends string> = ComponentType<ReactPropsFromRemoteComponent<Type>>;
export declare type ReactComponentTypeFromRemoteComponentType<Type extends RemoteComponentType<any, any, any>> = ComponentType<ReactPropsFromRemoteComponentType<Type>>;
//# sourceMappingURL=types.d.ts.map
{
"name": "@remote-ui/react",
"version": "0.0.7",
"version": "0.0.8",
"publishConfig": {

@@ -16,7 +16,7 @@ "access": "public",

"dependencies": {
"@remote-ui/core": "^0.0.5",
"@remote-ui/core": "^0.0.6",
"@types/react": ">=16.8.0 <17.0.0",
"react-reconciler": "*"
},
"gitHead": "66fed37d8b29212fb575bd8daa419a0366262058"
"gitHead": "da58c9b3754eaef09fa623f9c5a75784e6c69ddd"
}

@@ -6,6 +6,6 @@ export {Receiver} from '@remote-ui/core';

export {
ReactComponentFromRemoteComponent,
ReactPropsFromRemoteComponent,
ReactPropsFromRemoteComponentType,
ReactComponentTypeFromRemoteComponentType,
} from '../types';
export {ReceiverContext, ControllerContext} from './context';
export {useReceiver, useController} from './hooks';
export {render} from './render';
export {createRemoteComponent} from './components';
export {
ReactComponentFromRemoteComponent,
ReactPropsFromRemoteComponent,
ReactPropsFromRemoteComponentType,
ReactComponentTypeFromRemoteComponentType,
} from './types';
import reactReconciler from 'react-reconciler';
import {RemoteRoot, RemoteText, RemoteComponent} from '@remote-ui/core';
import {
RemoteRoot,
RemoteText,
RemoteComponent,
RemoteComponentType,
} from '@remote-ui/core';
const reconciler = reactReconciler<
// type
string,
RemoteComponentType<any, any>,
// props

@@ -9,0 +14,0 @@ Record<string, unknown>,

import {ReactNode, ComponentType} from 'react';
import {PropsForRemoteComponent} from '@remote-ui/core';
import {RemoteComponentType, PropsForRemoteComponent} from '@remote-ui/core';
export type ReactPropsFromRemoteComponent<
Type extends string
export type ReactPropsFromRemoteComponentType<
Type extends RemoteComponentType<any, any, any>
> = PropsForRemoteComponent<Type> & {children?: ReactNode};
export type ReactComponentFromRemoteComponent<
Type extends string
> = ComponentType<ReactPropsFromRemoteComponent<Type>>;
export type ReactComponentTypeFromRemoteComponentType<
Type extends RemoteComponentType<any, any, any>
> = ComponentType<ReactPropsFromRemoteComponentType<Type>>;

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

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc