Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e80619bac6 | |||
| e290744451 | |||
| c5c45f668f | |||
| aa748e0d82 |
14
changelog.md
14
changelog.md
@@ -1,5 +1,19 @@
|
||||
# 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
|
||||
|
||||
- Adds optional configuration properties 'injectReload' and 'noCache' to the website server options interface.
|
||||
- Dev features (injectReload and noCache) are no longer only enabled when serveDir is set; they now default to true when not explicitly provided.
|
||||
- This changes default runtime behavior: live-reload injection and disabled browser caching may be enabled for servers that previously did not have them — consumers should set options explicitly to preserve previous behavior.
|
||||
|
||||
## 2026-02-24 - 8.3.1 - fix(typedserver)
|
||||
no changes detected — no version bump needed
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@api.global/typedserver",
|
||||
"version": "8.3.1",
|
||||
"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": {
|
||||
|
||||
@@ -3,6 +3,6 @@
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@api.global/typedserver',
|
||||
version: '8.3.1',
|
||||
version: '8.4.1',
|
||||
description: 'A TypeScript-based project for easy serving of static files with support for live reloading, compression, and typed requests.'
|
||||
}
|
||||
|
||||
@@ -29,6 +29,10 @@ export interface IUtilityWebsiteServerConstructorOptions {
|
||||
adsTxt?: string[];
|
||||
/** Response compression configuration (default: enabled with brotli + gzip) */
|
||||
compression?: plugins.smartserve.ICompressionConfig | boolean;
|
||||
/** Disable browser caching (default: true when serveDir is set) */
|
||||
noCache?: boolean;
|
||||
/** Inject live-reload devtools script into HTML (default: true when serveDir is set) */
|
||||
injectReload?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -61,10 +65,10 @@ export class UtilityWebsiteServer {
|
||||
domain: this.options.domain,
|
||||
port,
|
||||
|
||||
// Development features (only when serving from filesystem)
|
||||
injectReload: !!this.options.serveDir,
|
||||
// Development features
|
||||
injectReload: this.options.injectReload ?? true,
|
||||
watch: !!this.options.serveDir,
|
||||
noCache: !!this.options.serveDir,
|
||||
noCache: this.options.noCache ?? true,
|
||||
|
||||
// SPA support (enabled by default for modern web apps)
|
||||
spaFallback: this.options.spaFallback ?? true,
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user