Skip to content

Created a loading indicator when the canvas is being set up#8997

Open
Jextic wants to merge 3 commits into
processing:mainfrom
Jextic:issue-8922
Open

Created a loading indicator when the canvas is being set up#8997
Jextic wants to merge 3 commits into
processing:mainfrom
Jextic:issue-8922

Conversation

@Jextic

@Jextic Jextic commented Jul 21, 2026

Copy link
Copy Markdown

Resolves #8922

Changes:

  • Created loading.js file in p5.js/src/core. loading.js handles the logic for creating a loading indicator when the canvas is being set up. When showLoadingIndicator() is called, a div element with a "Loading..." text will be created. When hideLoadingIndicator() is called, the div element will be removed from the DOM.
  • Modified main.js so that showLoadingIndicator() and hideLoadingIndicator() are called before and after await context.setup(). The loading indicators will only appear while the canvas is loading the setup() function in sketch.js.
  • Created a loading.js unit test file in p5.js/test/unit/core. The test is was created based on the sample code from issue [p5.js 2.0+ Bug Report]: Loading indication #8922 to see if the loading indicator works as intended.

Screenshots of the change:

image image

All tests, including loading.js, pass. The only exception is a typography which always failed, even before changes were made to the project.

PR Checklist

Also worked with @joshin on this issue.

@ksen0

ksen0 commented Jul 21, 2026

Copy link
Copy Markdown
Member

Hi @Jextic thanks for putting this together and sorry for the long time to get to your comment, but please check the comment on the issue. If possible, to keep (1) non text based and (2) decoupled. I will be able to review this more deeply next week as well. Thanks for your work on this!

@p5-bot

p5-bot Bot commented Jul 21, 2026

Copy link
Copy Markdown

Continuous Release

CDN link

Published Packages

Commit hash: a14c933

Previous deployments

This is an automated message.

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.

[p5.js 2.0+ Bug Report]: Loading indication

2 participants