mirror of https://github.com/usememos/memos.git
Complete refactoring of MemoView components for better code quality: - Split useMemoViewState into individual hook files (useMemoActions, useKeyboardShortcuts, useNsfwContent, useImagePreview, useMemoCreator) for single responsibility principle - Consolidate types closer to usage - move hook-specific types to respective files, keep only component props in shared types.ts - Optimize context with separate static/dynamic memoization to reduce unnecessary re-renders - Simplify barrel exports to only expose public API (MemoView component and MemoViewProps type) - Add comprehensive JSDoc documentation to all public APIs with usage examples Benefits: - Better maintainability: each hook file has one clear purpose - Improved performance: context optimization prevents unnecessary re-renders - Enhanced developer experience: clear documentation and encapsulation - Cleaner architecture: public API is minimal, internal details hidden All automated checks pass (TypeScript compilation, linter, production build). |
||
|---|---|---|
| .. | ||
| public | ||
| src | ||
| .gitignore | ||
| biome.json | ||
| components.json | ||
| index.html | ||
| package.json | ||
| pnpm-lock.yaml | ||
| tsconfig.json | ||
| vite.config.mts | ||