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

@shopify/app-bridge-host

Package Overview
Dependencies
Maintainers
13
Versions
383
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@shopify/app-bridge-host - npm Package Compare versions

Comparing version 1.9.0 to 1.10.0

18

CHANGELOG.md

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

# [1.10.0](https://github.com/Shopify/app-bridge/compare/v1.9.0...v1.10.0) (2019-10-28)
### Bug Fixes
* modal update action should not reset height ([0c4f56f](https://github.com/Shopify/app-bridge/commit/0c4f56f))
* modal update action should not reset height ([#1285](https://github.com/Shopify/app-bridge/issues/1285)) ([a084213](https://github.com/Shopify/app-bridge/commit/a084213))
* **host:** allow <HostProvider> to be rendered without an app config ([b34c265](https://github.com/Shopify/app-bridge/commit/b34c265))
### Features
* **app-nav-actions:** add actions and readme ([e4dc680](https://github.com/Shopify/app-bridge/commit/e4dc680))
# [1.9.0](https://github.com/Shopify/app-bridge/compare/v1.8.0...v1.9.0) (2019-10-18)

@@ -8,0 +26,0 @@

4

HostProvider.d.ts

@@ -32,4 +32,4 @@ import React from 'react';

export interface Props extends HostProps {
/** Configuration of the app */
config: ApiClientConfig;
/** Configuration of the app to load*/
config?: ApiClientConfig;
/** Optional handler for when App Bridge actions are dispatched */

@@ -36,0 +36,0 @@ dispatchClientEventHandler?: (trackingEventPayload: TrackingEventPayload) => void;

@@ -58,6 +58,5 @@ "use strict";

var config = props.config, dispatchClientEventHandler = props.dispatchClientEventHandler, initialState = props.initialState, router = props.router, hostProps = __rest(props, ["config", "dispatchClientEventHandler", "initialState", "router"]);
var appBridgeMiddleware = react_1.useMemo(function () { return Middleware_1.buildMiddleware(async_1.APP_BRIDGE_KEY, dispatchClientEventHandler); }, [dispatchClientEventHandler]);
if (!config) {
Error_1.throwError(Error_1.AppActionType.MISSING_CONFIG, 'Missing required prop `config`');
}
var appBridgeMiddleware = react_1.useMemo(function () {
return Middleware_1.buildMiddleware(async_1.APP_BRIDGE_KEY, dispatchClientEventHandler);
}, [dispatchClientEventHandler]);
if (!appBridgeMiddleware || typeof appBridgeMiddleware.load !== 'function') {

@@ -72,2 +71,5 @@ Error_1.throwError(Error_1.AppActionType.MISSING_APP_BRIDGE_MIDDLEWARE, 'Missing required context `appBridgeMiddleware`. Maybe you forgot the App Bridge `<Provider>` component?');

var hostContext = react_1.useMemo(function () {
if (!config) {
return;
}
var addReducer = async_1.createAddReducer(store, initialState);

@@ -80,10 +82,13 @@ var app = appBridgeMiddleware.load({

}, [config]);
var content = (react_1.default.createElement(react_redux_1.Provider, { store: store },
react_1.default.createElement(Host_1.default, __assign({}, hostProps))));
if (!hostContext) {
return react_1.default.createElement(react_redux_1.Provider, { store: store });
}
var hostContent = (react_1.default.createElement(exports.HostContext.Provider, { value: hostContext },
react_1.default.createElement(react_redux_1.Provider, { store: store },
react_1.default.createElement(Host_1.default, __assign({}, hostProps)))));
if (!router) {
return react_1.default.createElement(exports.HostContext.Provider, { value: hostContext }, content);
return hostContent;
}
return (react_1.default.createElement(exports.HostContext.Provider, { value: hostContext },
react_1.default.createElement(exports.RouterContext.Provider, { value: router }, content)));
return react_1.default.createElement(exports.RouterContext.Provider, { value: router }, hostContent);
}
exports.default = HostProvider;
{
"name": "@shopify/app-bridge-host",
"version": "1.9.0",
"version": "1.10.0",
"types": "index.d.ts",

@@ -65,3 +65,3 @@ "main": "index.js",

"dependencies": {
"@shopify/app-bridge": "^1.9.0",
"@shopify/app-bridge": "^1.10.0",
"@shopify/javascript-utilities": "^2.3.0",

@@ -77,3 +77,3 @@ "@shopify/react-compose": "^1.0.4",

},
"gitHead": "fdbee1ee79a4f1417c1db6d613f8f57bb2c64d60"
"gitHead": "7aa1b88ff94c100dba99f8839330f1ee59961ffe"
}

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

_c),
_b[Actions.Group.Menu] = setFeature(utilities_1.getGroupActionType(Actions.Group.Menu), false),
_b),

@@ -72,0 +73,0 @@ _a[app_bridge_1.Context.Main] = (_d = {},

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

var id = payload.id, title = payload.title, footer = payload.footer, size = payload.size;
var height = state.height;
var newState = {

@@ -37,2 +38,3 @@ id: id,

open: action.type === actions_1.Modal.ActionType.OPEN ? true : state.open,
height: height,
};

@@ -39,0 +41,0 @@ if (actions_1.Modal.isIframeModal(payload)) {

@@ -51,2 +51,7 @@ import { Reducer } from 'redux';

REPLACE: Actions.History.ActionType.REPLACE;
} | {
[x: number]: string;
UPDATE: Actions.NavigationMenu.ActionType.UPDATE;
BUTTON_CLICK: Actions.NavigationMenu.ActionType.BUTTON_CLICK;
BUTTON_UPDATE: Actions.NavigationMenu.ActionType.BUTTON_UPDATE;
};

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

return Actions.ResourcePicker.ActionType;
case Actions.Group.Menu:
return __assign({}, Actions.NavigationMenu.ActionType);
default:

@@ -89,0 +91,0 @@ return Actions[group].ActionType;

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