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

Migrate to jQuery 3.x #687

Merged
merged 8 commits into from
Feb 17, 2025
Merged

Migrate to jQuery 3.x #687

merged 8 commits into from
Feb 17, 2025

Conversation

yellowled
Copy link
Member

Note: This should be tested before merging! See referenced issue for a list of core themes and additional plugins depending on jQuery.

  • Update bundled jQuery to 3.4.1
  • Add jQuery migrate plugin
  • Include jQuery migrate in all frontend and backend templates

References #686

- Update bundled jQuery to 3.4.1
- Add jQuery migrate plugin
- Include jQuery migrate in all frontend and backend templates

References #686
@onli
Copy link
Member

onli commented Mar 14, 2021

@yellowled How can I test this for you? I assume this is still something that should be merged?

@yellowled
Copy link
Member Author

@onli Basically, see #686 and the comments there. I did some testing, as did @mmitch and @surrim, but there are (additional) plugins that will break, most notably serendipity_event_commentedit.

I think the only way to be sure would be to test every plugin and/or functionality that requires jQuery to see if it requires an old version and/or if using the migrate plugin helps. In some cases (like commentedit) this seemed to require some familiarity with the – PHP – code or at least the plugin that I did not have. That's why I gave up testing.

Also, the version should be bumped to jQuery 3.6.0.

I'm not sure "how much" functonality just merging would break at this point. Probably not too too much in core, core plugins and core themes, but that's just a guess at this point.

@onli
Copy link
Member

onli commented Mar 14, 2021

I gonna have a look at commentedit. It was probably too complicated for me at the time when I wrote it, but it's a feature I still want. Maybe I can clean it up and fix the bug at the same time.

Most of the other plugin errors linked in that thread seem to be PHP issues.

onli added a commit to s9y/additional_plugins that referenced this pull request Jan 18, 2025
Intended to finally address  make jQuery upgrade possible, see s9y/Serendipity#687 (comment)
onli added a commit to s9y/additional_plugins that referenced this pull request Jan 18, 2025
Intended to finally address  make jQuery upgrade possible, see s9y/Serendipity#687 (comment)
@onli
Copy link
Member

onli commented Jan 20, 2025

I think we can actually merge this now. This PR now contains the current jQuery version, plus the current migration plugin. With commentedit fixed I had a look at a few of the other plugins marked as problematic (livecomment, lightbox, linktrimmer), and they all worked - or had issues on the PHP level. PHP errors also explain some of the bugs opened via #686.

I didn't even notice output from the jquery migration plugin, but I might have just been unlucky with the plugin selection for that - and either the backend JS code is completely compatible, or I'm misunderstanding how that plugin is supposed to work.

In any case, I think merging this into master and testing it that way is the only path forward. Ok @garvinhicking ?

@fe-hicking
Copy link
Contributor

Hm, theres a .orig file mixed in the commit.

I also dont know what jquery-migrate is, I wonder if we could do without...?!

@onli
Copy link
Member

onli commented Jan 21, 2025

Hm, theres a .orig file mixed in the commit.

I removed it, and added .orig to .gitignore.

I also dont know what jquery-migrate is, I wonder if we could do without...?!

https://github.com/jquery/jquery-migrate/#readme explains its function (and also why I did not see console warnings, the production version does not output them...). It paves over the breaking changes. I think we need it for now. We could try to rework the core JS for the changes, but then there would still be all the plugins left to fix...

@onli
Copy link
Member

onli commented Feb 1, 2025

@garvinhicking Do we go ahead here as well? :)

@onli
Copy link
Member

onli commented Feb 17, 2025

Actually, we might be able to skip jquery migrate. I'll provide some commits if everything works out. But we also could merge here first and then remove the migrate plugin again, might be the cleanest approach.

Yes. I'll merge this first, and then work on skipping the migrate plugin (according to my testing, we only need to replace the tabs and do one code change for the load call.)

@onli onli merged commit a128cf6 into master Feb 17, 2025
5 checks passed
@onli onli deleted the 686-migrate-to-jquery3 branch February 17, 2025 21:42
@onli onli mentioned this pull request Feb 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants