mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-03-06 16:31:12 +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:
@@ -5,7 +5,7 @@ import './index.css'
|
||||
import 'react-grid-layout/css/styles.css'
|
||||
import 'react-resizable/css/styles.css'
|
||||
import 'xterm/css/xterm.css'
|
||||
import { initMessages, getInitialLocale, getMessages, type Locale } from './lib/i18n'
|
||||
import { loadMessagesForLocale, getInitialLocale } from './lib/i18n'
|
||||
import { logWebVitals } from './lib/webVitals'
|
||||
|
||||
/**
|
||||
@@ -29,17 +29,14 @@ async function bootstrapApplication() {
|
||||
const rootElement = document.getElementById('root')
|
||||
if (!rootElement) throw new Error('Failed to find the root element')
|
||||
|
||||
// Initialize CSRF token before any API calls
|
||||
await initCsrfToken()
|
||||
// Parallelize CSRF token fetch and locale detection (independent operations)
|
||||
const [, locale] = await Promise.all([
|
||||
initCsrfToken(),
|
||||
getInitialLocale()
|
||||
])
|
||||
|
||||
// Initialize translation messages
|
||||
await initMessages()
|
||||
|
||||
// Determine initial locale from browser/storage
|
||||
const locale: Locale = getInitialLocale()
|
||||
|
||||
// Get messages for the initial locale
|
||||
const messages = getMessages(locale)
|
||||
// Load only the active locale's messages (lazy load secondary on demand)
|
||||
const messages = await loadMessagesForLocale(locale)
|
||||
|
||||
const root = createRoot(rootElement)
|
||||
root.render(
|
||||
|
||||
Reference in New Issue
Block a user