neue Homepage auf react basis

This commit is contained in:
2026-08-07 21:39:30 +02:00
parent 164bdd19ad
commit ee89442c04
52191 changed files with 1230242 additions and 58 deletions
@@ -0,0 +1,9 @@
export type UnregisterToken = {
cleanupToken: number;
};
export type UnsubscribeFn = () => void;
export interface CleanupTracking {
register(object: any, unsubscribe: UnsubscribeFn, unregisterToken: UnregisterToken): void;
unregister(unregisterToken: UnregisterToken): void;
reset(): void;
}
@@ -0,0 +1,9 @@
export type UnregisterToken = {
cleanupToken: number;
};
export type UnsubscribeFn = () => void;
export interface CleanupTracking {
register(object: any, unsubscribe: UnsubscribeFn, unregisterToken: UnregisterToken): void;
unregister(unregisterToken: UnregisterToken): void;
reset(): void;
}
@@ -0,0 +1,5 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
@@ -0,0 +1 @@
export {};
@@ -0,0 +1,7 @@
import type { CleanupTracking, UnsubscribeFn, UnregisterToken } from "./CleanupTracking.mjs";
export declare class FinalizationRegistryBasedCleanupTracking implements CleanupTracking {
registry: FinalizationRegistry<UnsubscribeFn>;
register(object: any, unsubscribe: UnsubscribeFn, unregisterToken: UnregisterToken): void;
unregister(unregisterToken: UnregisterToken): void;
reset(): void;
}
@@ -0,0 +1,7 @@
import type { CleanupTracking, UnsubscribeFn, UnregisterToken } from "./CleanupTracking.js";
export declare class FinalizationRegistryBasedCleanupTracking implements CleanupTracking {
registry: FinalizationRegistry<UnsubscribeFn>;
register(object: any, unsubscribe: UnsubscribeFn, unregisterToken: UnregisterToken): void;
unregister(unregisterToken: UnregisterToken): void;
reset(): void;
}
@@ -0,0 +1,21 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.FinalizationRegistryBasedCleanupTracking = void 0;
class FinalizationRegistryBasedCleanupTracking {
registry = new FinalizationRegistry(unsubscribe => {
if (typeof unsubscribe === 'function') {
unsubscribe();
}
});
register(object, unsubscribe, unregisterToken) {
this.registry.register(object, unsubscribe, unregisterToken);
}
unregister(unregisterToken) {
this.registry.unregister(unregisterToken);
}
reset() {}
}
exports.FinalizationRegistryBasedCleanupTracking = FinalizationRegistryBasedCleanupTracking;
@@ -0,0 +1,14 @@
export class FinalizationRegistryBasedCleanupTracking {
registry = new FinalizationRegistry(unsubscribe => {
if (typeof unsubscribe === 'function') {
unsubscribe();
}
});
register(object, unsubscribe, unregisterToken) {
this.registry.register(object, unsubscribe, unregisterToken);
}
unregister(unregisterToken) {
this.registry.unregister(unregisterToken);
}
reset() {}
}
@@ -0,0 +1,9 @@
import type { CleanupTracking, UnregisterToken, UnsubscribeFn } from "./CleanupTracking.mjs";
export declare class TimerBasedCleanupTracking implements CleanupTracking {
timeouts?: Map<number, number> | undefined;
cleanupTimeout: number;
constructor(timeout?: number);
register(object: any, unsubscribe: UnsubscribeFn, unregisterToken: UnregisterToken): void;
unregister(unregisterToken: UnregisterToken): void;
reset(): void;
}
@@ -0,0 +1,9 @@
import type { CleanupTracking, UnregisterToken, UnsubscribeFn } from "./CleanupTracking.js";
export declare class TimerBasedCleanupTracking implements CleanupTracking {
timeouts?: Map<number, number> | undefined;
cleanupTimeout: number;
constructor(timeout?: number);
register(object: any, unsubscribe: UnsubscribeFn, unregisterToken: UnregisterToken): void;
unregister(unregisterToken: UnregisterToken): void;
reset(): void;
}
@@ -0,0 +1,45 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.TimerBasedCleanupTracking = void 0;
// If no effect ran after this amount of time, we assume that the render was not committed by React
const CLEANUP_TIMER_LOOP_MILLIS = 1000;
class TimerBasedCleanupTracking {
timeouts = new Map();
cleanupTimeout = CLEANUP_TIMER_LOOP_MILLIS;
constructor(timeout = CLEANUP_TIMER_LOOP_MILLIS) {
this.cleanupTimeout = timeout;
}
register(object, unsubscribe, unregisterToken) {
if (!this.timeouts) {
this.timeouts = new Map();
}
const timeout = setTimeout(() => {
if (typeof unsubscribe === 'function') {
unsubscribe();
}
this.timeouts.delete(unregisterToken.cleanupToken);
}, this.cleanupTimeout);
this.timeouts.set(unregisterToken.cleanupToken, timeout);
}
unregister(unregisterToken) {
const timeout = this.timeouts.get(unregisterToken.cleanupToken);
if (timeout) {
this.timeouts.delete(unregisterToken.cleanupToken);
clearTimeout(timeout);
}
}
reset() {
if (this.timeouts) {
this.timeouts.forEach((value, key) => {
this.unregister({
cleanupToken: key
});
});
this.timeouts = undefined;
}
}
}
exports.TimerBasedCleanupTracking = TimerBasedCleanupTracking;
@@ -0,0 +1,38 @@
// If no effect ran after this amount of time, we assume that the render was not committed by React
const CLEANUP_TIMER_LOOP_MILLIS = 1000;
export class TimerBasedCleanupTracking {
timeouts = new Map();
cleanupTimeout = CLEANUP_TIMER_LOOP_MILLIS;
constructor(timeout = CLEANUP_TIMER_LOOP_MILLIS) {
this.cleanupTimeout = timeout;
}
register(object, unsubscribe, unregisterToken) {
if (!this.timeouts) {
this.timeouts = new Map();
}
const timeout = setTimeout(() => {
if (typeof unsubscribe === 'function') {
unsubscribe();
}
this.timeouts.delete(unregisterToken.cleanupToken);
}, this.cleanupTimeout);
this.timeouts.set(unregisterToken.cleanupToken, timeout);
}
unregister(unregisterToken) {
const timeout = this.timeouts.get(unregisterToken.cleanupToken);
if (timeout) {
this.timeouts.delete(unregisterToken.cleanupToken);
clearTimeout(timeout);
}
}
reset() {
if (this.timeouts) {
this.timeouts.forEach((value, key) => {
this.unregister({
cleanupToken: key
});
});
this.timeouts = undefined;
}
}
}