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

@goji/core

Package Overview
Dependencies
Maintainers
2
Versions
120
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@goji/core - npm Package Compare versions

Comparing version 0.5.1 to 0.5.2

coverage/lcov-report/src/instance.ts.html

3

coverage/coverage-final.json

@@ -1,1 +0,2 @@

{}
{"/Users/chong_ma/Projects/goji/packages/core/src/utils/styleAttrStringify.ts": {"path":"/Users/chong_ma/Projects/goji/packages/core/src/utils/styleAttrStringify.ts","statementMap":{"0":{"start":{"line":3,"column":25},"end":{"line":3,"column":35}},"1":{"start":{"line":4,"column":18},"end":{"line":4,"column":24}},"2":{"start":{"line":7,"column":27},"end":{"line":12,"column":1}},"3":{"start":{"line":8,"column":2},"end":{"line":11,"column":32}},"4":{"start":{"line":15,"column":21},"end":{"line":17,"column":1}},"5":{"start":{"line":16,"column":2},"end":{"line":16,"column":69}},"6":{"start":{"line":19,"column":34},"end":{"line":33,"column":1}},"7":{"start":{"line":20,"column":2},"end":{"line":22,"column":3}},"8":{"start":{"line":21,"column":4},"end":{"line":21,"column":14}},"9":{"start":{"line":23,"column":15},"end":{"line":23,"column":63}},"10":{"start":{"line":24,"column":36},"end":{"line":24,"column":38}},"11":{"start":{"line":25,"column":2},"end":{"line":31,"column":3}},"12":{"start":{"line":26,"column":18},"end":{"line":26,"column":28}},"13":{"start":{"line":27,"column":4},"end":{"line":30,"column":5}},"14":{"start":{"line":29,"column":6},"end":{"line":29,"column":62}},"15":{"start":{"line":32,"column":2},"end":{"line":32,"column":29}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":7,"column":27},"end":{"line":7,"column":28}},"loc":{"start":{"line":7,"column":53},"end":{"line":12,"column":1}},"line":7},"1":{"name":"(anonymous_1)","decl":{"start":{"line":15,"column":21},"end":{"line":15,"column":22}},"loc":{"start":{"line":15,"column":30},"end":{"line":17,"column":1}},"line":15},"2":{"name":"(anonymous_2)","decl":{"start":{"line":19,"column":34},"end":{"line":19,"column":35}},"loc":{"start":{"line":19,"column":79},"end":{"line":33,"column":1}},"line":19}},"branchMap":{"0":{"loc":{"start":{"line":16,"column":9},"end":{"line":16,"column":68}},"type":"binary-expr","locations":[{"start":{"line":16,"column":9},"end":{"line":16,"column":22}},{"start":{"line":16,"column":26},"end":{"line":16,"column":52}},{"start":{"line":16,"column":56},"end":{"line":16,"column":68}}],"line":16},"1":{"loc":{"start":{"line":20,"column":2},"end":{"line":22,"column":3}},"type":"if","locations":[{"start":{"line":20,"column":2},"end":{"line":22,"column":3}},{"start":{"line":20,"column":2},"end":{"line":22,"column":3}}],"line":20},"2":{"loc":{"start":{"line":27,"column":4},"end":{"line":30,"column":5}},"type":"if","locations":[{"start":{"line":27,"column":4},"end":{"line":30,"column":5}},{"start":{"line":27,"column":4},"end":{"line":30,"column":5}}],"line":27}},"s":{"0":6,"1":6,"2":6,"3":9,"4":6,"5":11,"6":6,"7":8,"8":1,"9":7,"10":7,"11":7,"12":11,"13":11,"14":9,"15":7},"f":{"0":9,"1":11,"2":8},"b":{"0":[11,9,9],"1":[1,7],"2":[9,2]},"_coverageSchema":"43e27e138ebf9cfc5966b082cf9a028302ed4184","hash":"f583c44e06f9d6cea859e469615a287fed373290"}
}

@@ -1,2 +0,1 @@

/// <reference types="react" />
import { BasedContainer } from '../container';

@@ -3,0 +2,0 @@ export declare abstract class Adaptor {

@@ -1,2 +0,1 @@

/// <reference types="react" />
import { AdaptorType } from '.';

@@ -3,0 +2,0 @@ import { Container, BasedContainer } from '../container';

@@ -1,2 +0,1 @@

/// <reference types="react" />
import { FiberRoot } from 'react-reconciler';

@@ -3,0 +2,0 @@ import { AdaptorInstance } from './adaptor';

"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 = require("react");
const capitalize_1 = __importDefault(require("./utils/capitalize"));
const pascalCase_1 = require("./utils/pascalCase");
const warnedWhitelistSet = process.env.NODE_ENV !== 'production' ? new Set() : undefined;
const factoryComponent = (component) => {
const displayName = capitalize_1.default(component);
const displayName = pascalCase_1.pascalCase(component);
const comp = (props) => {

@@ -12,0 +9,0 @@ // warning if whitelist doesn't contain this component in dev mode

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

import { HostConfig } from 'react-reconciler';
import { Container } from './container';
import { InstanceProps, ElementInstance, TextInstance } from './instance';
export declare const hostConfig: HostConfig<string, InstanceProps, Container, ElementInstance, TextInstance, unknown, ElementInstance | TextInstance, {}, boolean, unknown, unknown, unknown>;
import { GojiHostConfig } from './hostConfigTypes';
export declare const hostConfig: GojiHostConfig<string, InstanceProps, Container, ElementInstance, TextInstance, unknown, ElementInstance | TextInstance, {}, boolean, unknown, unknown, unknown>;
"use strict";
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
const scheduler = __importStar(require("scheduler"));
const instance_1 = require("./instance");
const { unstable_scheduleCallback: scheduleDeferredCallback, unstable_cancelCallback: cancelDeferredCallback, unstable_shouldYield: shouldYield, unstable_now: now, } = scheduler;
const shim = () => {
throw new Error('Goji does not support hydration / persistence. This might be an internal error in Goji');
};
exports.hostConfig = {
now,
supportsMutation: true,
supportsHydration: false,
supportsPersistence: false,
isPrimaryRenderer: true,
getPublicInstance: instance => {
return instance;
},
shouldDeprioritizeSubtree: () => false,
getRootHostContext: () => {

@@ -44,2 +45,5 @@ return {};

},
commitMount() {
// do nothing
},
commitUpdate(targetIns, updatePayload, type, oldProps, newProps) {

@@ -64,3 +68,2 @@ targetIns.updateProps(newProps);

},
supportsMutation: true,
appendChildToContainer(container, child) {

@@ -77,9 +80,10 @@ container.appendChild(child);

},
// @ts-ignore
schedulePassiveEffects: scheduleDeferredCallback,
cancelPassiveEffects: cancelDeferredCallback,
shouldYield,
scheduleDeferredCallback,
cancelDeferredCallback,
resetTextContent() {
// do nothing
},
hideInstance: shim,
hideTextInstance: shim,
unhideInstance: shim,
unhideTextInstance: shim,
};
//# sourceMappingURL=hostConfig.js.map
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });

@@ -9,3 +6,3 @@ const constants_1 = require("./constants");

const id_1 = require("./utils/id");
const plainStyle_1 = __importDefault(require("./utils/plainStyle"));
const styleAttrStringify_1 = require("./utils/styleAttrStringify");
const simplify_1 = require("./utils/simplify");

@@ -128,3 +125,3 @@ const shallowEqual_1 = require("./utils/shallowEqual");

else if (propKey === 'style' || propKey.endsWith('Style')) {
result[propKey] = plainStyle_1.default(props[propKey]);
result[propKey] = styleAttrStringify_1.styleAttrStringify(props[propKey]);
}

@@ -131,0 +128,0 @@ else if (propKey === 'children') {

@@ -1,2 +0,1 @@

/// <reference types="react" />
export declare const PortalWrapper: ({ children, createPortal }: {

@@ -3,0 +2,0 @@ children: any;

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

const hostConfig_1 = require("./hostConfig");
// FIXME: remove `as any` after fixing `hostConfigTypes.ts`
const ReactReconcilerInst = react_reconciler_1.default(hostConfig_1.hostConfig);

@@ -10,0 +11,0 @@ function internalRender(rootElement, container) {

@@ -1,2 +0,1 @@

/// <reference types="react" />
import { BasedContainer } from '../container';

@@ -3,0 +2,0 @@ export declare abstract class Adaptor {

@@ -1,2 +0,1 @@

/// <reference types="react" />
import { AdaptorType } from '.';

@@ -3,0 +2,0 @@ import { Container, BasedContainer } from '../container';

@@ -1,2 +0,1 @@

/// <reference types="react" />
import { FiberRoot } from 'react-reconciler';

@@ -3,0 +2,0 @@ import { AdaptorInstance } from './adaptor';

import { createElement } from 'react';
import capitalize from './utils/capitalize';
import { pascalCase } from './utils/pascalCase';
const warnedWhitelistSet = process.env.NODE_ENV !== 'production' ? new Set() : undefined;
const factoryComponent = (component) => {
const displayName = capitalize(component);
const displayName = pascalCase(component);
const comp = (props) => {

@@ -7,0 +7,0 @@ // warning if whitelist doesn't contain this component in dev mode

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

import { HostConfig } from 'react-reconciler';
import { Container } from './container';
import { InstanceProps, ElementInstance, TextInstance } from './instance';
export declare const hostConfig: HostConfig<string, InstanceProps, Container, ElementInstance, TextInstance, unknown, ElementInstance | TextInstance, {}, boolean, unknown, unknown, unknown>;
import { GojiHostConfig } from './hostConfigTypes';
export declare const hostConfig: GojiHostConfig<string, InstanceProps, Container, ElementInstance, TextInstance, unknown, ElementInstance | TextInstance, {}, boolean, unknown, unknown, unknown>;

@@ -1,6 +0,14 @@

import * as scheduler from 'scheduler';
import { ElementInstance, TextInstance, UpdateType } from './instance';
const { unstable_scheduleCallback: scheduleDeferredCallback, unstable_cancelCallback: cancelDeferredCallback, unstable_shouldYield: shouldYield, unstable_now: now, } = scheduler;
const shim = () => {
throw new Error('Goji does not support hydration / persistence. This might be an internal error in Goji');
};
export const hostConfig = {
now,
supportsMutation: true,
supportsHydration: false,
supportsPersistence: false,
isPrimaryRenderer: true,
getPublicInstance: instance => {
return instance;
},
shouldDeprioritizeSubtree: () => false,
getRootHostContext: () => {

@@ -35,2 +43,5 @@ return {};

},
commitMount() {
// do nothing
},
commitUpdate(targetIns, updatePayload, type, oldProps, newProps) {

@@ -55,3 +66,2 @@ targetIns.updateProps(newProps);

},
supportsMutation: true,
appendChildToContainer(container, child) {

@@ -68,9 +78,10 @@ container.appendChild(child);

},
// @ts-ignore
schedulePassiveEffects: scheduleDeferredCallback,
cancelPassiveEffects: cancelDeferredCallback,
shouldYield,
scheduleDeferredCallback,
cancelDeferredCallback,
resetTextContent() {
// do nothing
},
hideInstance: shim,
hideTextInstance: shim,
unhideInstance: shim,
unhideTextInstance: shim,
};
//# sourceMappingURL=hostConfig.js.map
import { TYPE_TEXT } from './constants';
import { gojiEvents } from './events';
import { getNextInstanceId } from './utils/id';
import plainStyle from './utils/plainStyle';
import { styleAttrStringify } from './utils/styleAttrStringify';
import { findSimplifyId } from './utils/simplify';

@@ -121,3 +121,3 @@ import { shallowEqual } from './utils/shallowEqual';

else if (propKey === 'style' || propKey.endsWith('Style')) {
result[propKey] = plainStyle(props[propKey]);
result[propKey] = styleAttrStringify(props[propKey]);
}

@@ -124,0 +124,0 @@ else if (propKey === 'children') {

@@ -1,2 +0,1 @@

/// <reference types="react" />
export declare const PortalWrapper: ({ children, createPortal }: {

@@ -3,0 +2,0 @@ children: any;

import ReactReconciler from 'react-reconciler';
import { hostConfig } from './hostConfig';
// FIXME: remove `as any` after fixing `hostConfigTypes.ts`
const ReactReconcilerInst = ReactReconciler(hostConfig);

@@ -4,0 +5,0 @@ export function internalRender(rootElement, container) {

{
"name": "@goji/core",
"version": "0.5.1",
"version": "0.5.2",
"description": "Goji Core",

@@ -35,40 +35,39 @@ "main": "dist/cjs/index.js",

"devDependencies": {
"@babel/core": "^7.6.0",
"@babel/plugin-proposal-class-properties": "^7.5.5",
"@babel/plugin-transform-runtime": "^7.6.0",
"@babel/preset-env": "^7.6.0",
"@babel/preset-react": "^7.0.0",
"@babel/preset-typescript": "^7.6.0",
"@babel/core": "^7.7.4",
"@babel/plugin-proposal-class-properties": "^7.7.4",
"@babel/plugin-transform-runtime": "^7.7.4",
"@babel/preset-env": "^7.7.4",
"@babel/preset-react": "^7.7.4",
"@babel/preset-typescript": "^7.7.4",
"@types/enzyme": "^3.10.3",
"@types/jest": "^24.0.18",
"@types/lodash": "^4.14.138",
"@types/react": "^16.9.2",
"@types/react-dom": "^16.9.0",
"@types/jest": "^24.0.23",
"@types/lodash": "^4.14.149",
"@types/react": "^16.9.13",
"@types/react-dom": "^16.9.4",
"@types/react-reconciler": "^0.18.0",
"@types/scheduler": "^0.12.1",
"@types/weixin-app": "^2.2.27",
"@typescript-eslint/eslint-plugin": "^2.2.0",
"@typescript-eslint/parser": "^2.2.0",
"@types/scheduler": "^0.16.1",
"@types/weixin-app": "^2.2.28",
"@typescript-eslint/eslint-plugin": "^2.8.0",
"@typescript-eslint/parser": "^2.8.0",
"babel-jest": "^24.9.0",
"enzyme": "^3.10.0",
"enzyme-adapter-react-16": "^1.14.0",
"eslint": "^6.4.0",
"enzyme-adapter-react-16": "^1.15.1",
"eslint": "^6.7.0",
"eslint-config-airbnb": "^18.0.1",
"eslint-config-prettier": "^6.3.0",
"eslint-config-prettier": "^6.7.0",
"eslint-plugin-import": "^2.18.2",
"eslint-plugin-jest": "^22.17.0",
"eslint-plugin-jest": "^23.0.4",
"eslint-plugin-jsx-a11y": "^6.2.3",
"eslint-plugin-react": "^7.14.3",
"eslint-plugin-react-hooks": "^2.0.1",
"eslint-plugin-react": "^7.16.0",
"eslint-plugin-react-hooks": "^2.3.0",
"jest": "^24.9.0",
"react": "^16.10.0",
"react-dom": "^16.9.0",
"react": "^16.12.0",
"react-dom": "^16.12.0",
"rimraf": "^3.0.0",
"typescript": "^3.6.3"
"typescript": "^3.7.2"
},
"dependencies": {
"lodash": "^4.17.15",
"react-is": "^16.10.2",
"react-reconciler": "^0.21.0",
"scheduler": "^0.15.0"
"react-is": "^16.12.0",
"react-reconciler": "^0.24.0"
},

@@ -81,3 +80,3 @@ "peerDependencies": {

},
"gitHead": "e0ac8ab5fec426c447db82e3de138c302bc7608a"
"gitHead": "8401dfc5fed319e7aab9339ec2d50d28ae661048"
}
import { createElement, CSSProperties } from 'react';
import capitalize from './utils/capitalize';
import { pascalCase } from './utils/pascalCase';

@@ -287,3 +287,3 @@ interface BaseProps {

): React.FunctionComponent<P> => {
const displayName = capitalize(component);
const displayName = pascalCase(component);
const comp = (props: P) => {

@@ -290,0 +290,0 @@ // warning if whitelist doesn't contain this component in dev mode

@@ -1,14 +0,12 @@

import * as scheduler from 'scheduler';
import { HostConfig } from 'react-reconciler';
import { Container } from './container';
import { InstanceProps, ElementInstance, TextInstance, UpdateType } from './instance';
import { GojiHostConfig } from './hostConfigTypes';
const {
unstable_scheduleCallback: scheduleDeferredCallback,
unstable_cancelCallback: cancelDeferredCallback,
unstable_shouldYield: shouldYield,
unstable_now: now,
} = scheduler;
const shim = () => {
throw new Error(
'Goji does not support hydration / persistence. This might be an internal error in Goji',
);
};
export const hostConfig: HostConfig<
export const hostConfig: GojiHostConfig<
string,

@@ -27,4 +25,14 @@ InstanceProps,

> = {
now,
supportsMutation: true,
supportsHydration: false,
supportsPersistence: false,
isPrimaryRenderer: true,
getPublicInstance: instance => {
return instance;
},
shouldDeprioritizeSubtree: () => false,
getRootHostContext: () => {

@@ -69,2 +77,6 @@ return {};

commitMount() {
// do nothing
},
commitUpdate(targetIns, updatePayload, type, oldProps, newProps) {

@@ -95,4 +107,2 @@ targetIns.updateProps(newProps);

supportsMutation: true,
appendChildToContainer(container, child) {

@@ -112,8 +122,10 @@ container.appendChild(child);

// @ts-ignore
schedulePassiveEffects: scheduleDeferredCallback,
cancelPassiveEffects: cancelDeferredCallback,
shouldYield,
scheduleDeferredCallback,
cancelDeferredCallback,
resetTextContent() {
// do nothing
},
hideInstance: shim,
hideTextInstance: shim,
unhideInstance: shim,
unhideTextInstance: shim,
};

@@ -5,3 +5,3 @@ import { BasedContainer } from './container';

import { getNextInstanceId } from './utils/id';
import plainStyle from './utils/plainStyle';
import { styleAttrStringify } from './utils/styleAttrStringify';
import { findSimplifyId } from './utils/simplify';

@@ -177,3 +177,3 @@ import { shallowEqual, PlainObject } from './utils/shallowEqual';

} else if (propKey === 'style' || propKey.endsWith('Style')) {
result[propKey] = plainStyle(props[propKey]);
result[propKey] = styleAttrStringify(props[propKey]);
} else if (propKey === 'children') {

@@ -180,0 +180,0 @@ // pass

@@ -6,3 +6,4 @@ import { ReactElement } from 'react';

const ReactReconcilerInst = ReactReconciler(hostConfig);
// FIXME: remove `as any` after fixing `hostConfigTypes.ts`
const ReactReconcilerInst = ReactReconciler(hostConfig as any);

@@ -9,0 +10,0 @@ export function internalRender(rootElement: ReactElement | null, container: Container) {

@@ -12,2 +12,3 @@ {

"esModuleInterop": true,
"skipLibCheck": true,
"moduleResolution": "node",

@@ -14,0 +15,0 @@ "jsx": "react"

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