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

Missing support using tableSorter with jquery 4 #1849

Open
AviHafner opened this issue Feb 7, 2024 · 20 comments
Open

Missing support using tableSorter with jquery 4 #1849

AviHafner opened this issue Feb 7, 2024 · 20 comments

Comments

@AviHafner
Copy link

when using tableSorter with Jquery-4
The error is received
jquery.tablesorter.widgets.min.js:4 Uncaught TypeError: e.sort is not a function
Please add support in Jquery-4

@aavmurphy
Copy link
Contributor

also trim() is missing

@aavmurphy
Copy link
Contributor

Apparently, there's an extra library to load, jQuery migrate, https://github.com/jquery/jquery-migrate which should re-add the depreciated stuff.

@AviHafner
Copy link
Author

Thanks Andrew Murphy

The code that you sent to me helped me to translate the problems in my code that not support in jQuery version 4.
And I actually translated the code that worked in jQuery to pure JavaScript (vanilla).

I hope that the developers of the wonderful product called tablesorter will solve the problems of computability with jQuery version 4.
And break away From Gordian Knot to jQuery
and adapt tableSorter to work in pure JavaScript (vanilla)

I don't see any advantage in working with jQuery when pure JavaScript (vanilla)
Simply offers all the capabilities available in jQuery.

@AviHafner
Copy link
Author

hii @aavmurphy
in the url tablesorter-V3
you can find 2 files that compatible with Jquery 4

I am not the Developer of tableSort
And I ask you if you can let me know whether you have any problem with the changes, I made in the code.

A little tip
https://github.com/jquery/jquery-migrate
Not fully compliant for testing Jquery 4

@aavmurphy
Copy link
Contributor

A v4 of 'jQuery migrate' isn't out yet, only a v3 one for the last lot of changes.

@AviHafner
Copy link
Author

I am apologize @aavmurphy
you can find in https://www.admin.technion.ac.il/tablesorter-V3.1/
2 files that work perfectly in the cases that I tested with the Jquery-4

I hope you will adopt the change and give me feedback.

@aavmurphy
Copy link
Contributor

@AviHafner That link doesn't seem to work - maybe its not a public website. However, I'm not an admin. Have to wait for 'Mottie' to include the changes I'm afraid.

Having said that, am thinking of porting it to "vanilla" javascript. But it will be more of a re-imagining, so some changes. Will take a while though. There's an awful lot to do.

@AviHafner
Copy link
Author

@aavmurphy
My university has hardened server references due to a hostile takeover.
And we are selectively open to the world.

Please check the following link
https://newstud.technion.ac.il/tablesorter-V3.1/

I hope you can use the wonderful product tablesorter.
From the jquery-4 demos I understand that the jquery-4 developers are on the right track
And I believe in this product.

@AviHafner
Copy link
Author

@aavmurphy
I apologize if I am disturbing
I discovered in another project another unsupported command
$.type in tablesorter.
jQuery 4 threw out support for everything in JavaScript ES6.
Please check the following link
https://newstud.technion.ac.il/tablesorter-V3.2/
if you can send me an email to an address
of my [email protected]
I can attach the files to you in zip file.

@xpusostomos
Copy link

I don't want to use tablesorter with jquery 4 (yet), but my build which includes org.webjars.bower:jquery.tablesorter:2.31.1 seems to be dragging in jquery 4, and making the build fail. Does anyone know how I can force it to keep using jquery3 ?

binary.unminified.js:2:0: ERROR - [JSC_JS_MODULE_LOAD_WARNING] Failed to load module "../core.js"
  2| import { jQuery } from "../core.js";
     ^

