Skip to content

Replace jQuery 1 with jQuery 3 as global $#4333

Open
josemigallas wants to merge 6 commits into
masterfrom
THREESCALE-15320_replace_jquery_1_with_3
Open

Replace jQuery 1 with jQuery 3 as global $#4333
josemigallas wants to merge 6 commits into
masterfrom
THREESCALE-15320_replace_jquery_1_with_3

Conversation

@josemigallas

@josemigallas josemigallas commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

THREESCALE-15320: Replace jQuery 3 as default in admin portal

Since jQuery 3 is already shipped with rails, this migration renders webpack's jQuery redundant, so we're removing it too. Now there is only one and only jQuery available globally and that is the one provided by rails-jquery gem.

Spoiler alert: there are exceptions (but they are really minor).

This is the current state of jQuery:

Version Where Status
jQuery 1.8.0 Swagger UI v1 + v2 bundles Embedded, not actionable
jQuery 1.12.4 Colorbox (via vendor/colorbox.js) Encapsulated as window.colorbox
jQuery 1.12.4 Active Docs gem Isolated via ThreeScale.APIDocs.jQuery
jQuery 3.5.0 Developer Portal (cdn_asset) Provided by tenant templates
jQuery 3.7.0 Admin portal (sprockets global $) Done

Verification steps:

  1. Good luck!
  2. Every page depends in some way on jQuery but critical points/components are:
    • Modals
    • Fields definitions draggable
    • CMS (everything in CMS)
    • Dashboard graphics
    • Bulk actions (Applications, Accounts, etc)
    • Plans' features, limits, etc.
    • Cookies

So there is not really a way to absolutely 100% verify this, but if there was something wrong, admin portal would break in some way or another and it doesn't.

Compatibility-wise, the codebase is now 100% compatible with jQuery 3 as Claude looked up every single use of $/jQuery and updated the methods that were removed in v3.

@josemigallas
josemigallas requested a review from a team July 9, 2026 10:02
@josemigallas josemigallas self-assigned this Jul 9, 2026
@3scale 3scale deleted a comment from qltysh Bot Jul 14, 2026
@josemigallas
josemigallas force-pushed the THREESCALE-15320_replace_jquery_1_with_3 branch from 5337343 to b96b669 Compare July 14, 2026 10:45
@3scale 3scale deleted a comment from qltysh Bot Jul 15, 2026
@3scale 3scale deleted a comment from qltysh Bot Jul 15, 2026
@3scale 3scale deleted a comment from qltysh Bot Jul 15, 2026
@3scale 3scale deleted a comment from qltysh Bot Jul 15, 2026
@3scale 3scale deleted a comment from qltysh Bot Jul 15, 2026
@3scale 3scale deleted a comment from qltysh Bot Jul 15, 2026
@3scale 3scale deleted a comment from qltysh Bot Jul 15, 2026
@3scale 3scale deleted a comment from qltysh Bot Jul 15, 2026
@3scale 3scale deleted a comment from qltysh Bot Jul 15, 2026
@3scale 3scale deleted a comment from qltysh Bot Jul 15, 2026
@3scale 3scale deleted a comment from qltysh Bot Jul 15, 2026
@3scale 3scale deleted a comment from qltysh Bot Jul 15, 2026
@3scale 3scale deleted a comment from qltysh Bot Jul 15, 2026
@3scale 3scale deleted a comment from qltysh Bot Jul 15, 2026
@3scale 3scale deleted a comment from qltysh Bot Jul 15, 2026
@3scale 3scale deleted a comment from qltysh Bot Jul 15, 2026
@3scale 3scale deleted a comment from qltysh Bot Jul 15, 2026
@3scale 3scale deleted a comment from qltysh Bot Jul 15, 2026
@3scale 3scale deleted a comment from qltysh Bot Jul 15, 2026
@3scale 3scale deleted a comment from qltysh Bot Jul 15, 2026
@3scale 3scale deleted a comment from qltysh Bot Jul 15, 2026
@3scale 3scale deleted a comment from qltysh Bot Jul 15, 2026
@3scale 3scale deleted a comment from qltysh Bot Jul 15, 2026
@josemigallas
josemigallas force-pushed the THREESCALE-15320_replace_jquery_1_with_3 branch from 5dbdfd4 to b96b669 Compare July 16, 2026 06:48
@qltysh

qltysh Bot commented Jul 16, 2026

Copy link
Copy Markdown

❌ 3 blocking issues (5 total)

Tool Category Rule Count
eslint Lint 'a' is defined but never used. 1
eslint Lint Extra semicolon. 1
eslint Lint Variable 'a' should be initialized on declaration. 1
qlty Structure Function with many returns (count = 4): jQueryMock 1
qlty Structure Function with high complexity (count = 11): jQueryMock 1

Comment thread app/javascript/packs/bulk_operations.ts
Comment thread app/javascript/packs/bulk_operations.ts
Comment thread app/javascript/packs/cms.ts
Comment thread app/javascript/packs/cms.ts
Comment thread app/javascript/packs/cms.ts
Comment thread app/javascript/packs/cms.ts
Comment thread app/javascript/packs/cms.ts
Comment thread app/javascript/src/Common/application.ts
Comment thread app/javascript/src/Common/components/BulkActionsDropdown.tsx
}

if (el) cache.set(el, instance)
return instance

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found 2 issues:

1. Function with many returns (count = 4): jQueryMock [qlty:return-statements]


2. Function with high complexity (count = 11): jQueryMock [qlty:function-complexity]

period: number; // In days
}

const a;
period: number; // In days
}

const a;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found 3 issues:

1. 'a' is defined but never used. [eslint:@typescript-eslint/no-unused-vars]


2. Extra semicolon. [eslint:@typescript-eslint/semi]


3. Variable 'a' should be initialized on declaration. [eslint:@typescript-eslint/init-declarations]

Suggested change
const a;
const a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant