Update SurveyJS version
Fixes #3549
This PR makes the following updates to the jsPsych survey plugin:
- Updates the
survey-coreversion from 1.9.138 to 2.2.0 - Changes the SurveyJS UI package from
survey-knockout-ui(removed in SurveyJS v2) tosurvey-js-ui - Makes SurveyJS v1 -> v2 code migration changes:
- CSS file name changed to "survey-core/survey-core.min.css"
SurveyJS.Surveyfromsurvey-knockout-uipackage is replaced withModelfromsurvey-core
- Adds a minified version of the survey.css file to the build output and loads it in the plugin example files
- In the docs and example files, updates the
button_htmlparameter value from a string to a function (for button-response v2 migration) - Hides a rollup build warning due to the use of top-level
thisby SurveyJS - Adds a
resizeObservermock to fix broken tests
To do
- Fix broken example "dynamically_generating_content.html" (I'm not sure yet why this is broken)
- Update docs and add example for the new slider scale feature (requested in #3549)
- Figure out what all of the researcher-facing changes are and add them to the changeset and docs.
Question
Should this be a major or minor bump? I went with minor due to the availability of new features, such as the slider scale. There have been breaking changes as part of the SurveyJS v1 -> v2 update, but I'm not sure yet if there are any breaking changes for jsPsych users (vs developers).
đĻ Changeset detected
Latest commit: 2bdc6b8969f3b27994bef30e318a03691f975074
The changes in this PR will be included in the next version bump.
This PR includes changesets to release 1 package
| Name | Type |
|---|---|
| @jspsych/plugin-survey | Major |
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
Is there anything else we can do to help this get merged?
@DominiqueMakowski Sorry that this is taking so long âšī¸ I'm debugging a problem with multiple survey trials that was caused by this update. What's happening is that, when the experiment has a survey trial that repeats with timeline variables, it is breaking on the second survey trial (nothing appears on the page and there are no errors). I checked that it is possible to run multiple survey trials in the same experiment with this updated version, as long as they are sufficiently different. The rendering only breaks on the second trial when it is very similar in structure to the first (e.g. when using a repeated JSON structure and different text values). My best guess is that SurveyJS is deciding it doesn't need to render the survey again because of state/caching issues. I hope that I'm on the right track with debugging this. I would love to hear other thoughts/suggestions!
calling super-@Max-Lovell maybehe has an idea
Do you have a minimal example to reproduce the issue?
Oh I think I just figured it out. It works when I create a new div element for the survey to render into. It seems like SurveyJS doesn't like rendering into the same DOM container again (at least when the survey content is too similar..? I don't know). Anyway I will clean this up and push the update here ASAP.
And in case Max or anyone else wants to have a look - the reproducible example is "dynamically_generating_content.html" from the plugin examples folder. Also, the "jspsych-survey-demo6.html" example from docs/demos is a counter-example showing that this updated version can sometimes render multiple survey trials on the same page (I assume this example works because the JSON structures are different enough across trials, but I'm not totally sure).
@jodeleeuw @cherriechang I'm updating the docs for this survey plugin release. Should I update the unpkg version numbers in the docs in this same PR, so that the links are correct after the PR is merged? Or should I wait and do this after the release? Or do all of the docs changes go in a separate PR that targets gh-pages? I can't remember how this works âšī¸
The version numbers will auto-update in the docs when the docs are built and released đ
The version numbers will auto-update in the docs when the docs are built and released đ
Woo!!
I think this is ready for review. The only caveat is that we might want to add the new minified version survey.css file to the dist archive in the config package. I think that the config update would have to go through before this is package is released. Or if that's an issue, we can leave survey.min.css out of the dist archive for now.
I also switched to survey.min.css in the unpkg links, but I don't think there's any additional config changes needed for that file to show up on unpkg right?
The PR for changes to the config package to add the survey.min.css file to the dist archive is here: #3561
Sorry to ask but is there a rough ETA to get this merged assuming there are no issues? (to give a timeline to my students)
Sorry to ask but is there a rough ETA to get this merged assuming there are no issues? (to give a timeline to my students)
Tagging @jspsych/core as I think I need at least one approving review to merge.
@DominiqueMakowski this should be released now. Thanks for the nudge đ
Thanks a ton @jodeleeuw đ really appreciated đ
Thanks @jodeleeuw!
@DominiqueMakowski I'd love to hear how this version is working for you. Please write up any issues. I was planning on adding markdown support to this plugin in the near future, so if you notice any issues then I can fix them at the same time.