processing / processing/p5.js

change load order preload method

Open
#3,536 6 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Area:Core Feature Request p5.js 2.0+
Dominant language
JavaScript
Stars
24k
Forks
3.8k
Avg merge
3d 16h
Merged PRs (30d)
25

Description

This feature request is based on the discussion in #3347.

Essentially some users may want a p5 sketch to load first when used as an element on a page with a high number of external assets. @calebegg proposed that this could be achieved by initializing p5 with the DOMContentLoaded event rather than the load event which is the current default.

Here is a visual explanation of the difference between the two events..

What do people think about this as a feature?

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 discussion #3347 and inspect src/core/init.js, especially the current load-event initialization. First clarify whether DOMContentLoaded should replace the current default or be configurable, then define the expected behavior for sketches embedded alongside external assets. Done requires an agreed feature scope and verification of the resulting preload order.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.