Repository navigation
refactor: remove AI Lodash dependencies and simplify workspace code - #3119
Conversation
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Block positions and content conversion packages/core/src/api/getBlockInfoFromPos.ts, packages/core/src/api/nodeConversions/nodeToBlock.ts, packages/core/src/api/parsers/markdown/markdownToHtml.ts, packages/core/src/api/getBlocksChangedByTransaction.ts, packages/core/src/editor/transformPasted.ts, packages/core/src/api/blockManipulation/commands/updateBlock/updateBlock.test.ts, packages/core/src/api/blockManipulation/tables/tables.test.ts |
Block-position lookup now throws when no block containers exist and preserves a matching position of zero. Content conversion checks for missing link items. Related array access and test fixture construction also change. |
Editor utilities and comment handling packages/core/src/comments/threadstore/TipTapThreadStore.ts, packages/react/src/components/Comments/ThreadsSidebar.tsx, packages/react/src/hooks/useStore.ts, packages/core/src/editor/managers/BlockManager.ts, packages/core/src/editor/managers/ExtensionManager/index.ts, packages/core/src/extensions/SideMenu/blockDropHandling.ts, packages/core/src/extensions/tiptap-extensions/Link/helpers/*, packages/core/src/extensions/tiptap-extensions/UniqueID/UniqueID.ts, packages/core/src/util/string.ts, packages/core/src/y/extensions/YCursorPlugin.ts, packages/core/src/yjs/extensions/YCursorPlugin.ts |
Comment insertion now checks for an empty thread, and thread sorting falls back to the thread creation time when there are no comments. Other helpers update array, property, and exponentiation operations. |
AI request construction packages/xl-ai/src/api/aiRequest/sendMessageWithAIRequest.ts, packages/xl-ai/src/api/aiRequest/sendMessageWithAIRequest.test.ts, packages/xl-ai/package.json |
AI request metadata and options are rebuilt with shallow spreads. Tests cover metadata replacement, option preservation, and omitted inputs. The package removes Lodash merge dependencies. |
Stream-tool schema comparison packages/xl-ai/src/streamTool/jsonSchema.ts, packages/xl-ai/src/streamTool/jsonSchema.test.ts |
Schema definitions use local recursive comparison for duplicate $defs keys. Tests cover equivalent and differing definitions, separate names, and empty definitions. |
AI tool and message access packages/xl-ai/src/api/formats/base-tools/createAddBlocksTool.ts, packages/xl-ai/src/components/FormattingToolbar/AIToolbarButton.tsx, packages/xl-ai/src/prosemirror/changeset.ts, packages/xl-ai-server/src/routes/mock.ts, packages/xl-ai-server/src/routes/serverPersistence.ts |
AI tool, toolbar, change-set, and server route code updates last-element access. Empty selection and missing last-element cases receive explicit checks. |
Priority:
Estimated code review effort: 3 (Moderate) | ~25 minutes
Change: Refactor
Possibly related PRs
- TypeCellOS/BlockNote#3118: This PR is the stated predecessor in the stack and changes package publication to ESM-only; this PR removes Lodash dependencies and updates the
packages/xl-aipackage metadata. - TypeCellOS/BlockNote#3236: Both PRs change the
ExtensionManagerreplacement path and its registration inputs.
Suggested reviewers: matthewlipski, yousefed
Merge Risk: 
Minimal · up to 4a4a1
-
No concrete issue in the supplied evidence currently blocks merging; complete the normal checks.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passed-
Full details: Title check
-
Explanation
The title "refactor: remove AI Lodash dependencies and simplify workspace code" matches the main change. The xl-ai package drops lodash.isequal and lodash.merge, and the diff includes several small cleanups that use Array.prototype.at(-1) and Object.hasOwn. The title is specific and concise, and it follows a conventional commit style. The title covers the primary change, although it does not mention the many small source cleanups in core and react.
Full details: Description check
-
Explanation
The description covers the summary, rationale-like context, changes, and testing. It states that the change removes Lodash equality and merge dependencies, replaces document snapshots and tool definitions, adds targeted AI regression tests, includes source cleanups, and reports verified builds and 12 targeted AI tests. It does not follow the template headings (Rationale, Impact, Screenshots/Video, Checklist, Additional Notes are missing). The Impact section and the checklist are not addressed. The description also references a stack of other PRs, which is useful context but not in the template.
-
-
Finishing Touches: 💡 1
-
📝 Generate docstrings: 💡
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
A rabbit checks each list with care,
Finds the last item waiting there.
Fresh tools hop in with schemas neat,
Old merge helpers leave their seat.
The editor nibbles changes sweet.
Comment @coderabbitai help to get the list of available commands.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
@blocknote/ariakit
@blocknote/code-block
@blocknote/core
@blocknote/diagram-block
@blocknote/mantine
@blocknote/math-block
@blocknote/react
@blocknote/server-util
@blocknote/shadcn
@blocknote/xl-ai
@blocknote/xl-docx-exporter
@blocknote/xl-email-exporter
@blocknote/xl-multi-column
@blocknote/xl-odt-exporter
@blocknote/xl-pdf-exporter
@blocknote/xl-typst-exporter
commit: |
|
bb54d74 to
4a4a165
Compare
Second PR in the stack: #3118 → this PR → core emoji data → React picker.
These changes were done by the e18e cli
Removes the direct Lodash equality and merge dependencies in the AI package. The request-composition change replaces document snapshots and tool definitions without recursive array merges. Includes targeted AI regression tests, the small source cleanups from #2903, and aligned Vitest workspace dependency metadata. Preserves the keyboard-shortcut fix already present on main.
Verified: core, React, and xl-ai builds; 12 targeted AI tests.
Original work: #2903.
Summary by CodeRabbit