Skip to content

FE - Preload event definitions

Background

We need to make sure to preload definitions before using their data to dispatch events. This process is trivial in the backend but tricky on the frontend, as we don't have direct access to the filesystem.

Proposal

  • Maintain a manifest with the events keys (basename) as keys and the file paths as values. So we can both determine if a definition exists and get its data afterward from the path.
  • Preload data-attributes-based events automatically when adding event listeners.
  • Add a property/method to define definitions to preload from Vue.
  • Make sure to flush the definition-based events queue after preloading.
  • Move the testing data to a mock_data.js file.

Testing

Update related tests and make sure QA pipeline is passing.

Edited by Carlo Catimbang