@wixc3/engine-core
Advanced tools
Comparing version 7.5.1 to 7.6.2
@@ -110,5 +110,6 @@ "use strict"; | ||
}; | ||
host.addEventListener('load', async () => { | ||
await this.envReady(instanceId); | ||
await reload(); | ||
host.addEventListener('load', () => { | ||
this.envReady(instanceId) | ||
.then(reload) | ||
.catch(errors_1.reportError); | ||
}); | ||
@@ -207,26 +208,21 @@ this.registerEnv(instanceId, win); | ||
} | ||
try { | ||
switch (message.type) { | ||
case 'call': | ||
await this.handleCall(message); | ||
break; | ||
case 'callback': | ||
this.handleCallback(message); | ||
break; | ||
case 'event': | ||
this.handleEventMessage(message); | ||
break; | ||
case 'listen': | ||
await this.handleListen(message); | ||
break; | ||
case 'ready': | ||
await this.handleReady(message); | ||
break; | ||
default: | ||
break; | ||
} | ||
switch (message.type) { | ||
case 'call': | ||
await this.handleCall(message); | ||
break; | ||
case 'callback': | ||
this.handleCallback(message); | ||
break; | ||
case 'event': | ||
this.handleEventMessage(message); | ||
break; | ||
case 'listen': | ||
await this.handleListen(message); | ||
break; | ||
case 'ready': | ||
this.handleReady(message); | ||
break; | ||
default: | ||
break; | ||
} | ||
catch (e) { | ||
throw e; | ||
} | ||
} | ||
@@ -490,3 +486,2 @@ async useWorker(worker, instanceId) { | ||
if (this.callbacks[callbackId]) { | ||
// tslint:disable-next-line: no-console | ||
console.error(errors_1.CALLBACK_TIMEOUT(callbackId, this.rootEnvId, removeMessageArgs(message))); | ||
@@ -493,0 +488,0 @@ } |
@@ -14,3 +14,2 @@ "use strict"; | ||
function reportError(e) { | ||
// tslint:disable-next-line: no-console | ||
console.error(e); | ||
@@ -17,0 +16,0 @@ } |
"use strict"; | ||
// tslint:disable: no-console | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -4,0 +3,0 @@ const event_emitter_1 = require("../event-emitter"); |
@@ -18,6 +18,7 @@ "use strict"; | ||
} | ||
const { hasOwnProperty } = Object.prototype; | ||
function mkCompare(params) { | ||
let func = (_a, _b) => 0; | ||
for (const p in params) { | ||
if (params.hasOwnProperty(p)) { | ||
if (hasOwnProperty.call(params, p)) { | ||
const [key, mode] = params[p]; | ||
@@ -24,0 +25,0 @@ if (mode === true) { |
{ | ||
"name": "@wixc3/engine-core", | ||
"version": "7.5.1", | ||
"version": "7.6.2", | ||
"main": "cjs/index.js", | ||
@@ -5,0 +5,0 @@ "types": "cjs/index.d.ts", |
@@ -137,3 +137,3 @@ import { | ||
await this.useIframe( | ||
(host as HTMLIFrameElement)!, | ||
host, | ||
instanceId, | ||
@@ -166,5 +166,6 @@ src || defaultHtmlSourceFactory(env, instanceId, this.topology.publicPath) | ||
host.addEventListener('load', async () => { | ||
await this.envReady(instanceId); | ||
await reload(); | ||
host.addEventListener('load', () => { | ||
this.envReady(instanceId) | ||
.then(reload) | ||
.catch(reportError); | ||
}); | ||
@@ -278,24 +279,20 @@ | ||
} | ||
try { | ||
switch (message.type) { | ||
case 'call': | ||
await this.handleCall(message); | ||
break; | ||
case 'callback': | ||
this.handleCallback(message); | ||
break; | ||
case 'event': | ||
this.handleEventMessage(message); | ||
break; | ||
case 'listen': | ||
await this.handleListen(message); | ||
break; | ||
case 'ready': | ||
await this.handleReady(message); | ||
break; | ||
default: | ||
break; | ||
} | ||
} catch (e) { | ||
throw e; | ||
switch (message.type) { | ||
case 'call': | ||
await this.handleCall(message); | ||
break; | ||
case 'callback': | ||
this.handleCallback(message); | ||
break; | ||
case 'event': | ||
this.handleEventMessage(message); | ||
break; | ||
case 'listen': | ||
await this.handleListen(message); | ||
break; | ||
case 'ready': | ||
this.handleReady(message); | ||
break; | ||
default: | ||
break; | ||
} | ||
@@ -406,5 +403,5 @@ } | ||
if (this.apisOverrides[api] && this.apisOverrides[api][method]) { | ||
return (this.apisOverrides[api][method] as any)(...[from, ...args]); | ||
return this.apisOverrides[api][method](...[from, ...args]); | ||
} | ||
return (this.apis[api][method] as any)(...args); | ||
return this.apis[api][method](...args); | ||
} | ||
@@ -594,3 +591,2 @@ | ||
if (this.callbacks[callbackId]) { | ||
// tslint:disable-next-line: no-console | ||
console.error(CALLBACK_TIMEOUT(callbackId, this.rootEnvId, removeMessageArgs(message))); | ||
@@ -627,11 +623,11 @@ } | ||
*/ | ||
const defaultWorkerFactory = (envName: string, instanceId: string, publicPath: string = '/') => { | ||
const defaultWorkerFactory = (envName: string, instanceId: string, publicPath = '/') => { | ||
return new Worker(`${publicPath}${envName}.webworker.js${location.search}`, { name: instanceId }); | ||
}; | ||
const defaultSourceFactory = (envName: string, _instanceId: string, publicPath: string = '/') => { | ||
const defaultSourceFactory = (envName: string, _instanceId: string, publicPath = '/') => { | ||
return `${publicPath}${envName}.web.js${location.search}`; | ||
}; | ||
const defaultHtmlSourceFactory = (envName: string, _instanceId: string, publicPath: string = '/') => { | ||
const defaultHtmlSourceFactory = (envName: string, _instanceId: string, publicPath = '/') => { | ||
return `${publicPath}${envName}.html${location.search}`; | ||
@@ -638,0 +634,0 @@ }; |
@@ -25,4 +25,3 @@ import { Message } from './message-types'; | ||
export function reportError(e: Error) { | ||
// tslint:disable-next-line: no-console | ||
console.error(e); | ||
} |
// we cannot mix types of "dom" and "webworker". tsc fails building. | ||
declare var WorkerGlobalScope: new () => Worker; | ||
declare let WorkerGlobalScope: new () => Worker; | ||
@@ -4,0 +4,0 @@ export function isWorkerContext(target: unknown): target is Worker { |
@@ -1,3 +0,1 @@ | ||
// tslint:disable: no-console | ||
import { LogMessage, LogMetadata } from '../common-types'; | ||
@@ -4,0 +2,0 @@ import { EventEmitter } from '../event-emitter'; |
@@ -94,3 +94,3 @@ import { BaseHost } from './com/base-host'; | ||
{ environment: communication.getEnvironmentId() }, | ||
{ severity: loggerSeverity!, maxLogMessages, logToConsole } | ||
{ severity: loggerSeverity, maxLogMessages, logToConsole } | ||
); | ||
@@ -97,0 +97,0 @@ |
@@ -27,6 +27,8 @@ import { CREATE_RUNTIME } from '../symbols'; | ||
const { hasOwnProperty } = Object.prototype; | ||
function mkCompare<T>(params: SlotOrdering<T>): Compare<T> { | ||
let func: Compare<T> = (_a: T, _b: T) => 0; | ||
for (const p in params) { | ||
if (params.hasOwnProperty(p)) { | ||
if (hasOwnProperty.call(params, p)) { | ||
const [key, mode] = params[p]; | ||
@@ -33,0 +35,0 @@ if (mode === true) { |
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
272913
4506