fix: File upload example (BLO-1311) - #2996
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughChangesThe PR replaces tmpfiles.org uploads with BlockNote’s development-only helper. The helper returns base64 data URLs. Examples, documentation, the Uppy panel, exports, and tests now use the local upload flow. Local data URL uploads
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to This PR updates file-upload examples and helper usage to use base64 URLs; no actionable merge-blocking risk remains beyond normal checks and review. Sequence Diagram(s)sequenceDiagram
participant Uppy
participant uploadFile_DEV_ONLY
participant BlockNoteEditor
Uppy->>uploadFile_DEV_ONLY: Process each successful file
uploadFile_DEV_ONLY-->>Uppy: Return base64 data URL
Uppy->>BlockNoteEditor: Update block with file name and data URL
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
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. Comment |
nperez0111
left a comment
There was a problem hiding this comment.
Can we change it from being exported? Otherwise fine to move off the actual upload path
| @@ -1,3 +1,5 @@ | |||
| import { uploadFile_DEV_ONLY } from "@blocknote/core"; | |||
There was a problem hiding this comment.
I wouldn't really want this exported, I get that it is a shared util, but not one that needs to be actually packaged. Just copy-paste in the places that need it
| export * from "./Code/helpers/toExternalHTML/createPreCode.js"; | ||
| export * from "./ToggleWrapper/createToggleWrapper.js"; | ||
| export * from "./File/helpers/uploadToTmpFilesDotOrg_DEV_ONLY.js"; | ||
| export * from "./File/helpers/uploadFile_DEV_ONLY.js"; |
There was a problem hiding this comment.
oh we had this exported before? That is strange to me
There was a problem hiding this comment.
Should I still remove the export then? Or keep as it was?
@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
commit: |
|
Summary
This PR fixes the file upload example and related file upload code as tmpfiles changed their API and it no longer works for our use. To prevent issues like that happening in the future, we now just save the file as a base64 URL.
Closes @2967
Rationale
The example is broken.
Changes
uploadFilesToTmpFilesDotOrg_DEV_ONLYtouploadFile_DEV_ONLY.Impact
N/A
Testing
N/A - TODO?
Screenshots/Video
N/A
Checklist
Additional Notes
N/A
Summary by CodeRabbit
New Features
Documentation
Bug Fixes