Only load display libary when necessary

Created on 23 October 2024, 23 days ago

Problem/Motivation

This module loads its responsive_table_display library on all non-admin pages. Given this code is completely unused if there isn't a table on the page, there might be an opportunity for a marginal performance boost by only loading when necessary.

Steps to reproduce

  1. Install and enable this module
  2. Visit a non-admin page without a table on it
  3. Inspect page source and see this module's JavaScript and CSS files have been loaded

Proposed resolution

Only load the library when a table is present on the page.

✨ Feature request
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States jkaeser

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

Comments & Activities

  • Issue created by @jkaeser
  • πŸ‡ΊπŸ‡ΈUnited States jkaeser

    Worth noting, I'm not sure how feasible this is. Currently, this module acts on any table that matches the configured selector, regardless of how that table was added (via CKEditor-equipped WYSIWYG, hardcoded in a template, etc.). I figured it's worth having an issue so we have some place to discuss, though.

Production build 0.71.5 2024