playcanvas / playcanvas/engine

Should AssetRegistery#add also load assets if marked as preload?

Open
#3,107 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

docs
Dominant language
JavaScript
Stars
16.8k
Forks
2k
Avg merge
4h 32m
Merged PRs (30d)
222

Description

https://github.com/playcanvas/engine/blob/main/src/framework/asset/asset-registry.js#L244

This means that on the launch of an application, when the assets are added via Application#configure (using _parseAssets), they are already loading despite Applications#preload not being called yet.

Preload function doesn't actually start any loading in our case, just sets up the events.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read src/framework/asset/asset-registry.js around AssetRegistry#add, then trace Application#configure, _parseAssets, and preload in src/framework/application.js. Confirm when assets marked for preload begin loading and whether add or preload should own that behavior; done means the loading timing is intentional and covered by the relevant behavior checks.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
game-dev, web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.