Roland
TTCTheo's Typesafe Cult
•Created by Roland on 3/17/2025 in #questions
´.heif` and `.heic` support
How can I handle ios images (
.heif
and .heic
) smoothly? I would prefer a comple client-side conversion and compression. Since these file formats are not supported on non-ios browsers, I must convert them.
Goal: User can upload these image formats, the browser converts them to .jpg
, then uploads the JPG-file.
I came across https://www.npmjs.com/package/heic2any and https://www.npmjs.com/package/libheif-js but I don't know if they really are the best choice.
Since this seems to be a surprisingly common problem (many people have iphones...), I wonder why there is no common standard?
FYI my frontend uses react-dropzone
and browser-image-compression
on the browser before uploading to UploadThing.2 replies
TTCTheo's Typesafe Cult
•Created by Roland on 1/31/2025 in #questions
Prevent router.refresh() from remounting client components
I have the following logic:
1) Fetch data in SSR layout, pass to Client Component
2) In Client Component,
useEffect(() => { ... }, []);
with empty dependencies for rendering only once upon component mount. This effect checks if the passed data from the layout is valid, if it isn't, make an API request with client-side infos (need to set cookies, save ip and guest session in database). If the API request succeeds, get valid data from SSR layout with router.refresh()
.
=> Expected behaviour: The useEffect only runs once.
=> Actual behaviour: The useEffect runs twice, because router.refresh() apparently completely remounts the client component. This leads to inconsistent data in my guest sessions.
Any suggestions? :)11 replies
TTCTheo's Typesafe Cult
•Created by Roland on 1/10/2025 in #questions
t3chat development
How many cumulative dev hours did this take to develop?
7 replies
TTCTheo's Typesafe Cult
•Created by Roland on 12/11/2024 in #questions
UploadThing: Image upload successful, but reaching neither onUploadError nor onUploadSuccess
This used to work for some time, but today it stopped working
5 replies