mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-03-22 19:18:47 +08:00
Refactor and optimize templates and code structure
- Deleted outdated templates for epics, product brief, and requirements PRD. - Introduced lazy loading for locale messages in i18n module to enhance performance. - Updated main application bootstrap to parallelize CSRF token fetching and locale loading. - Implemented code splitting for router configuration to optimize bundle size and loading times. - Added WebSocket connection limits and rate limiting to improve server performance and prevent abuse. - Enhanced input validation with compiled regex patterns for better performance and maintainability.
This commit is contained in:
@@ -68,9 +68,21 @@ const messages: Record<Locale, Record<string, string>> = {
|
||||
zh: {},
|
||||
};
|
||||
|
||||
/**
|
||||
* Load messages for a specific locale only (lazy loading)
|
||||
* This is the optimized init method that loads only the active locale
|
||||
*/
|
||||
export async function loadMessagesForLocale(locale: Locale): Promise<Record<string, string>> {
|
||||
const localeMessages = await loadMessages(locale);
|
||||
messages[locale] = localeMessages;
|
||||
updateIntl(locale);
|
||||
return localeMessages;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize translation messages for all locales
|
||||
* Call this during app initialization
|
||||
* NOTE: Use loadMessagesForLocale() for faster single-locale init
|
||||
*/
|
||||
export async function initMessages(): Promise<void> {
|
||||
// Load messages for both locales in parallel
|
||||
|
||||
Reference in New Issue
Block a user