/** * @defendr/enzyme - Minimal Barrel Export * * @fileoverview Minimal re-export for the most commonly used items. * **For optimal tree-shaking and bundle size, import from submodules directly.** * * @version 1.0.0 * @license MIT * * ## PERFORMANCE CRITICAL: Use Submodule Imports * * This barrel export has been minimized to prevent bundle bloat. Importing from * this file forces the bundler to parse all exports, even if tree-shaking is enabled. * * ### Recommended Submodule Import Pattern (GOOD): * ```typescript * // Import from specific submodules for optimal tree-shaking * import { useAuth, AuthProvider } from '@defendr/enzyme/auth'; * import { useFeatureFlag, FlagGate } from '@defendr/enzyme/flags'; * import { usePerformanceMonitor } from '@defendr/enzyme/performance'; * import { ErrorBoundary } from '@defendr/enzyme/monitoring'; * ``` * * ### Avoid Main Index Import: * ```typescript * // This forces bundler to process all exports * import { useAuth, useFeatureFlag } from '@defendr/enzyme'; * ``` * * ### Performance Impact: * - **Before**: Importing from main index adds ~500-700KB to initial bundle * - **After**: Submodule imports add only what you use (~20-50KB typical) * - **Parse Time**: ~1.5s saved on initial load (mobile 3G) * * ## Available Submodules: * * - `@defendr/enzyme/auth` - Authentication, authorization, RBAC, Active Directory * - `@defendr/enzyme/api` - HTTP client, type-safe API calls, request queue * - `@defendr/enzyme/config` - Configuration management, environment overrides * - `@defendr/enzyme/coordination` - Cross-module coordination and event bus * - `@defendr/enzyme/core` - Core utilities and base functionality * - `@defendr/enzyme/data` - Data utilities, transformations, validation * - `@defendr/enzyme/feature` - Feature module system, dependency injection * - `@defendr/enzyme/flags` - Feature flags, A/B testing, conditional rendering * - `@defendr/enzyme/hooks` - Custom React hooks (theme, network, analytics, etc.) * - `@defendr/enzyme/hydration` - Progressive hydration for SSR applications * - `@defendr/enzyme/layouts` - Adaptive layouts, context-aware positioning * - `@defendr/enzyme/monitoring` - Error tracking, crash analytics, error boundaries * - `@defendr/enzyme/performance` - Web Vitals, performance monitoring, budgets * - `@defendr/enzyme/queries` - React Query utilities, query key factories * - `@defendr/enzyme/realtime` - WebSocket, SSE, real-time data sync * - `@defendr/enzyme/routing` - Type-safe routing, route registry, guards * - `@defendr/enzyme/security` - CSP, CSRF protection, XSS prevention, secure storage * - `@defendr/enzyme/services` - Service layer, HTTP interceptors, request queue * - `@defendr/enzyme/state` - State management, store factory, persistence * - `@defendr/enzyme/streaming` - Streaming data, chunked responses * - `@defendr/enzyme/system` - Application initialization, lifecycle management * - `@defendr/enzyme/theme` - Theme provider, dark mode, system preferences * - `@defendr/enzyme/ui` - UI components (buttons, forms, feedback, etc.) * - `@defendr/enzyme/utils` - Utility functions, type guards, async helpers * - `@defendr/enzyme/ux` - Loading states, skeletons, optimistic UI, accessibility * - `@defendr/enzyme/vdom` - Virtual DOM utilities, reconciliation * * @module @defendr/enzyme */ /** * Note: For optimal bundle size, use submodule imports instead of the main barrel. * * Importing from the main index can cause: * - Slower bundler parse times * - Larger initial bundles * - Reduced tree-shaking effectiveness * * **Recommended:** * ```typescript * import { useAuth } from '@defendr/enzyme/auth'; * import { useFeatureFlag } from '@defendr/enzyme/flags'; * ``` */ /** * Only the most critical, commonly used exports are re-exported here. * Everything else MUST be imported from submodules. * * Criteria for inclusion: * 1. Used in >80% of applications * 2. Minimal dependencies (doesn't pull in large modules) * 3. Critical for app initialization */ export { AuthProvider, useAuth } from './auth'; export type { User, AuthState } from './auth'; export { FeatureFlagProvider, useFeatureFlag, FlagGate } from './flags'; export { ErrorBoundary, GlobalErrorBoundary } from './monitoring'; export { PerformanceProvider, initPerformanceMonitoring } from './performance'; export { createQueryKeyFactory } from './queries'; export { AppLink, AppNavLink, appRoutes, createRouter, routes, buildPath, useRouteNavigate, } from './routing'; /** * Type-only exports have zero runtime cost, so we can be more generous. * These are commonly used types across the application. */ export type { Role, Permission, AuthTokens } from './auth'; export type { AppError, ErrorSeverity, ErrorCategory } from './monitoring'; export type { VitalMetricName, PerformanceRating, PerformanceBudget } from './performance'; export type { DeepRequired, DeepReadonly, Nullable, Maybe, Result, } from './utils'; /** * For cases where you need multiple items from a module, use namespaced imports: * * @example * ```typescript * import * as Auth from '@/lib/auth'; * import * as Flags from '@/lib/flags'; * * const user = Auth.useAuth(); * const enabled = Flags.useFeatureFlag('new-feature'); * ``` */ /** * These re-exports are TEMPORARY to aid migration from v3 to v4. * They will be removed in v5.0.0. * * @deprecated Use submodule imports instead */ /** * That's it! Only ~20 essential exports instead of 1,000+. * * For everything else, use submodule imports: * @see ./auth/index.ts * @see ./flags/index.ts * @see ./performance/index.ts * @see ./monitoring/index.ts * @see ./hooks/index.ts * @see ./ui/index.ts * @see ./ux/index.ts * @see ./utils/index.ts * ... and 20+ more submodules */