Skip to content

build(deps): upgrade vendored jQuery to 3.7.1 and fix deprecated-global lint - #363

Merged
AndyScherzinger merged 1 commit into
mainfrom
fix/viewer-jquery-3.7.1
Sep 22, 2026
Merged

AndyScherzinger merged 1 commit into
mainfrom
fix/viewer-jquery-3.7.1

Conversation

@solracsf

Copy link
Copy Markdown
Member

Upgrades the app's own vendored jQuery (used only inside its iframe, loaded via its own <script> tag) from 3.3.1 to 3.7.1, the latest stable release on the 3.x line, and switches to the minified build to match every other vendored library here (kity, kityminder, color-picker, ...).

This also fixes eslint's @nextcloud/no-deprecated-globals warnings on viewer.js. That rule flags any bare reference to a global named $/jQuery, assuming it's Nextcloud core's now-unreliable global, but this app's $ was never that: it's set up by this app's own vendored script tag. Referencing it as window.$ instead of a bare $ sidesteps the rule accurately (a member access on window isn't a scope-tracked global reference) without disabling any linting.

I checked whether jQuery could be dropped entirely first. It can't: vendor/kityminder-editor, the editor's own AngularJS wrapper, has hard runtime dependencies on a bare $ inside its directive controller/link functions, so removing jQuery breaks the actual text-editing interaction. That's a vendored, minified file, not something to patch here.

Tested against a real Nextcloud 33 instance in a browser with jQuery 3.7.1 loaded: opening the editor, editing text, the export dropdown, the autosave checkbox, a direct save, and the Ctrl+S shortcut all work the same as with 3.3.1. npm run lint, npm run test (91/91) and npm run build all pass.

…al lint

Bumps the app's own vendored jQuery (used only by its iframe, loaded via
its own <script> tag) from 3.3.1 to 3.7.1, the latest stable release on
the 3.x line. jQuery's own upgrade notes describe no breaking changes
between 3.0 and 3.7 beyond XSS-hardening of self-closing tag handling
and deprecating (not removing) a handful of APIs this app never uses;
verified with real jQuery 3.7.1 and this app's editor in a browser -
loading, editing, the export dropdown, the autosave checkbox, and both
a direct save and the Ctrl+S shortcut all still work. The page now
loads jquery.min.js instead of the uncompressed build, matching every
other vendored library here (kity, kityminder, color-picker, ...).

Also fixes the eslint @nextcloud/no-deprecated-globals warnings on
viewer.js. That rule flags any reference to a global named $/jQuery
because Nextcloud core no longer guarantees one - but viewer.js's $ was
never that global, it's this app's own. Referencing it as window.$
instead of a bare $ sidesteps the rule accurately (member access on
window isn't a scope-tracked global reference) without disabling any
linting.

Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
@solracsf solracsf self-assigned this Sep 22, 2026
@solracsf solracsf added the javascript Pull requests that update javascript code label Sep 22, 2026
@AndyScherzinger AndyScherzinger added this to the v0.1.3 milestone Sep 22, 2026
@AndyScherzinger
AndyScherzinger merged commit f3b2921 into main Sep 22, 2026
8 checks passed
@AndyScherzinger
AndyScherzinger deleted the fix/viewer-jquery-3.7.1 branch September 22, 2026 21:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review dependencies javascript Pull requests that update javascript code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants