Skip to content

Conversation

@jadeddelta
Copy link
Collaborator

@jadeddelta jadeddelta commented Jun 15, 2025

trials will now properly check if non-array parameters given are of the same type, throwing a warning if not in order to give more helpful message as opposed to some variation of some method being called on a mismatched type not existing. along with this, ParameterType.SELECT now properly checks if the value given is in the options field; plugin developers may now specify certain possible parameter values for a parameter removing the need for manual parameter input validation.

originally was going to be an error, but this would technically constitute as a breaking change and break some pre-existing setups (see: #3556). to prevent other experiments that import our stuff through unpkg, we'll just make a it a warn and target erroring on mismatch for v9.

@changeset-bot
Copy link

changeset-bot bot commented Jun 15, 2025

🦋 Changeset detected

Latest commit: 8ea4b0b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
jspsych Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@jadeddelta
Copy link
Collaborator Author

one thing that crossed my mind recently while reviewing this: would this constitute as a breaking change? seeing as though there might be certain fields (such as the ones in video-*-response that fail upon this. would it be better to rewrite this as a warn, and then say target v9 for having it error and be more strict?

also, learned about mocking warn to not display a
message when running the jest logs. should clean
up the logs for these tests, and an additional
test in Trial.spec.ts.
@jadeddelta jadeddelta merged commit 78840f5 into main Dec 14, 2025
2 checks passed
@jadeddelta jadeddelta deleted the parameter-type-error-handling branch December 14, 2025 17:05
@github-actions github-actions bot mentioned this pull request Dec 14, 2025
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.

3 participants