Refactor main listener into modular handler files and remove jQuery global#533
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e41c6e1f2e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| "window.jQuery": "jquery", | ||
| jquery: 'jquery' | ||
| }), | ||
| ], |
There was a problem hiding this comment.
Restore jquery provisioning for
$ usages
Removing the webpack ProvidePlugin leaves existing bundled code with unresolved $ references: globalConfiguration() is used by the app entry points and still reaches $ in src/js/modules/mainFunction.js (for example configureDT, path, and checkSelect), and the show pages call Client.getClientByIdDevis($("#devisid")...) directly. In a Nextcloud page that does not provide a global jQuery, those paths will now throw ReferenceError: $ is not defined at runtime, so keep the provider or replace the remaining $ calls with explicit imports/plain DOM APIs before removing it.
Useful? React with 👍 / 👎.
Motivation
main_listener.jsinto focused handler modules for configuration, editable elements, products, selects and table actions.Description
src/js/listener/handlers/configuration_handlers.js,editable_handlers.js,product_handlers.js,select_handlers.js, andtable_handlers.jsimplementing focused event handling logic and utility functions such asopenFolderPicker,saveEditableElement,duplicateItem, andupdateLinkedListSelection.src/js/listener/main_listener.jsto import and wire the new handlers, register granular event listeners (click,dblclick,change,keydown,focusout,mouseover) and consolidate logic into small functions likehandleBodyClick,handleBodyChange, andhandleBodyKeydown.jqueryfromdevDependenciesinpackage.jsonand eliminated thewebpack.ProvidePluginthat injected jQuery globals fromwebpack.jsto stop using implicit global jQuery.Testing
webpack --config webpack.js) and the build completed without errors.Codex Task