-
Notifications
You must be signed in to change notification settings - Fork 2.9k
[#65618] Remove jQuery from core #19429
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
28d3b33 to
dabe404
Compare
8ecb545 to
c7be23c
Compare
dabe404 to
12c2e01
Compare
8c63a12 to
5d26905
Compare
af9f3f5 to
84518cd
Compare
c7be23c to
c0ad5e2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR removes jQuery dependencies from the OpenProject core codebase, replacing jQuery APIs with native DOM APIs and modern JavaScript/TypeScript alternatives. The changes include migrating event listeners, DOM manipulation, element selection, CSS manipulation, and AJAX operations away from jQuery while maintaining the same functionality.
Key changes:
- Replace jQuery selectors with
document.querySelector/querySelectorAll - Replace jQuery event binding (
.on(),.off()) with nativeaddEventListener/removeEventListener - Replace jQuery DOM manipulation methods with native alternatives
- Update type definitions from
JQuery.TriggeredEventto nativeEvent,MouseEvent,KeyboardEvent
Reviewed Changes
Copilot reviewed 138 out of 139 changed files in this pull request and generated 25 comments.
Show a summary per file
| File | Description |
|---|---|
| frontend/package.json | Adds dependencies for jQuery-free event delegation (@knowledgecode/delegate) and slide animations (es6-slide-up-down) |
| frontend/src/app/shared/helpers/dom-helpers.ts | New utility module providing jQuery-like helper functions using native DOM APIs |
| modules/*/frontend/module/git-actions-menu/git-actions-menu.directive.ts | Updates event type from JQuery.TriggeredEvent to Event |
| modules/budgets/frontend/module/augment/planned-costs-form.ts | Replaces jQuery event delegation with @knowledgecode/delegate library |
| frontend/src/turbo/turbo-global-listeners.ts | Replaces jQuery .each() with native forEach() |
| frontend/src/app/shared/helpers/link-handling/link-handling.ts | Updates event type from JQuery.TriggeredEvent to MouseEvent |
| frontend/src/app/shared/helpers/drag-and-drop/dom-autoscroll.service.ts | Replaces jQuery event binding with native addEventListener |
| frontend/src/app/shared/directives/*/*.ts | Multiple directive files updating from jQuery element references to native HTMLElement |
| frontend/src/app/shared/components/*/*.ts | Component files migrating from jQuery to native DOM APIs for element manipulation and event handling |
| frontend/src/app/features/work-packages/components/wp-table/*.ts | Work package table components replacing jQuery with native DOM operations |
| frontend/src/app/features/calendar/*.ts | Calendar components removing jQuery tooltip and DOM manipulation calls |
| frontend/src/app/core/setup/globals/*.ts | Global listener setup replacing jQuery with native event handling |
Files not reviewed (1)
- frontend/package-lock.json: Language not supported
frontend/src/app/shared/helpers/drag-and-drop/dom-autoscroll.service.ts
Outdated
Show resolved
Hide resolved
frontend/src/app/shared/helpers/drag-and-drop/dom-autoscroll.service.ts
Outdated
Show resolved
Hide resolved
frontend/src/app/core/setup/globals/global-listeners/settings.ts
Outdated
Show resolved
Hide resolved
frontend/src/app/core/setup/globals/global-listeners/danger-zone-validation.ts
Outdated
Show resolved
Hide resolved
frontend/src/app/core/setup/globals/global-listeners/setup-server-response.ts
Outdated
Show resolved
Hide resolved
frontend/src/app/core/setup/globals/global-listeners/setup-server-response.ts
Outdated
Show resolved
Hide resolved
...p/features/work-packages/components/wp-fast-table/builders/relations/relation-row-builder.ts
Show resolved
Hide resolved
frontend/src/app/features/work-packages/components/wp-fast-table/handlers/row/click-handler.ts
Outdated
Show resolved
Hide resolved
c0ad5e2 to
07e86f2
Compare
frontend/src/app/core/setup/globals/global-listeners/setup-server-response.ts
Fixed
Show fixed
Hide fixed
...tend/src/app/shared/components/op-context-menu/handlers/op-context-menu-trigger.directive.ts
Fixed
Show fixed
Hide fixed
frontend/src/app/shared/components/op-context-menu/op-context-menu.service.ts
Fixed
Show fixed
Hide fixed
0b5ff43 to
24f8775
Compare
frontend/src/app/features/boards/board/add-card-dropdown/add-card-dropdown-menu.directive.ts
Fixed
Show fixed
Hide fixed
...tend/src/app/shared/components/op-context-menu/handlers/op-columns-context-menu.directive.ts
Fixed
Show fixed
Hide fixed
...tend/src/app/shared/components/op-context-menu/handlers/op-context-menu-trigger.directive.ts
Fixed
Show fixed
Hide fixed
...nd/src/app/shared/components/op-context-menu/handlers/op-settings-dropdown-menu.directive.ts
Fixed
Show fixed
Hide fixed
...tend/src/app/shared/components/op-context-menu/handlers/wp-create-settings-menu.directive.ts
Fixed
Show fixed
Hide fixed
...ponents/op-context-menu/icon-triggered-context-menu/icon-triggered-context-menu.component.ts
Fixed
Show fixed
Hide fixed
frontend/src/app/shared/components/op-context-menu/wp-context-menu/wp-single-context-menu.ts
Fixed
Show fixed
Hide fixed
.../src/app/shared/components/op-context-menu/wp-context-menu/wp-view-context-menu.directive.ts
Fixed
Show fixed
Hide fixed
24f8775 to
9e4b33c
Compare
frontend/src/app/shared/components/op-context-menu/op-context-menu-handler.ts
Fixed
Show fixed
Hide fixed
a5ceaf4 to
c901941
Compare
Fixes:
<internal:warning>:54:in 'Kernel.warn': Locator Type:#<Type id: 1008, name: "Type No. 1", position: 5, is_in_roadmap: true, is_milestone: false, is_default: false, color_id: nil, created_at: "2025-11-04 12:57:37.377907000 +0000", updated_at: "2025-11-04 12:57:37.377926000 +0000", is_standard: false, attribute_groups: [], description: nil, patterns: #<data WorkPackageTypes::Patterns::Collection patterns={}>, pdf_export_templates_config: {}> for selector :option must be an instance of String or Symbol or Integer. This will raise an error in a future version of Capybara. Called from: /home/git-repos/openproject/modules/backlogs/spec/support/pages/backlogs.rb:61 (StructuredWarnings::BuiltInWarning)
<internal:warning>:54:in 'Kernel.warn': Locator Integer:255 for selector :link must be an instance of String or Symbol or Array. This will raise an error in a future version of Capybara. Called from: /home/git-repos/openproject/modules/backlogs/spec/support/pages/backlogs.rb:214 (StructuredWarnings::BuiltInWarning)
| element.dispatchEvent( | ||
| new CustomEvent('op:dragscroll', { | ||
| detail: { | ||
| x: evt.clientX - mousedownX, | ||
| y: evt.clientY - mousedownY, | ||
| }, | ||
| }), | ||
| ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ensure menu positioning is complete. Make focus take place after next repaint.
| dropDown.querySelector<HTMLAnchorElement>('li > a:first-child')?.focus(); | ||
| // when clicking on something, which is not the menu, close the menu | ||
| jQuery('html').on('click', { menu: menu.get(0) }, closeMenu); | ||
| document.addEventListener('click', (evt) => closeMenu(menu, evt), { once: true }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check
Replaces inline jQuery code with `select-autosize` Stimulus controller. Also applies inline style to fix select height.
This PR includes commits from #20846. Please review/merge that first.Ticket
https://community.openproject.org/wp/65618
What are you trying to accomplish?
Screenshots
What approach did you choose and why?
Merge checklist