This commit reorganizes the Alpine.js initialization process to ensure all component modules are registered before Alpine starts, preventing potential race conditions and improving code organization. Changes: - Add web/src/register-alpine.ts: Central module that imports all Alpine component modules before calling Alpine.start(), ensuring proper registration order - Update web/src/alpine.ts: Remove Alpine.start() call since it's now handled in register-alpine.ts - Update web/src/main.ts: Replace individual module imports with single register-alpine import, simplifying the entry point - Update web/src/header.ts: Rename changeThemeTo function to changeTheme for consistency with other naming conventions This change ensures all Alpine.global() calls complete before Alpine initializes, following best practices for Alpine.js module registration.
34 lines
846 B
TypeScript
34 lines
846 B
TypeScript
import { Alpine } from "./alpine";
|
|
// Import all modules that register Alpine globals
|
|
// These imports trigger their Alpine.global() calls
|
|
import "./admin";
|
|
import "./api";
|
|
import "./analytics";
|
|
import "./api-explorer-docs";
|
|
import "./bookshelf";
|
|
import "./collection-rules";
|
|
import "./collections";
|
|
import "./conflicts";
|
|
import "./custom-section-builder";
|
|
import "./dashboard";
|
|
import "./device-management";
|
|
import "./docs";
|
|
import "./header";
|
|
import "./index";
|
|
import "./library";
|
|
import "./login";
|
|
import "./linking";
|
|
import "./password_validation";
|
|
import "./profile";
|
|
import "./profile-modal";
|
|
import "./queue";
|
|
import "./register";
|
|
import "./search";
|
|
import "./themeDropdown";
|
|
import "./toast";
|
|
import "./toast-error";
|
|
import "./unlinked_books";
|
|
import "./woodPaneling";
|
|
// NOW start Alpine after all registrations complete
|
|
Alpine.start();
|