Skip to content

Conversation

@Hugo-RM
Copy link

@Hugo-RM Hugo-RM commented Nov 3, 2025

Fixes #3647

Changes:

  • Adds URL parser to allow p5.js version to be configured from URL.
  • Includes URL parser test file to test edge cases and fallback response.

(Potential future extensions)

I have verified that this pull request:

  • has no linting errors (npm run lint)
  • has no test errors (npm run test)
  • is from a uniquely-named feature branch and is up to date with the develop branch.
  • is descriptively named and links to an issue number, i.e. Fixes #123
  • meets the standards outlined in the accessibility guidelines

Hugo-RM and others added 5 commits November 3, 2025 05:50
Helper functions will ensure URL parameters are
normalized before being used.
I have added a test file for the URL parameter parsing utility located at client/utils/parseURLParams.js. This test file includes various test cases to ensure the correct functionality of the parseURLParams function, covering edge cases and typical usage scenarios. For the add-on flags I allowed 'on', 'true', '1', 'ON', 'True', and 'TRUE' to be interpreted as true, while 'off', 'false', '0', 'OFF', 'False', and 'FALSE' are interpreted as false. This should enhance the robustness of the URL parameter parsing in our application.
Convert defaultHTML from a constant string to a function that accepts
an options object for version and add-on library configuration. This
enables URL parameter parsing for library selection.

Maintains backward compatibility - calling defaultHTML() with no
arguments produces the same output as before.
Add validation functions to ensure URL parameters for p5.js versioning
is correctly parsed and handled. Falls back to default functionality
for invalid/missing parameters.

Use npx prettier --write to format all modified files.

Change test fallbacks to be consistent with default behavior.

Add URL parser to client/modules/IDE/reducers/file.js

Co-authored-by: Oscar Bedolla <GoodKimchi@users.noreply.github.com>
Co-authored-by: Enoch Owoade <enochowoade@gmail.com>
@welcome
Copy link

welcome bot commented Nov 3, 2025

🎉 Thanks for opening this pull request! Please check out our contributing guidelines if you haven't already.

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.

Enable URL parsing of p5.js version

3 participants