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

@feature-hub/react

Package Overview
Dependencies
Maintainers
5
Versions
67
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@feature-hub/react - npm Package Compare versions

Comparing version 2.13.1 to 3.0.0-history-v5.0ee5fb21.0

11

CHANGELOG.md

@@ -6,2 +6,13 @@ # Change Log

# [3.0.0-history-v5.0ee5fb21.0](https://github.com/sinnerschrader/feature-hub/compare/v2.13.1...v3.0.0-history-v5.0ee5fb21.0) (2022-09-09)
### Bug Fixes
* **all:** declare errors as unknown ([d240934](https://github.com/sinnerschrader/feature-hub/commit/d240934454fb694d7c18a512f7f528507e44cdd7))
## [2.13.1](https://github.com/sinnerschrader/feature-hub/compare/v2.13.0...v2.13.1) (2022-06-20)

@@ -8,0 +19,0 @@

6

lib/cjs/__tests__/feature-app-container.node.test.js

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

if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {

@@ -10,0 +14,0 @@ if (k2 === undefined) k2 = k;

"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {

@@ -6,0 +10,0 @@ if (k2 === undefined) k2 = k;

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

if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {

@@ -10,0 +14,0 @@ if (k2 === undefined) k2 = k;

@@ -5,3 +5,7 @@ "use strict";

if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {

@@ -8,0 +12,0 @@ if (k2 === undefined) k2 = k;

"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {

@@ -6,0 +10,0 @@ if (k2 === undefined) k2 = k;

2

lib/cjs/feature-app-container.d.ts

@@ -62,3 +62,3 @@ import { FeatureAppDefinition, FeatureServices } from '@feature-hub/core';

*/
error?: Error;
error?: unknown;
/**

@@ -65,0 +65,0 @@ * The loading boolean indicates if the Feature App is still loading, and can

"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {

@@ -6,0 +10,0 @@ if (k2 === undefined) k2 = k;

@@ -71,7 +71,7 @@ import { FeatureAppEnvironment, FeatureServices } from '@feature-hub/core';

readonly done?: (result?: unknown) => void;
readonly onError?: (error: Error) => void;
readonly onError?: (error: unknown) => void;
/**
* @deprecated Use the `children` render function instead to render an error.
*/
readonly renderError?: (error: Error) => React.ReactNode;
readonly renderError?: (error: unknown) => React.ReactNode;
/**

@@ -78,0 +78,0 @@ * A children function can be provided to customize rendering of the

"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {

@@ -46,3 +50,3 @@ if (k2 === undefined) k2 = k;

if (!inBrowser && addUrlForHydration) {
addUrlForHydration(prepend_base_url_1.prependBaseUrl(baseUrl, clientSrc), clientModuleType);
addUrlForHydration((0, prepend_base_url_1.prependBaseUrl)(baseUrl, clientSrc), clientModuleType);
}

@@ -55,3 +59,3 @@ if (!inBrowser && addStylesheetsForSsr) {

}
const url = prepend_base_url_1.prependBaseUrl(baseUrl, src);
const url = (0, prepend_base_url_1.prependBaseUrl)(baseUrl, src);
const { error, promise: loadingPromise, value: featureAppDefinition, } = featureAppManager.getAsyncFeatureAppDefinition(url, moduleType);

@@ -77,3 +81,3 @@ if (error) {

try {
const featureAppDefinition = await featureAppManager.getAsyncFeatureAppDefinition(prepend_base_url_1.prependBaseUrl(baseUrl, src), moduleType).promise;
const featureAppDefinition = await featureAppManager.getAsyncFeatureAppDefinition((0, prepend_base_url_1.prependBaseUrl)(baseUrl, src), moduleType).promise;
if (this.mounted) {

@@ -143,3 +147,3 @@ this.setState({ featureAppDefinition });

return css.map(({ href, media }) => ({
href: prepend_base_url_1.prependBaseUrl(baseUrl, href),
href: (0, prepend_base_url_1.prependBaseUrl)(baseUrl, href),
media,

@@ -163,3 +167,3 @@ }));

const src = inBrowser ? clientSrc : serverSrc;
logger.error(`The Feature App for the src ${JSON.stringify(src && prepend_base_url_1.prependBaseUrl(baseUrl, src))} and the ID ${JSON.stringify(featureAppId)} could not be rendered.`, error);
logger.error(`The Feature App for the src ${JSON.stringify(src && (0, prepend_base_url_1.prependBaseUrl)(baseUrl, src))} and the ID ${JSON.stringify(featureAppId)} could not be rendered.`, error);
}

@@ -166,0 +170,0 @@ }

@@ -66,7 +66,4 @@ import { AsyncSsrManagerV1 } from '@feature-hub/async-ssr-manager';

*/
export declare const FeatureHubContextConsumer: {
(props: React.ConsumerProps<FeatureHubContextConsumerValue>): JSX.Element;
displayName: string;
};
export declare function FeatureHubContextConsumer(props: React.ConsumerProps<FeatureHubContextConsumerValue>): JSX.Element;
export {};
//# sourceMappingURL=feature-hub-context.d.ts.map
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {

@@ -50,12 +54,13 @@ if (k2 === undefined) k2 = k;

*/
const FeatureHubContextConsumer = (props) => (React.createElement(exports.FeatureHubContext.Consumer, null, (featureHubContextValue) => {
if (!featureHubContextValue) {
throw new Error(noFeatureHubContextValueErrorMessage);
}
// Provide `console` as the default logger.
const { logger = console } = featureHubContextValue, rest = __rest(featureHubContextValue, ["logger"]);
return props.children(Object.assign({ logger }, rest));
}));
function FeatureHubContextConsumer(props) {
return (React.createElement(exports.FeatureHubContext.Consumer, null, (featureHubContextValue) => {
if (!featureHubContextValue) {
throw new Error(noFeatureHubContextValueErrorMessage);
}
// Provide `console` as the default logger.
const { logger = console } = featureHubContextValue, rest = __rest(featureHubContextValue, ["logger"]);
return props.children(Object.assign({ logger }, rest));
}));
}
exports.FeatureHubContextConsumer = FeatureHubContextConsumer;
exports.FeatureHubContextConsumer.displayName = 'FeatureHubContextConsumer';
//# sourceMappingURL=feature-hub-context.js.map
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {

@@ -6,0 +10,0 @@ if (k2 === undefined) k2 = k;

@@ -5,3 +5,3 @@ import { FeatureAppDefinition, FeatureAppEnvironment, FeatureServices, Logger } from '@feature-hub/core';

import { FeatureHubContextConsumerValue } from '../feature-hub-context';
export declare const handleError: (logger: Logger, error: Error, onError?: ((e: Error) => void) | undefined) => void;
export declare const handleError: (logger: Logger, error: unknown, onError?: ((e: unknown) => void) | undefined) => void;
export interface BaseFeatureAppContainerProps<TFeatureApp, TFeatureServices extends FeatureServices = FeatureServices, TConfig = unknown> {

@@ -49,7 +49,7 @@ /**

readonly done?: (result?: unknown) => void;
readonly onError?: (error: Error) => void;
readonly onError?: (error: unknown) => void;
/**
* @deprecated Use the `children` render function instead to render an error.
*/
readonly renderError?: (error: Error) => React.ReactNode;
readonly renderError?: (error: unknown) => React.ReactNode;
/**

@@ -63,3 +63,3 @@ * A children function can be provided to customize rendering of the

interface InternalFeatureAppContainerState<TFeatureApp extends FeatureApp> {
readonly error?: Error;
readonly error?: unknown;
readonly featureApp?: TFeatureApp;

@@ -80,3 +80,3 @@ readonly release?: () => void;

private domFeatureAppAttached;
componentDidCatch(error: Error): void;
componentDidCatch(error: unknown): void;
componentDidMount(): void;

@@ -83,0 +83,0 @@ componentDidUpdate(): void;

"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {

@@ -49,3 +53,3 @@ if (k2 === undefined) k2 = k;

const { featureApp, release } = featureAppScope;
if (!type_guards_1.isFeatureApp(featureApp)) {
if (!(0, type_guards_1.isFeatureApp)(featureApp)) {
throw new Error('Invalid Feature App found. The Feature App must be an object with either 1) a `render` method that returns a React element, or 2) an `attachTo` method that accepts a container DOM element.');

@@ -61,3 +65,3 @@ }

try {
exports.handleError(logger, error, onError);
(0, exports.handleError)(logger, error, onError);
}

@@ -112,3 +116,3 @@ catch (handlerError) {

let featureAppNode;
if (type_guards_1.isReactFeatureApp(featureApp)) {
if ((0, type_guards_1.isReactFeatureApp)(featureApp)) {
try {

@@ -177,3 +181,3 @@ featureAppNode = featureApp.render();

const { logger, onError } = this.props;
exports.handleError(logger, error, onError);
(0, exports.handleError)(logger, error, onError);
}

@@ -185,3 +189,3 @@ attachDomFeatureApp() {

!('error' in this.state) &&
type_guards_1.isDomFeatureApp(this.state.featureApp)) {
(0, type_guards_1.isDomFeatureApp)(this.state.featureApp)) {
try {

@@ -188,0 +192,0 @@ this.state.featureApp.attachTo(this.containerRef.current);

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

}
return url_join_1.default(base, url);
return (0, url_join_1.default)(base, url);
}
exports.prependBaseUrl = prependBaseUrl;
//# sourceMappingURL=prepend-base-url.js.map

@@ -62,3 +62,3 @@ import { FeatureAppDefinition, FeatureServices } from '@feature-hub/core';

*/
error?: Error;
error?: unknown;
/**

@@ -65,0 +65,0 @@ * The loading boolean indicates if the Feature App is still loading, and can

@@ -71,7 +71,7 @@ import { FeatureAppEnvironment, FeatureServices } from '@feature-hub/core';

readonly done?: (result?: unknown) => void;
readonly onError?: (error: Error) => void;
readonly onError?: (error: unknown) => void;
/**
* @deprecated Use the `children` render function instead to render an error.
*/
readonly renderError?: (error: Error) => React.ReactNode;
readonly renderError?: (error: unknown) => React.ReactNode;
/**

@@ -78,0 +78,0 @@ * A children function can be provided to customize rendering of the

@@ -66,7 +66,4 @@ import { AsyncSsrManagerV1 } from '@feature-hub/async-ssr-manager';

*/
export declare const FeatureHubContextConsumer: {
(props: React.ConsumerProps<FeatureHubContextConsumerValue>): JSX.Element;
displayName: string;
};
export declare function FeatureHubContextConsumer(props: React.ConsumerProps<FeatureHubContextConsumerValue>): JSX.Element;
export {};
//# sourceMappingURL=feature-hub-context.d.ts.map

@@ -28,11 +28,12 @@ var __rest = (this && this.__rest) || function (s, e) {

*/
export const FeatureHubContextConsumer = (props) => (React.createElement(FeatureHubContext.Consumer, null, (featureHubContextValue) => {
if (!featureHubContextValue) {
throw new Error(noFeatureHubContextValueErrorMessage);
}
// Provide `console` as the default logger.
const { logger = console } = featureHubContextValue, rest = __rest(featureHubContextValue, ["logger"]);
return props.children(Object.assign({ logger }, rest));
}));
FeatureHubContextConsumer.displayName = 'FeatureHubContextConsumer';
export function FeatureHubContextConsumer(props) {
return (React.createElement(FeatureHubContext.Consumer, null, (featureHubContextValue) => {
if (!featureHubContextValue) {
throw new Error(noFeatureHubContextValueErrorMessage);
}
// Provide `console` as the default logger.
const { logger = console } = featureHubContextValue, rest = __rest(featureHubContextValue, ["logger"]);
return props.children(Object.assign({ logger }, rest));
}));
}
//# sourceMappingURL=feature-hub-context.js.map

@@ -5,3 +5,3 @@ import { FeatureAppDefinition, FeatureAppEnvironment, FeatureServices, Logger } from '@feature-hub/core';

import { FeatureHubContextConsumerValue } from '../feature-hub-context';
export declare const handleError: (logger: Logger, error: Error, onError?: ((e: Error) => void) | undefined) => void;
export declare const handleError: (logger: Logger, error: unknown, onError?: ((e: unknown) => void) | undefined) => void;
export interface BaseFeatureAppContainerProps<TFeatureApp, TFeatureServices extends FeatureServices = FeatureServices, TConfig = unknown> {

@@ -49,7 +49,7 @@ /**

readonly done?: (result?: unknown) => void;
readonly onError?: (error: Error) => void;
readonly onError?: (error: unknown) => void;
/**
* @deprecated Use the `children` render function instead to render an error.
*/
readonly renderError?: (error: Error) => React.ReactNode;
readonly renderError?: (error: unknown) => React.ReactNode;
/**

@@ -63,3 +63,3 @@ * A children function can be provided to customize rendering of the

interface InternalFeatureAppContainerState<TFeatureApp extends FeatureApp> {
readonly error?: Error;
readonly error?: unknown;
readonly featureApp?: TFeatureApp;

@@ -80,3 +80,3 @@ readonly release?: () => void;

private domFeatureAppAttached;
componentDidCatch(error: Error): void;
componentDidCatch(error: unknown): void;
componentDidMount(): void;

@@ -83,0 +83,0 @@ componentDidUpdate(): void;

{
"name": "@feature-hub/react",
"version": "2.13.1",
"version": "3.0.0-history-v5.0ee5fb21.0",
"description": "A library for building a Feature Hub integrator with React.",

@@ -24,4 +24,4 @@ "homepage": "https://feature-hub.io/",

"dependencies": {
"@feature-hub/async-ssr-manager": "^2.13.0",
"@feature-hub/core": "^2.13.0",
"@feature-hub/async-ssr-manager": "^3.0.0-history-v5.0ee5fb21.0",
"@feature-hub/core": "^3.0.0-history-v5.0ee5fb21.0",
"url-join": "^4.0.0"

@@ -41,3 +41,8 @@ },

},
"gitHead": "5ef439acd46a875d03e5abd99f7d976fea05954c"
"typedoc": {
"entryPoint": "./src/index.ts",
"readmeFile": "./README.md",
"displayName": "react"
},
"gitHead": "f36a0df85b4ccd6ab575ed038ca76da9f7234423"
}

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

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