Skip to content

Loaders: Make return types in load() consistent.#33380

Merged
Mugen87 merged 1 commit intomrdoob:devfrom
Mugen87:dev1
Apr 14, 2026
Merged

Loaders: Make return types in load() consistent.#33380
Mugen87 merged 1 commit intomrdoob:devfrom
Mugen87:dev1

Conversation

@Mugen87
Copy link
Copy Markdown
Collaborator

@Mugen87 Mugen87 commented Apr 13, 2026

Fixed #10712.

Description

The PR makes the return types of load() in FileLoader and ImageBitmapLoader more consistent which solves the long-standing issue #10712. Both methods adhere now to the signature of Loader.load().

Because FileLoader does not rely on XMLHttpRequest anymore and abort() is implement, it's was much easier to implement a fix compared to nine years ago. The return value of load() is now independent of the cache state. This avoids an unreliable return value that could not be properly used in production anyway.

The PR also removes two return statements in ImageBitmapLoader which had no effect (they were located inside Promises and nowhere consumed).

@github-actions
Copy link
Copy Markdown

📦 Bundle size

Full ESM build, minified and gzipped.

Before After Diff
WebGL 361.21
85.78
361.21
85.78
+0 B
+0 B
WebGPU 637.48
177.06
637.48
177.06
+0 B
+0 B
WebGPU Nodes 635.59
176.76
635.59
176.76
+0 B
+0 B

🌳 Bundle size after tree-shaking

Minimal build including a renderer, camera, empty scene, and dependencies.

Before After Diff
WebGL 493.58
120.42
493.58
120.42
+0 B
+0 B
WebGPU 709.22
191.88
709.22
191.88
+0 B
+0 B
WebGPU Nodes 658.44
179.17
658.44
179.17
+0 B
+0 B

@Mugen87 Mugen87 merged commit 86bd3d5 into mrdoob:dev Apr 14, 2026
10 checks passed
@Mugen87 Mugen87 added this to the r184 milestone Apr 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inconsistent return value type from FileLoader.load()

1 participant