@desk-framework/frame-test
Advanced tools
Comparing version 4.0.0-dev.34 to 4.0.0-dev.35
@@ -25,2 +25,4 @@ import { ActivityContext, ConfigOptions, GlobalContext } from "@desk-framework/frame-core"; | ||
captureLogs: boolean; | ||
/** App settings, i.e. data made available through `app.settings`; must be serializable as JSON */ | ||
appSettings: Record<string, unknown>; | ||
} | ||
@@ -27,0 +29,0 @@ /** |
@@ -1,2 +0,2 @@ | ||
import { ConfigOptions, app, } from "@desk-framework/frame-core"; | ||
import { AppSettings, ConfigOptions, app, } from "@desk-framework/frame-core"; | ||
import { TestScope } from "../TestScope.js"; | ||
@@ -22,2 +22,4 @@ import { TestTheme } from "../style/TestTheme.js"; | ||
captureLogs = false; | ||
/** App settings, i.e. data made available through `app.settings`; must be serializable as JSON */ | ||
appSettings = {}; | ||
} | ||
@@ -64,3 +66,6 @@ /** | ||
app.navigation = new TestNavigationContext(options); | ||
// reset app settings | ||
app.settings = new AppSettings(); | ||
app.settings.write(options.appSettings); | ||
return app; | ||
} |
@@ -76,3 +76,3 @@ import { RenderContext, UICell, UIColumn, UIRow, UIScrollContainer, app, } from "@desk-framework/frame-core"; | ||
if (!this.contentUpdater) { | ||
this.contentUpdater = new ContentUpdater(container, element).setAsyncRendering(container.asyncContentRendering); | ||
this.contentUpdater = new ContentUpdater(container, element); | ||
this.contentUpdater.awaitUpdateAsync(); | ||
@@ -126,7 +126,2 @@ } | ||
content = []; | ||
/** Set async rendering flag; when enabled, all content is rendered asynchronously */ | ||
setAsyncRendering(async) { | ||
this._async = async; | ||
return this; | ||
} | ||
/** Stop updating content asynchronously */ | ||
@@ -182,5 +177,7 @@ stop() { | ||
this._output.set(item, undefined); | ||
if (this._stopped) | ||
return; | ||
// define rendering callback | ||
let isSync = true; | ||
let lastOutput; | ||
// define rendering callback | ||
const callback = (output, afterRender) => { | ||
@@ -250,16 +247,9 @@ const scheduleAfter = afterRender && | ||
}; | ||
// invoke render method now or async | ||
const doRender = () => { | ||
if (this._stopped) | ||
return; | ||
try { | ||
item.render(callback); | ||
} | ||
catch (err) { | ||
app.log.error(err); | ||
} | ||
}; | ||
this._async && app.renderer | ||
? app.renderer.schedule(() => doRender(), true) | ||
: doRender(); | ||
// invoke render method | ||
try { | ||
item.render(callback); | ||
} | ||
catch (err) { | ||
app.log.error(err); | ||
} | ||
// set placeholder output if needed, to reduce diffing later | ||
@@ -280,18 +270,12 @@ isSync = false; | ||
return this._updateP; | ||
if (this._async) { | ||
await new Promise((r) => setTimeout(r, 1)); | ||
} | ||
if (!this._updateP) { | ||
this._updateP = new Promise((r) => { | ||
this._updateResolve = r; | ||
}); | ||
if (app.renderer) | ||
app.renderer.schedule(() => this.update()); | ||
else | ||
this.update(); | ||
} | ||
this._updateP = new Promise((r) => { | ||
this._updateResolve = r; | ||
}); | ||
if (app.renderer) | ||
app.renderer.schedule(() => this.update()); | ||
else | ||
this.update(); | ||
return this._updateP; | ||
} | ||
_stopped; | ||
_async; | ||
_updateP; | ||
@@ -298,0 +282,0 @@ _updateResolve; |
{ | ||
"name": "@desk-framework/frame-test", | ||
"version": "4.0.0-dev.34", | ||
"version": "4.0.0-dev.35", | ||
"publishConfig": { | ||
@@ -35,3 +35,3 @@ "tag": "next" | ||
"peerDependencies": { | ||
"@desk-framework/frame-core": "4.0.0-dev.34" | ||
"@desk-framework/frame-core": "4.0.0-dev.35" | ||
}, | ||
@@ -38,0 +38,0 @@ "devDependencies": { |
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
213714
5013