Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[p5.js 2.0] IO refactoring #7365

Open
wants to merge 12 commits into
base: dev-2.0
Choose a base branch
from

Conversation

limzykenneth
Copy link
Member

Starting a rewrite of the IO functions starting with the loading functions and will move to the saving functions later.

The main goal is to utilize promises and the fetch API as much as possible while exposing a reasonable public interface for the user. The overloads will also be simplified in favor of defaults and for more advanced users who wishes for more customized functionalities to pass in Request object instead.

Implementation of p5.Table is very broken and loadTable was also very broken.
This commit does not fix the implementation fully as it still need to be
decided whether p5.Table is to be retained.

The fact that no one has noticed p5.Table and loadTable is so broken might
be a good reason to not retain them as no one is using them.
@limzykenneth limzykenneth marked this pull request as ready for review November 11, 2024 15:35
@davepagurek
Copy link
Contributor

Nice work, the loading implementations look clean! Using the worker to mock responses in tests is a cool approach.

@limzykenneth
Copy link
Member Author

@davepagurek Yeah, that gives us more flexibility but for now is mainly to solve vitest itself not able to respond with 404 properly. I'm not doing too much test fixing just yet though, for now want to refactor the new implementation and maybe look into the file saving aspect. Tests I'll do after this.

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.

2 participants