Skip to content
This repository has been archived by the owner on Feb 24, 2022. It is now read-only.

[WIP] Generate playtest data collection add-on #10

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

hamilton
Copy link
Contributor

@hamilton hamilton commented Apr 26, 2021

closes #11, closes #12, closes #13, closes #28, closes #27, closes #26

Remaining tasks:

This PR overhauls the playtest – there's a lot here. It basically became a framework that has solutions for the various dev challenges I've encountered making my own study pototypes.

The idea: create a framework that makes it much easier to collect data through small, easy-to-use modules for playtesting. A module defines a.) a collector (a content script that collects the data), b.) a reporter (a background script that exposes the collection as it happens to the main backgorund script), and c.) a config entry that defines which modules will be active for this build. The config file that defines these things gets rolled up and outputs a functioning study that collects data and stoers it in a namespaced IndexedDB table, which you can manage in the options page. See bottom of this comment for a screenshot of the page.

More information about the components:

  1. collectors – these content scripts are responsible for collecting data from a page. The Collector class makes it easy to hook into the PageManager events and respond accordingly. It also has a basic state management method that is more functional, leveraging immer.js's produce function to create new proxied deep copies of the state.
  2. reporters – background script modules that listen for new messages from collectors. Their only requirement is exposing an addListener function. The Reporter class makes it easy to pair with a collector & define the schema, but it is not strictly necessary to even use the class.
  3. app.config.js – defines what data collections we want the system to use. It looks for a module's source (*.collector.js and *.reporter.js if these scripts exist) and handles all the rollup stuff needed to turn the modules * config into a working playtest study.
  4. rollup – handles the framework's modules and outputs a functioning, multi-module "study" style extension with additional data management.
  5. storage – data collected by the collectors/reporters makes its way into a namespaced table in the extension's IndexedDB.
  6. options page – enables management of the data collected locally in this playtest.

This framework should enable us to flexibly try out new data collection modules pretty quickly.

Screen Shot 2021-04-26 at 10 25 32 AM

@hamilton hamilton changed the title [WIP] Complete reworking of the playtest prototype for arbitrary data collection modules [WIP] Generate playtest data collection add-on Apr 27, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
1 participant