@shopify/ui-extensions
Advanced tools
Comparing version 0.0.0-unstable-20230130224710 to 0.0.0-unstable-20230201174926
@@ -17,3 +17,3 @@ 'use strict'; | ||
var _shopify; | ||
function extension(...args) { | ||
async function extension(...args) { | ||
// Rendering extensions have two arguments. Non-rendering extensions don’t have | ||
@@ -33,3 +33,8 @@ // a `RemoteChannel` that needs to be normalized, so we can just pass the arguments | ||
}); | ||
return implementation(root, api); | ||
let renderResult = implementation(root, api); | ||
if (typeof renderResult === 'object' && renderResult != null && 'then' in renderResult) { | ||
renderResult = await renderResult; | ||
} | ||
root.mount(); | ||
return renderResult; | ||
} | ||
@@ -36,0 +41,0 @@ (_shopify = globalThis.shopify) === null || _shopify === void 0 ? void 0 : _shopify.extend(target, extension); |
{ | ||
"name": "@shopify/ui-extensions", | ||
"version": "0.0.0-unstable-20230130224710", | ||
"version": "0.0.0-unstable-20230201174926", | ||
"main": "index.js", | ||
@@ -5,0 +5,0 @@ "module": "index.mjs", |
@@ -40,3 +40,3 @@ import {createRemoteRoot} from '@remote-ui/core'; | ||
> = (target, implementation) => { | ||
function extension(...args: any[]) { | ||
async function extension(...args: any[]) { | ||
// Rendering extensions have two arguments. Non-rendering extensions don’t have | ||
@@ -59,3 +59,15 @@ // a `RemoteChannel` that needs to be normalized, so we can just pass the arguments | ||
return (implementation as any)(root, api); | ||
let renderResult = (implementation as any)(root, api); | ||
if ( | ||
typeof renderResult === 'object' && | ||
renderResult != null && | ||
'then' in renderResult | ||
) { | ||
renderResult = await renderResult; | ||
} | ||
root.mount(); | ||
return renderResult; | ||
} | ||
@@ -62,0 +74,0 @@ |
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
1017311
11129