Skip to content

JS code quality, modernization for core modx and component classes#16967

Open
smg6511 wants to merge 7 commits into
modxcms:3.xfrom
smg6511:3.x-js-codequality-batch-2
Open

JS code quality, modernization for core modx and component classes#16967
smg6511 wants to merge 7 commits into
modxcms:3.xfrom
smg6511:3.x-js-codequality-batch-2

Conversation

@smg6511

@smg6511 smg6511 commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator

What changed and why

This is a formatting/style/syntax only set of changes to bring these JS classes up to par with coding standards and our linting rules. As with my previous merged update (#16963) a majority of lines changed are due to whitespace and comma placement changes.

I'm doing this ahead of working on a few issue-related PRs that touch these areas.

How to test

Navigate around the manager and view and edit various items; all should work as expected and throw no errors in the console. Requires a grunt/build if you are reviewing with compress_js on.

Related issue(s)/PR(s)

n/a

Compatibility notes

n/a

Breaking change assessment

None

Test coverage

While we don't have a mechanism to unit test our legacy ext js code, more sensitive changes like converting for-ins to forEach and re-organization/optimization of a couple methods were all manually tested to ensure correct scope and output was maintained.

To examine these changes more easily, take a look at the individual commits.

Contributors

n/a

AI tool use

None

smg6511 added 6 commits June 14, 2026 22:34
Spacing, comma/bracing positioning, etc.
Modernize/organize declarations, spell out some of the abbr names
Modernize concat and loop incrementing, use strict type comparisons, clarify some vars
- status method: Fix mistake in var order and remove IE8 compat condition.
- getStatusMarkup method: re-arrange to make more clear/readable
Modernize getURLParameters method, simplifying syntax while adding ability to capture array values
- Convert for / for-in loops to forEach where appropriate (scoping of this, verified);

- add method: Improvement of handler inclusion (organization, prioritizing the cases that happen more often toward the top of the conditions tree)
@smg6511 smg6511 requested review from Mark-H and opengeek as code owners June 16, 2026 15:20
@smg6511 smg6511 added the requires build Grunt build is required for integration label Jun 16, 2026
Added clarifying 2 comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

requires build Grunt build is required for integration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant