Refactor: Move element events entirely to JS

Created on 24 March 2023, over 1 year ago
Updated 9 June 2023, over 1 year ago

Problem/Motivation

Should we explore converting our reliance upon form api's '#ajax" to javascript methods? The end result might give a happier path for support / feature improvement as we wouldn't need to edit both php and javascript in order to establish / enable behaviors on our controls.

A concrete example of how this conversion could work can be seen in PreviewControlsForm::refereshCallback

on line 62 of PreviewControlsForm we wire the refresh button to the refreshCallback, but all the callback does is invoke the existing javascript method: refreshCallback

Why not have the entirety of the setup and usage of the method be in javascript?

Proposed resolution

Consider moving all JS-based event registration and logic to the JS side of things.

Remaining tasks

* Talk this over with Brian
* Move all the interaction events to JS, maybe it provides a vehicle to add more Drupal.Announce (specifically thinking about refresh)

🌱 Plan
Status

Postponed

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States cosmicdreams Minneapolis/St. Paul

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @cosmicdreams
  • Status changed to Postponed over 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States brianperry

    Postponing. We have moved more things into pure JS in 2.1, but also still rely on Drupal's ajax. Doubtful that we'd want to change that in 2.x.

Production build 0.71.5 2024