dsh-unlag 1.9.32 → 1.9.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/client.js +2 -2
- package/index.js +11 -18
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -43,6 +43,7 @@ dsh plugin install dsh-unlag
|
|
|
43
43
|
- 界面重建会重新进入同一个地址:屏幕上正在显示的内容重新载入一次,会话记录还在。
|
|
44
44
|
- 排队消息、输入草稿、附件:重建前先提交焦点里的内容;有人没存完就拦下,不硬刷。
|
|
45
45
|
- 有未保存改动、开着弹窗、或下个页面要用的模块读不全:拦下并提示,提示里写明卡在哪一项,宁可不刷。
|
|
46
|
+
- 原来就起不来的插件不挡这一下:换代码照做,日志里点名哪个插件本来就没在跑。
|
|
46
47
|
- 旧页面记着的启动清单分组变了(装过/卸过插件):按插件逐个补齐再交给新页面,不会因为清单 404 把 App 带走。
|
|
47
48
|
- 从不自己重启或退出 App。
|
|
48
49
|
|
package/client.js
CHANGED
|
@@ -173,9 +173,9 @@ window.__ModuleLoader__.load({
|
|
|
173
173
|
function reloadVerdict(data) {
|
|
174
174
|
if (data === null || typeof data !== 'object') return 'failed';
|
|
175
175
|
const status = typeof data.status === 'string' ? data.status : 'failed';
|
|
176
|
-
// A plugin that did not start makes the set unusable for a rebuild, whatever the status says.
|
|
177
|
-
if (Array.isArray(data.failedEntries) && data.failedEntries.length > 0) return 'failed';
|
|
178
176
|
// `pending` is not a queued update: the changed modules need a restart to load at all.
|
|
177
|
+
// Entries that were already not running before the press are not its result: the app rejects
|
|
178
|
+
// a reload that newly breaks one, so the press stands whatever that leftover list says.
|
|
179
179
|
if (Array.isArray(data.pending) && data.pending.length > 0) return 'restart';
|
|
180
180
|
if (typeof data.restartReason === 'string' && data.restartReason !== '') return 'failed';
|
|
181
181
|
return status;
|
package/index.js
CHANGED
|
@@ -401,17 +401,19 @@ function pluginReloader(ctx, config) {
|
|
|
401
401
|
* out of harmless prose. The warning itself is the app saying an entry is not serving the page, so
|
|
402
402
|
* every warning counts and the sentence is passed on as it reads.
|
|
403
403
|
*/
|
|
404
|
-
const failedEntries = warnings.map((warning) => (typeof warning === 'string' ? warning : String(warning?.message ?? warning)))
|
|
405
|
-
log(
|
|
406
|
-
`plugins reloaded (warnings=${warnings.length} pending=${pending.length}${restartReason === null ? '' : ` restart=${restartReason}`})`,
|
|
407
|
-
)
|
|
408
404
|
/**
|
|
409
|
-
*
|
|
410
|
-
*
|
|
405
|
+
* These are the entries that were already not running before this press: the app rejects a
|
|
406
|
+
* reload that newly breaks an entry, so nothing in this list is a result of the press. They are
|
|
407
|
+
* written down because a person sees them afterwards, and they must not stop the page from
|
|
408
|
+
* coming up on the set that is running now.
|
|
411
409
|
*/
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
410
|
+
const inactiveEntries = warnings.map((warning) => (typeof warning === 'string' ? warning : String(warning?.message ?? warning)))
|
|
411
|
+
log(
|
|
412
|
+
`plugins reloaded (inactive before this press=${inactiveEntries.length} pending=${pending.length}${restartReason === null ? '' : ` restart=${restartReason}`})`,
|
|
413
|
+
)
|
|
414
|
+
for (const entry of inactiveEntries.slice(0, 5)) log(`a plugin was already not running and still is not: ${entry.slice(0, 200)}`)
|
|
415
|
+
if (inactiveEntries.length > 5) log(`and ${inactiveEntries.length - 5} more were already not running`)
|
|
416
|
+
return { status: 'done', warnings, pending, restartReason, inactiveEntries, failedEntries: [] }
|
|
415
417
|
}
|
|
416
418
|
|
|
417
419
|
const flush = async () => {
|
|
@@ -584,15 +586,6 @@ function pluginReloader(ctx, config) {
|
|
|
584
586
|
failedEntries: outcome.failedEntries,
|
|
585
587
|
}
|
|
586
588
|
}
|
|
587
|
-
if (outcome.failedEntries.length > 0) {
|
|
588
|
-
return {
|
|
589
|
-
status: 'failed', // ui-copy-ignore
|
|
590
|
-
warnings: outcome.warnings, // ui-copy-ignore
|
|
591
|
-
pending: [], // ui-copy-ignore
|
|
592
|
-
restartReason: null,
|
|
593
|
-
failedEntries: outcome.failedEntries,
|
|
594
|
-
}
|
|
595
|
-
}
|
|
596
589
|
return outcome
|
|
597
590
|
} catch (error) {
|
|
598
591
|
if (error?.stillRunning === true) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-unlag",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.33",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A press applies plugin edits right away and brings a laggy interface back; automatic reloading stays off unless you turn it on, so the press is the only trigger, and nothing restarts.",
|
|
6
6
|
"license": "MIT",
|