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

Remove deprecated features for version 8 #3166

Open
wants to merge 3 commits into
base: v8
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changeset/flat-tables-repair.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"jspsych": major
---

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.
2 changes: 1 addition & 1 deletion docs/overview/exclude-browser.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ As of v7.1 of jsPsych, the recommended way to do this is using the [browser-chec
This plugin can record many features of the participant's browser and exclude participants who do not meet a defined set of inclusion criteria.
Please see the [browser-check plugin documentation](../plugins/browser-check.md) for more details.

The prior approach of using the `exclusions` parameter in `initJsPsych()` is deprecated and will be removed in `v8.0`.
The prior approach of using the `exclusions` parameter in `initJsPsych()` is deprecated. It was removed as of `v8.0`.
You can find the documentation for it in the [7.0 docs](https://www.jspsych.org/7.0/overview/exclude-browser).
9 changes: 0 additions & 9 deletions docs/reference/jspsych.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ The settings object can contain several parameters. None of the parameters are r
| on_data_update | function | Function to execute every time data is stored using the `jsPsych.data.write` method. All plugins use this method to save data (via a call to `jsPsych.finishTrial`, so this function runs every time a plugin stores new data. |
| on_interaction_data_update | function | Function to execute every time a new interaction event occurs. Interaction events include clicking on a different window (blur), returning to the experiment window (focus), entering full screen mode (fullscreenenter), and exiting full screen mode (fullscreenexit). |
| on_close | function | Function to execute when the user leaves the page. Can be used, for example, to save data before the page is closed. |
| exclusions | object | Specifies restrictions on the browser the participant can use to complete the experiment. See list of options below. *This feature is deprecated as of v7.1 and will be removed in v8.0. The [browser-check plugin](../plugins/browser-check.md) is an improved way to handle exclusions.* |
| show_progress_bar | boolean | If `true`, then [a progress bar](../overview/progress-bar.md) is shown at the top of the page. Default is `false`. |
| message_progress_bar | string | Message to display next to the progress bar. The default is 'Completion Progress'. |
| auto_update_progress_bar | boolean | If true, then the progress bar at the top of the page will automatically update as every top-level timeline or trial is completed. |
Expand All @@ -36,14 +35,6 @@ The settings object can contain several parameters. None of the parameters are r
| case_sensitive_responses | boolean | If `true`, then jsPsych will make a distinction between uppercase and lowercase keys when evaluating keyboard responses, e.g. "A" (uppercase) will not be recognized as a valid response if the trial only accepts "a" (lowercase). If false, then jsPsych will not make a distinction between uppercase and lowercase keyboard responses, e.g. both "a" and "A" responses will be valid when the trial's key choice parameter is "a". Setting this parameter to false is useful if you want key responses to be treated the same way when CapsLock is turned on or the Shift key is held down. The default value is `false`. |
extensions | array | Array containing information about one or more jsPsych extensions that are used during the experiment. Each extension should be specified as an object with `type` (required), which is the name of the extension, and `params` (optional), which is an object containing any parameter-value pairs to be passed to the extension's `initialize` function. Default value is an empty array. |

Possible values for the exclusions parameter above.

| Parameter | Type | Description |
| ---------- | ------- | ---------------------------------------- |
| min_width | numeric | The minimum width of the browser window. If the width is below this value, a message will be displayed to the participant asking them to maximize their browser window. The experiment will sit on this page until the browser window is large enough. |
| min_height | numeric | Same as above, but with height. |
| audio | boolean | Set to true to require support for the WebAudio API (used by plugins that play audio files). |

### Return value

Returns a jsPsych instance, which all jsPsych methods on this page are called on. Therefore it is not possible to call any of the jsPsych methods listed on this page until this `initJsPsych` function is called and a jsPsych instance is created.
Expand Down
1 change: 0 additions & 1 deletion packages/jspsych/src/JsPsych.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ export class JsPsych {
on_interaction_data_update: () => {},
on_close: () => {},
use_webaudio: true,
exclusions: {},
show_progress_bar: false,
message_progress_bar: "Completion Progress",
auto_update_progress_bar: true,
Expand Down
32 changes: 0 additions & 32 deletions packages/jspsych/src/modules/plugin-api/HardwareAPI.ts

This file was deleted.

8 changes: 2 additions & 6 deletions packages/jspsych/src/modules/plugin-api/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import autoBind from "auto-bind";

import { JsPsych } from "../../JsPsych";
import { HardwareAPI } from "./HardwareAPI";
import { KeyboardListenerAPI } from "./KeyboardListenerAPI";
import { MediaAPI } from "./MediaAPI";
import { SimulationAPI } from "./SimulationAPI";
Expand All @@ -16,17 +15,14 @@ export function createJointPluginAPIObject(jsPsych: JsPsych) {
);
const timeoutAPI = new TimeoutAPI();
const mediaAPI = new MediaAPI(settings.use_webaudio);
const hardwareAPI = new HardwareAPI();
const simulationAPI = new SimulationAPI(
jsPsych.getDisplayContainerElement,
timeoutAPI.setTimeout.bind(timeoutAPI)
);
return Object.assign(
{},
...[keyboardListenerAPI, timeoutAPI, mediaAPI, hardwareAPI, simulationAPI].map((object) =>
autoBind(object)
)
) as KeyboardListenerAPI & TimeoutAPI & MediaAPI & HardwareAPI & SimulationAPI;
...[keyboardListenerAPI, timeoutAPI, mediaAPI, simulationAPI].map((object) => autoBind(object))
) as KeyboardListenerAPI & TimeoutAPI & MediaAPI & SimulationAPI;
}

export type PluginAPI = ReturnType<typeof createJointPluginAPIObject>;