1 error(s), 0 warning(s)
Closure uglify JS Exception
asset.pipeline.processors.MinifyException: [JSC_JS_MODULE_LOAD_WARNING. Failed to load module "../core.js" at binary.unminified.js line 2 : 0]
        at asset.pipeline.processors.ClosureCompilerProcessor.process(ClosureCompilerProcessor.groovy:81)
        at asset.pipeline.processors.ClosureCompilerProcessor$process.call(Unknown Source)
        at asset.pipeline.AssetCompiler$_compile_closure4.doCall(AssetCompiler.groovy:171)
        at jdk.internal.reflect.GeneratedMethodAccessor290.invoke(Unknown Source)
        at [email protected]/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at [email protected]/java.lang.reflect.Method.invoke(Method.java:568)
        at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:107)
        at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:323)
        at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:274)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1035)
        at groovy.lang.Closure.call(Closure.java:412)
        at groovy.lang.Closure.call(Closure.java:406)
        at [email protected]/java.util.concurrent.FutureTask.run(FutureTask.java:264)
        at [email protected]/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
        at [email protected]/java.util.concurrent.FutureTask.run(FutureTask.java:264)
        at [email protected]/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
        at [email protected]/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
        at [email protected]/java.lang.Thread.run(Thread.java:833)
load.unminified.js:2:0: ERROR - [JSC_JS_MODULE_LOAD_WARNING] Failed to load module "../core.js"
  2| import { jQuery } from "../core.js";
     ^

load.unminified.js:3:0: ERROR - [JSC_JS_MODULE_LOAD_WARNING] Failed to load module "../core/stripAndCollapse.js"
  3| import { stripAndCollapse } from "../core/stripAndCollapse.js";
     ^

2 error(s), 0 warning(s)
Closure uglify JS Exception

@Mottie
Copy link
Owner

Mottie commented Mar 18, 2024

If you load tablesorter immediately after loading jQuery v3, it should attach itself to that version. Make sure to use noConflict to differentiate the versions.

@AviHafner
Copy link
Author

Thank you and welcome back @Mottie
I been waiting to hear from you.
the product that you created is spectacular compared to all the other products that are used to sort tables,
your product is much better than all the other.
Many thanks

Do you have any forecast for when you will release a suitable version for Jquery version 4?

@xpusostomos
Copy link

If you load tablesorter immediately after loading jQuery v3, it should attach itself to that version. Make sure to use noConflict to differentiate the versions.

That didn't seem to work for me, it wanted to drag in both versions. However this did work:

    implementation ("org.webjars.bower:jquery.tablesorter:2.31.1") {
        exclude  group: "org.webjars.bower", module: "jquery"
    }

@Mottie
Copy link
Owner

Mottie commented Mar 21, 2024

@AviHafner I'm finding small chunks of time to work on various projects (including tablesorter). I don't have a timeline of when I'll update tablesorter to work with jQuery, but I will say that it's ongoing.

@AviHafner
Copy link
Author

Many thanks in advance @Mottie .
I’ve adapted my own version of tablesorter for jQuery 4.
However, given my familiarity with both the project and your product,
I am confident that your official release will surpass my Version of tablesorter.

@aavmurphy
Copy link
Contributor

This (almost) works

<script src="https://code.jquery.com/jquery-4.0.0-beta.js"></script>
<script src="https://releases.jquery.com/git/jquery-migrate-git.js"></script>

The 'release' version of jQuery Migrate for v4 isn't out yet, but the nightly build version is almost there. It re-adds some function calls that v4 takes out
Works for core module, vertical-group plugin, not filter plugin

@xpusostomos
Copy link

I think you should release another version that merely restricts the jQuery version it drags in to 3.x. it will be a while until everything supports 4, and we want to use it.

@razorkyle
Copy link

I'm new here Mr. @Mottie browsing your project documentation, this table-sorter is the best i have ever seen, I'm looking forward for the newer version of this project

@Mottie
Copy link
Owner

Mottie commented Aug 14, 2024

Sorry if I got anyone's hopes up... I got a request to update npm with the latest code, so that's all I did 😿

I had the jQuery v4 work in progress, but after seeing so many demo pages failing, I got sidetracked updating them one-by-one... and that'll be a lot more work.

@DavidAnderson684
Copy link

DavidAnderson684 commented Aug 24, 2024

Related: WordPress are planning to move to jQuery 4 in 2025: https://make.wordpress.org/core/2024/08/23/updating-jquery-shipped-with-wordpress-to-version-4-0/

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

No branches or pull requests

6 participants