Compare commits

..

2 Commits

Author SHA1 Message Date
e80619bac6 v8.4.1
Some checks failed
Default (tags) / security (push) Failing after 1s
Default (tags) / test (push) Failing after 1s
Default (tags) / release (push) Has been skipped
Default (tags) / metadata (push) Has been skipped
2026-03-03 21:17:44 +00:00
e290744451 fix(statuspill): wait for document.body before appending status pill when script loads before <body> is parsed; defer via DOMContentLoaded or requestAnimationFrame 2026-03-03 21:17:44 +00:00
4 changed files with 18 additions and 2 deletions

View File

@@ -1,5 +1,12 @@
# Changelog
## 2026-03-03 - 8.4.1 - fix(statuspill)
wait for document.body before appending status pill when script loads before <body> is parsed; defer via DOMContentLoaded or requestAnimationFrame
- Guard against missing document.body to avoid errors when the script runs before the <body> is parsed
- Retry showing on DOMContentLoaded if the document is still loading
- Fallback to requestAnimationFrame to schedule the show on the next frame if DOM is already parsed
## 2026-02-24 - 8.4.0 - feat(utilityservers)
add injectReload and noCache options and enable dev features by default

View File

@@ -1,6 +1,6 @@
{
"name": "@api.global/typedserver",
"version": "8.4.0",
"version": "8.4.1",
"description": "A TypeScript-based project for easy serving of static files with support for live reloading, compression, and typed requests.",
"type": "module",
"exports": {

View File

@@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@api.global/typedserver',
version: '8.4.0',
version: '8.4.1',
description: 'A TypeScript-based project for easy serving of static files with support for live reloading, compression, and typed requests.'
}

View File

@@ -311,6 +311,15 @@ export class TypedserverStatusPill extends LitElement {
*/
public show(): void {
if (!this.appended) {
if (!document.body) {
// Script loaded before <body> was parsed (async module) — wait for DOM
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', () => this.show(), { once: true });
} else {
requestAnimationFrame(() => this.show());
}
return;
}
document.body.appendChild(this);
this.appended = true;
}