jsPsych/packages/jspsych/CHANGELOG.md
2024-08-08 15:10:26 +00:00

23 KiB

jspsych

8.0.2

Patch Changes

8.0.1

Patch Changes

  • #3352 07835730 Thanks @Bankminer78! - ExtensionManager correctly uses extension instantiation data to produce version and type, and warns users if fields are missing.

8.0.0

Major Changes

  • #2858 b8001735 Thanks @bjoluc! - Rewrite jsPsych's core logic. The following breaking changes have been made:

    Timeline Events

    • conditional_function is no longer executed on every iteration of a looping timeline, but only once before running the first trial of the timeline. If you rely on the old behavior, move your conditional_function into a nested timeline instead.
    • on_timeline_start and on_timeline_finish are no longer invoked in every repetition of a timeline, but only at the beginning or at the end of the timeline, respectively. If you rely on the old behavior, move the on_timeline_start and on_timeline_finish callbacks into a nested timeline.

    Timeline Variables

    • The functionality of jsPsych.timelineVariable() has been explicitly split into two functions, jsPsych.timelineVariable() and jsPsych.evaluateTimelineVariable(). Use jsPsych.timelineVariable() to create a timeline variable placeholder and jsPsych.evaluateTimelineVariable() to retrieve a given timeline variable's current value.
    • jsPsych.evaluateTimelineVariable() now throws an error if a variable is not found.
    • jsPsych.getAllTimelineVariables() has been replaced by a trial-level save_timeline_variables parameter that can be used to include all or some timeline variables in a trial's result data.

    Parameter Handling

    • JsPsych will now throw an error when a non-array value is used for a trial parameter marked as array: true in the plugin's info object.
    • Parameter functions and timeline variables are no longer automatically evaluated recursively throughout the whole trial object, but only for the parameters that a plugin specifies in its info object. Parameter functions and timeline variables in nested objects are only evaluated if the nested object's parameters are explicitly specified using the nested property in the parameter description.

    Progress Bar

    • jsPsych.setProgressBar(x) has been replaced by jsPsych.progressBar.progress = x
    • jsPsych.getProgressBarCompleted() has been replaced by jsPsych.progressBar.progress
    • The automatic progress bar updates after every trial now, including trials in nested timelines.

    Data Handling

    • Timeline nodes no longer have IDs. As a consequence, the internal_node_id trial result property and jsPsych.data.getDataByTimelineNode() have been removed.
    • Unlike previously, the save_trial_parameters parameter can only be used to remove parameters that are specified in the plugin's info object. Other result properties will be left untouched.

    Miscellaneous Changes

    • jsPsych.endExperiment() and jsPsych.endCurrentTimeline() have been renamed to jsPsych.abortExperiment() and jsPsych.abortCurrentTimeline(), respectively.
    • JsPsych now internally relies on the JavaScript event loop. This means automated tests have to await utility functions like pressKey() to process the event loop.
    • The jspsych package no longer exports universalPluginParameters and the UniversalPluginParameters type.
    • Interaction listeners are now removed when the experiment ends.
  • #3166 ce4333cc Thanks @jodeleeuw! - Removed the exclusions option from initJsPsych(). The recommended replacement for this functionality is the browser-check plugin.

    Removed the hardwareAPI module from the pluginAPI. This was no longer being updated and the features were out of date.

  • #3031 f9eb17c3 Thanks @jodeleeuw! - Changed the behavior of DataColumn.mean() to exclude null and undefined values from the calculation, as suggested in #2905

  • #3342 6717e00c Thanks @Bankminer78! - Changed plugins to use AudioPlayer class; added tests using AudioPlayer mock; plugins now use AudioPlayerInterface.

  • #3162 3f359e55 Thanks @jodeleeuw! - Removed max-width: 95% CSS rule on the .jspsych-content <div>. This rule existed to address an old IE bug with flex layouts.

  • #3339 74b4adc7 Thanks @jodeleeuw! - finishTrial() now clears the display and any timeouts set with pluginApi.setTimeout()

