Skip to content
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

Upgrade jQuery to 3.5.0, remove jQuery-Migrate, fix deprecations #11055

Merged
merged 2 commits into from
Apr 18, 2020

Conversation

silverwind
Copy link
Member

@silverwind silverwind commented Apr 13, 2020

Upgrade jQuery to 3.5.0, remove jQuery-Migrate

  • Removed jQuery-Migrate as it seems to no longer be needed.
  • Removed a dead code section.
  • Fixed some deprecations detected by jQuery-Migrate.

Ref: https://jquery.com/upgrade-guide/3.5/
Ref: https://github.com/gogs/gogs/search?q=repo-name-change-prompt
Ref: https://github.com/go-gitea/gitea/search?q=repo-name-change-prompt
Fixes: #9372

@techknowlogick techknowlogick added type/refactoring Existing code has been cleaned up. There should be no new functionality. topic/ui Change the appearance of the Gitea UI labels Apr 13, 2020
@techknowlogick techknowlogick added this to the 1.12.0 milestone Apr 13, 2020
@6543
Copy link
Member

6543 commented Apr 13, 2020

@silverwind bad news: dropzone do not work anymore ... looks like it still depend on migrate :(

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Apr 13, 2020
@silverwind
Copy link
Member Author

It did work for me, at least adding/removing attachment. What was not working for you?

@6543
Copy link
Member

6543 commented Apr 13, 2020

adding attachments to a new created issue

@silverwind
Copy link
Member Author

silverwind commented Apr 13, 2020

Will check. I did not yet run with unmuted jQuery-Migrate which should highlight all the issue in the console, but it's a bit cumbersome in general to work on issues because of SimpleMDE console spam.

@guillep2k
Copy link
Member

Dropzone itself claims to have no external dependencies, even jQuery... 🤔 Maybe it's the way we use it?

@silverwind
Copy link
Member Author

Yeah, something seems fishy as we don't use the jQuery-variant of Dropzone initialization. I think the old 4.x version of Dropzone may have had a jQuery dependency, but the current version we use doesn't.

@silverwind
Copy link
Member Author

silverwind commented Apr 15, 2020

@6543 I played around a bit with dropzone and I can't find any difference before or after this PR.

Adding attachments works, there's just the non-obvious case when the attachment exceeds the file size limit (default 4mb), hitting save will still save the comment but the attachment is gone from the comment. I think it might better to just prevent save in that case. Maybe this was what you were seeing?

@6543
Copy link
Member

6543 commented Apr 15, 2020

no I could not use it att all - I'll recheck have cleaned test env now

Copy link
Member

@6543 6543 left a comment

Choose a reason for hiding this comment

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

works fine now

¯\_(ツ)_/¯ why it didn't before

@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Apr 16, 2020
@silverwind
Copy link
Member Author

I guess many such mysteries can be attributed to a stale service worker cache, if you have that enabled.

@6543
Copy link
Member

6543 commented Apr 16, 2020

Already disabled for exact that reason

@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Apr 17, 2020
@silverwind
Copy link
Member Author

Unmuted migrate reveals a few deprecations, some in our code. I will work on eliminating them, don't land yet.

JQMIGRATE: jQuery.expr[':'] is deprecated; use jQuery.expr.pseudos
JQMIGRATE: jQuery.fn.click() event shorthand is deprecated
JQMIGRATE: jQuery.trim is deprecated; use String.prototype.trim
JQMIGRATE: jQuery.isFunction() is deprecated
JQMIGRATE: jQuery.isWindow() is deprecated
JQMIGRATE: jQuery.fn.bind() is deprecated
JQMIGRATE: jQuery.fn.submit() event shorthand is deprecated
JQMIGRATE: jQuery.fn.unbind() is deprecated
JQMIGRATE: jQuery.fn.keypress() event shorthand is deprecated
JQMIGRATE: jQuery.fn.keyup() event shorthand is deprecated
JQMIGRATE: jQuery.fn.change() event shorthand is deprecated
JQMIGRATE: jQuery.fn.keydown() event shorthand is deprecated

@silverwind silverwind force-pushed the jquery-35 branch 3 times, most recently from c0fe080 to f23aeab Compare April 17, 2020 20:58
@silverwind silverwind changed the title Upgrade jQuery to 3.5.0, remove jQuery-Migrate Upgrade jQuery to 3.5.0, remove jQuery-Migrate, fix deprecations Apr 17, 2020
@silverwind
Copy link
Member Author

silverwind commented Apr 17, 2020

Fixed all deprecations in our code. Some still remain, but these are in dependencies or vendor files. Should be good to land now.

@techknowlogick
Copy link
Member

ping LG-TM

@techknowlogick techknowlogick merged commit b57a735 into go-gitea:master Apr 18, 2020
@silverwind silverwind deleted the jquery-35 branch April 19, 2020 22:29
ydelafollye pushed a commit to ydelafollye/gitea that referenced this pull request Jul 31, 2020
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. topic/ui Change the appearance of the Gitea UI type/refactoring Existing code has been cleaned up. There should be no new functionality.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove jQuery Migrate
6 participants