Skip to content

Commit d65cfd4

Browse files
author
Tim Sinaeve
committed
release: v0.8.4
1 parent 2f45bdc commit d65cfd4

File tree

6 files changed

+1691
-1211
lines changed

6 files changed

+1691
-1211
lines changed

VERSION_LOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
# Version Log
22

3+
## v0.8.4 - The Codebase Consistency Upgrade
4+
5+
This release is a comprehensive refactoring effort that standardizes styling, typing, and error handling patterns across the application, laying a cleaner foundation for future development without changing functional behavior.
6+
7+
### 🛠 Improvements
8+
9+
- **Quotes Consistency**: All internal TypeScript and React source files now strictly enforce single quotes.
10+
- **TypeScript Rigor**: Cleaned up inline object prop types into documented interfaces (`EditorRefPluginProps`) and replaced several broad `any` usages with exact Lexical editor state types.
11+
- **Error Handling**: Globally unified our Promise implementations to catch as `error` (e.g., `catch (error) { ... }`) for consistency across backend and frontend calls.
12+
- **Code Structure**: Converted mixed component initializations into predictable arrow functions, stripped unneeded `I` prefixes from interfaces, and hoisted deferred imports to the top of their modules.
13+
314
## v0.8.3 - The Safety & Context Menu Update
415

516
This release brings an intelligent context menu to the document editor and introduces deletion safeguards so your content stays secure during rapid editing.

components/RichTextEditor.tsx

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import {
3131
TableNode,
3232
TableRowNode,
3333
} from '@lexical/table';
34-
import { $getRoot } from 'lexical';
34+
import { $getRoot, EditorState, LexicalEditor } from 'lexical';
3535

3636
import { ImageNode } from './rich-text/ImageNode';
3737
import { ToolbarPlugin } from './rich-text/ToolbarPlugin';
@@ -166,9 +166,9 @@ const RichTextEditor = forwardRef<RichTextEditorHandle, RichTextEditorProps>(
166166
});
167167
}, [html, editorRef]);
168168

169-
const handleEditorChange = (editorState: any) => {
169+
const handleEditorChange = (editorState: EditorState) => {
170170
// Skip if this change was triggered by our own sync
171-
if (isUpdatingFromServer.current) return;
171+
if (isUpdatingFromServer.current || !editorRef) return;
172172

173173
editorState.read(() => {
174174
// Generate HTML
@@ -249,7 +249,11 @@ const RichTextEditor = forwardRef<RichTextEditorHandle, RichTextEditorProps>(
249249
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
250250

251251
// Helper plugin to expose the editor instance
252-
const EditorRefPlugin = ({ setEditorRef }: { setEditorRef: (editor: any) => void }) => {
252+
interface EditorRefPluginProps {
253+
setEditorRef: (editor: LexicalEditor) => void;
254+
}
255+
256+
const EditorRefPlugin: React.FC<EditorRefPluginProps> = ({ setEditorRef }) => {
253257
const [editor] = useLexicalComposerContext();
254258
useEffect(() => {
255259
setEditorRef(editor);
@@ -258,7 +262,11 @@ const EditorRefPlugin = ({ setEditorRef }: { setEditorRef: (editor: any) => void
258262
};
259263

260264
// Helper plugin to track focus
261-
const FocusPlugin = ({ onFocusChange }: { onFocusChange?: (hasFocus: boolean) => void }) => {
265+
interface FocusPluginProps {
266+
onFocusChange?: (hasFocus: boolean) => void;
267+
}
268+
269+
const FocusPlugin: React.FC<FocusPluginProps> = ({ onFocusChange }) => {
262270
const [editor] = useLexicalComposerContext();
263271
useEffect(() => {
264272
return editor.registerRootListener((rootElement: HTMLElement | null, prevRootElement: HTMLElement | null) => {

0 commit comments

Comments
 (0)