Minor Changes

  • #3168 7b1ae24f Thanks @jodeleeuw! - Added jsPsych.abortTimelineByName(). This allows for aborting a specific active timeline by its name property. The name can be set in the description of the timline.

  • #3326 c5a0dbb1 Thanks @vzhang03! - Updated all plugins to implement new pluginInfo standard that contains version, data generated and new documentation style to match migration of docs to be integrated with the code and packages themselves"

  • #3167 6f9d01b2 Thanks @jodeleeuw! - Added record_data as a parameter available for any trial. Setting record_data: false will prevent data from being stored in the jsPsych data object for that trial.

  • #3182 3855b5d8 Thanks @bjoluc! - Allow trial on_finish methods to be asynchronous, i.e. return a Promise. Prior to this, promises returned by on_finish were not awaited before proceeding with the next trial.

  • #3201 be7df303 Thanks @Shaobin-Jiang! - Allow message_progress_bar to be a function

Patch Changes

  • #3338 7a4a4b83 Thanks @jodeleeuw! - getKeyboardResponse now returns the key in the original case (e.g., "Enter" instead of "enter") for easier matching to standard key event documentation.

  • #3152 2852cda6 Thanks @jodeleeuw! - Button plugins now support either display: grid or display: flex on the container element that hold the buttons. If the layout is grid, the number of rows and/or columns can be specified. The margin_horizontal and margin_vertical parameters have been removed from the button plugins. If you need control over the button CSS, you can add inline style to the button element using the button_html parameter.

    jspsych.css has new layout classes to support this feature.

  • #3242 6aea52c3 Thanks @Shaobin-Jiang! - Fix typo in randomInt error message

7.3.4

Patch Changes

  • #3184 9acfa29c Thanks @bjoluc! - Point to source maps via canonical unpkg URLs in NPM-published browser builds. This prevents 404 errors when using redirecting CDN URLs (as described in #3043).

7.3.3

Patch Changes

  • #3039 852d5745 Thanks @jodeleeuw! - Fixed how simulation mode handles setTimeout calls to ensure that timeouts are cleared at the end of a trial, even in cases where the user interacts with a simulated trial when the simulation is being run in visual mode.
  • #3039 612d9e12 Thanks @jodeleeuw! - Fixed issue where a trial's on_load was not called when using simulation mode but setting a trial's simulate option to false.
  • #3039 481efec0 Thanks @jodeleeuw! - Fix target of simulation dispatchEvent so that simulation mode works with custom display_element

7.3.2

Patch Changes

  • #2974 13243618 Thanks @jodeleeuw! - This fixes an issue when a plugin has a COMPLEX parameter and there is a default value specified at the root level of the parameter, rather than for each individual nested parameter (#2972).

7.3.1

Patch Changes

  • #2754 6bf9ea97 Thanks @javidalpe! - Fix preload plugin onerror callback so that it returns proper src information when there are 404 errors.
  • #2811 28136787 Thanks @jodeleeuw! - Fixed a bug in randomization.shuffleNoRepeats() where having an equalityFunction that used a logical OR could result in some neighboring elements still evaluating to true via equalityFunction.

7.3.0

Minor Changes

Patch Changes

  • #2683 0d2808f6 Thanks @jodeleeuw! - jsPsych.timelineVariable() will now produce a console.warn() when the timeline variable does not exist.

7.2.3

Patch Changes

  • #2643 dc005661 Thanks @bjoluc! - Include previously undefined regeneratorRuntime in the Babel build of the jspsych package

7.2.2

Patch Changes

  • #2632 a17f423f Thanks @bjoluc! - Improve browser compatibility when loading via unpkg.com, i.e. when using the dist/index.browser.min.js build artifact.

7.2.1

Patch Changes

  • #2540 48b83652 Thanks @bjoluc! - Fix a ReferenceError ("require$0 is not defined") related to the new seedable random number generator

7.2.0

Minor Changes

  • #2407 cafc6a1f Thanks @jodeleeuw! - Added filterColumns() to the DataCollection class. This function lets users select a subset of the columns in the DataCollection. It is the opposite of the ignore() method.
  • #2379 9a28fb08 Thanks @jodeleeuw! - Added setSeed() to jsPsych.randomization to allow for seeding the random number generator and generating predictable sequences of random numbers.

Patch Changes

  • #2539 49d69075 Thanks @jodeleeuw! - Fixed an issue where the post_trial_gap was still run in realtime during data-only simulation mode. The gap is now skipped as intended.
  • #2504 60f4d868 Thanks @bjoluc! - Inline Open Sans web font in jspsych.css to be GDPR-compliant (see #2153)

