Skip to content

Commit 36951d6

Browse files
nits
1 parent f9ec892 commit 36951d6

File tree

11 files changed

+17
-19
lines changed

11 files changed

+17
-19
lines changed

packages/uploadthing/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,9 @@
146146
},
147147
"scripts": {
148148
"lint": "eslint src test --max-warnings 0",
149-
"build": "NODE_OPTIONS='--max_old_space_size=8192' bunchee --tsconfig tsconfig.build.json && cp src/tw/v4.css tw/v4.css",
149+
"build": "NODE_OPTIONS='--max_old_space_size=16384' bunchee --tsconfig tsconfig.build.json && cp src/tw/v4.css tw/v4.css",
150150
"clean": "git clean -xdf client express fastify h3 internal next next-legacy server tw node_modules",
151-
"dev": "NODE_OPTIONS='--max_old_space_size=8192' bunchee --tsconfig tsconfig.build.json --no-clean && cp src/tw/v4.css tw/v4.css",
151+
"dev": "NODE_OPTIONS='--max_old_space_size=16384' bunchee --tsconfig tsconfig.build.json --no-clean && cp src/tw/v4.css tw/v4.css",
152152
"prepack": "bun ../../.github/replace-workspace-protocol.ts",
153153
"test": "vitest run",
154154
"typecheck": "tsc --noEmit"

packages/uploadthing/src/client-future.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ export const future_genUploader = <TRouter extends FileRouter>(
162162
const files = Arr.ensure(file ?? options.files);
163163
for (const file of files) {
164164
const upload = uploads.get(file);
165-
if (!upload) return;
165+
if (!upload) throw "No upload found";
166166

167167
if (upload.deferred.ac.signal.aborted === false) {
168168
// Ensure the upload is paused

packages/uploadthing/src/client.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import {
1414
} from "@uploadthing/shared";
1515

1616
import * as pkgJson from "../package.json";
17-
import * as Future from "./_internal/client-future";
1817
import type { Deferred } from "./_internal/deferred";
1918
import { createDeferred } from "./_internal/deferred";
2019
import { uploadFile, uploadFilesInternal } from "./_internal/upload-browser";
@@ -51,8 +50,6 @@ export {
5150
UploadPausedError,
5251
} from "@uploadthing/shared";
5352

54-
export { Future };
55-
5653
/**
5754
* Validate that a file is of a valid type given a route config
5855
* @public

packages/uploadthing/turbo.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"build": {
66
"outputs": [
77
"client/**",
8+
"client-future/**",
89
"dist/**",
910
"effect-platform/**",
1011
"express/**",

playground/app/api/uploadthing/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import { getSession } from "../../../lib/data";
1414
const fileRoute = createUploadthing();
1515

1616
export const uploadRouter = {
17-
anything: fileRoute({
17+
anyPrivate: fileRoute({
1818
blob: { maxFileSize: "256MB", maxFileCount: 10, acl: "private" },
1919
})
2020
.input(z.object({}))

playground/app/future/page.tsx

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,13 @@
22

33
import { useState } from "react";
44

5-
import { Future } from "uploadthing/client";
5+
import { AnyFile } from "uploadthing/client-future";
66

77
import { future_createUpload, future_uploadFiles } from "../../lib/uploadthing";
88
import { UploadRouter } from "../api/uploadthing/route";
99

1010
function AsyncUploader() {
11-
const [files, setFiles] = useState<
12-
Future.AnyFile<UploadRouter["anything"]>[]
13-
>([]);
11+
const [files, setFiles] = useState<AnyFile<UploadRouter["anyPrivate"]>[]>([]);
1412

1513
return (
1614
<div className="mx-auto max-w-2xl p-8">
@@ -20,7 +18,7 @@ function AsyncUploader() {
2018
const files = formData.getAll("files") as File[];
2119
console.log("SUBMITTED", files);
2220

23-
const result = await future_uploadFiles("anything", {
21+
const result = await future_uploadFiles("anyPrivate", {
2422
files,
2523
onEvent: (event) => {
2624
console.log("EVENT", event);
@@ -54,9 +52,7 @@ function AsyncUploader() {
5452
}
5553

5654
function ControlledUploader() {
57-
const [files, setFiles] = useState<
58-
Future.AnyFile<UploadRouter["anything"]>[]
59-
>([]);
55+
const [files, setFiles] = useState<AnyFile<UploadRouter["anyPrivate"]>[]>([]);
6056
const [selectedFiles, setSelectedFiles] = useState<File[]>([]);
6157
const [uploadControls, setUploadControls] = useState<Awaited<
6258
ReturnType<typeof future_createUpload>
@@ -76,7 +72,7 @@ function ControlledUploader() {
7672
setIsUploading(true);
7773

7874
// Create uploads for each file
79-
const controls = await future_createUpload("anything", {
75+
const controls = await future_createUpload("anyPrivate", {
8076
files: selectedFiles,
8177
onEvent: (event) => {
8278
console.log("EVENT", event);

playground/components/fieldset.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as React from "react";
2-
import cx from "clsx";
2+
import { cx } from "class-variance-authority";
33

44
export function Input({
55
className,

playground/components/file-card.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"use client";
22

33
import { useTransition } from "react";
4-
import cx from "clsx";
4+
import { cx } from "class-variance-authority";
55

66
import { deleteFile, getFileUrl } from "../lib/actions";
77
import { ListedFileInfo } from "../lib/data";

playground/components/skeleton.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import cx from "clsx";
1+
import { cx } from "class-variance-authority";
22

33
export function Skeleton({
44
className,

playground/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"@uploadthing/react": "workspace:*",
1313
"class-variance-authority": "0.7.1",
1414
"effect": "3.14.14",
15+
"lucide-react": "^0.469.0",
1516
"next": "canary",
1617
"react": "19.1.0",
1718
"react-dom": "19.1.0",

0 commit comments

Comments
 (0)