Update several Spina-related attributes to be static in prep for Spina 2.

Review Request #12903 — Created March 21, 2023 and submitted

Information

Review Board
release-6.x

Reviewers

The new Spina-based classes recently introduced made use of a nice
feature we had in Spina 1 where you could reference private methods or
include inline functions in event handlers.

Unfortunately, this was only allowed because these mappings were being
rebuilt for every single instance of every class. Plus, they weren't
accessible outside of those classes, meaning other subclasses couldn't
merge them in.

Spina 2 will be addressing the access/merging limitation by expecting
each of these to be static. Unfortunately, that means we can no longer
specify private methods or inline functions. Instead, we need to revert
back to the earlier approach of passing in strings representing function
names.

This change prepares for that by changing #functions to
private _functions(), and specifying them in the maps. It also
converts some templates that were defined as instance variables to be
static.

The event mappings and some other state will be made static in the
upcoming move to Spina 2.

All unit tests pass.

Also tested along with upcoming changes for Spina 2.

Audited all TypeScript in the codebase, making sure there weren't any
classes remaining that needed to be updated, both for this change and
the final move to static.

Summary ID
Update several Spina-related attributes to be static in prep for Spina 2.
The new Spina-based classes recently introduced made use of a nice feature we had in Spina 1 where you could reference private methods or include inline functions in event handlers. Unfortunately, this was only allowed because these mappings were being rebuilt for every single instance of every class. Plus, they weren't accessible outside of those classes, meaning other subclasses couldn't merge them in. Spina 2 will be addressing the access/merging limitation by expecting each of these to be static. Unfortunately, that means we can no longer specify private methods or inline functions. Instead, we need to revert back to the earlier approach of passing in strings representing function names. This change prepares for that by changing `#functions` to `private _functions()`, and specifying them in the maps. It also converts some templates that were defined as instance variables to be static. The event mappings and some other state will be made static in the upcoming move to Spina 2.
6de5e9704452ba4b059139b774a7cb851c905c68
Description From Last Updated

I feel like when we have only one argument and no return value that this can all go on one …

daviddavid
david
  1. 
      
  2. Show all issues

    I feel like when we have only one argument and no return value that this can all go on one line.

  3. 
      
chipx86
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-6.x (b536931)
Loading...