7.1.2

Patch Changes

  • #2380 5159e0eb Thanks @jodeleeuw! - Fixed the case where simulation_options is a function that returns a string for looking up corresponding options in the simulate settings.

7.1.1

Patch Changes

  • #2376 01f8a373 Thanks @jodeleeuw! - Fixed the default case for jsPsych.simulate() when no simulation_mode is specified. Now properly runs in data-only mode.

7.1.0

Minor Changes

  • #2350 c81b5007 Thanks @jodeleeuw! - Added microphone related features to the pluginAPI module: initializeMicrophoneRecorder() and getMicrophoneRecorder(). These allow sharing of the MediaRecorder object attached to the microphone's MediaStream across trials.
  • #2245 1216ace2 Thanks @bjoluc! - Throw errors if trial type parameters are strings, deprecated jsPsych functions are called, or the global jsPsych variable is used without assigning a JsPsych instance first (#2217)
  • #2287 522aa2cd Thanks @jodeleeuw! - Added randomInt(lower, upper), sampleBernoulli(p), sampleNormal(mean, std), sampleExponential(rate), and sampleExGaussian(mean, std, rate, positive=false) to jsPsych.randomization.
  • #2287 522aa2cd Thanks @jodeleeuw! - Added the ability to run the experiment in simulation mode using jsPsych.simulate(). See the simulation mode documentation for information about how to get started.
  • #2287 522aa2cd Thanks @jodeleeuw! - Added methods to assist with simulation (e.g., pressKey for dispatching a keyboard event and clickTarget for dispatching a click event) to the PluginAPI module.
  • #2209 45fb3ebb Thanks @jodeleeuw! - jsPsych.endExperiment() has a new, optional second parameter for saving data. Passing in an object of key-value pairs will store the pairs in the data for the final trial of the experiment.
  • #2287 522aa2cd Thanks @jodeleeuw! - Added several functions to the pluginAPI module in order to support the new simulation feature.

Patch Changes

  • #2287 522aa2cd Thanks @jodeleeuw! - The weights argument for randomization.sampleWithReplacement() is now explicitly marked as optional in TypeScript. This has no impact on usage, as the implementation was already treating this argument as optional.

7.0.0

Major Changes

  • #2183 c8760b1 Thanks @jodeleeuw, @becky-gilbert, @bjoluc! - jsPsych is now fully modular, with individual NPM packages for the core library, plugins, and extensions.

    To support this change, we've made a number of breaking changes. We've added a guide for migrating from version 6.x to 7.x to the documentation, and updated the hello world tutorial with instructions for configuring jsPsych in three different ways. In addition to enabling package management, some of the benefits that this change provides include an improved developer experience with IntelliSense code hints, proper encapsulation of jsPsych so that multiple instances can be run on the same page, and easier integration with modern JavaScript tools like bundlers.

  • #2130 2802430 Thanks @jodeleeuw! - Added the option for plugins to return a Promise and delay the execution of the on_load event handler for the trial until the plugin manually invokes it. This allows for plugins that have asynchronous components to finish loading before triggering the on_load event. Added this functionality to all plugins that currently require it.
  • #2100 b0d77e7 Thanks @jodeleeuw! - Renamed all getter-type functions to have get prefix to make it clearer what the role of these functions are. The following were affected:
    • currentTimelineNodeID -> getCurrentTimelineNodeID
    • progress -> getProgress
    • startTime -> getStartTime
    • totalTime -> getTotalTime
    • currentTrial -> getCurrentTrial
    • initSettings -> getInitSettings
    • allTimelineVariables -> getAllTimelineVariables

Minor Changes

  • #2142 12d6753 Thanks @jodeleeuw! - When jsPsych.endExperiment is called it provides the option of displaying a message on the screen. If the on_finish event handler in initJsPsych() returns a Promise then the message will now display only after the promise has resolved.
  • #2129 f37f64a Thanks @jodeleeuw! - All duration measurements, including response times, are now rounded to the nearest millisecond. We changed this because the precision that performance.now() generates is misleading in this context and removing the (often very long) decimal component of the measurement will save space in the data files.
  • #2121 03517a0 Thanks @zimmerrol! - Updated turk.submitToTurk() to use POST instead of GET to avoid errors where too much data is transmitted.