Skip to content

Commit 6cd59e3

Browse files
pauldambraclaude
andcommitted
perf: drop unused MDXEditor from OSTable to cut @MDXEditor from eager bundle
OSTable defined an `Editor` component wrapping @mdxeditor/editor's MDXEditor, but it was never rendered (dead code since a version bump 9 months ago). The unused import pulled the whole markdown-editor stack — @mdxeditor/editor + @codemirror, @codesandbox/sandpack, acorn, downshift, react-hook-form — into the always-loaded bundle on every page. OSTable was the only eager importer of @mdxeditor/editor, so deleting the dead component (and the now-unused navigate import) removes ~3.2 MiB from the eager graph with no behaviour change. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent bc2398a commit 6cd59e3

1 file changed

Lines changed: 0 additions & 26 deletions

File tree

src/components/OSTable/index.tsx

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
import { linkPlugin, MDXEditor } from '@mdxeditor/editor'
21
import { IconArrowLeft, IconArrowRight, IconSpinner } from '@posthog/icons'
32
import React, { useEffect, useState } from 'react'
43
import { useInView } from 'react-intersection-observer'
54
import { groupBy as _groupBy } from 'lodash'
6-
import { navigate } from 'gatsby'
75
import ScrollArea from 'components/RadixUI/ScrollArea'
86
import { CallToAction } from 'components/CallToAction'
97
import OSButton from 'components/OSButton'
@@ -136,30 +134,6 @@ const Pagination = ({
136134
)
137135
}
138136

139-
const Editor = ({ markdown }: { markdown: string }) => {
140-
const mdxEditorContainerRef = React.useRef<HTMLDivElement>(null)
141-
142-
const handleClick = (event: React.MouseEvent<HTMLDivElement>) => {
143-
const href = (event.target as HTMLElement).closest('a.mdx-editor-link')?.getAttribute('href')
144-
if (href) {
145-
navigate(href, { state: { newWindow: true } })
146-
}
147-
}
148-
149-
return (
150-
<div onClick={handleClick} ref={mdxEditorContainerRef}>
151-
<MDXEditor
152-
lexicalTheme={{
153-
link: 'mdx-editor-link cursor-pointer',
154-
}}
155-
contentEditableClassName="[&_p]:m-0 min-w-[10px]"
156-
markdown={markdown}
157-
plugins={[linkPlugin()]}
158-
/>
159-
</div>
160-
)
161-
}
162-
163137
const Row = ({
164138
row,
165139
lastRowRef,

0 commit comments

Comments
 (0)