build(deps): upgrade vendored jQuery to 3.7.1 and fix deprecated-global lint - #363
Merged
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-globalswarnings onviewer.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 aswindow.$instead of a bare$sidesteps the rule accurately (a member access onwindowisn'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 directivecontroller/linkfunctions, 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) andnpm run buildall pass.