Mottie / tablesorter

Github fork of Christian Bach's tablesorter plugin + awesomeness ~
https://mottie.github.io/tablesorter/docs/
2.6k stars 754 forks source link

Missing support using tableSorter with jquery 4 #1849

Open AviHafner opened 7 months ago

AviHafner commented 7 months ago

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 commented 7 months ago

also trim() is missing

aavmurphy commented 7 months ago

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

AviHafner commented 6 months ago

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 commented 6 months ago

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 commented 6 months ago

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

AviHafner commented 6 months ago

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 commented 6 months ago

@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 commented 6 months ago

@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 commented 6 months ago

@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 avi.hafner@gmail.com I can attach the files to you in zip file.

xpusostomos commented 5 months ago

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 java.base@17.0.8.1/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base@17.0.8.1/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 java.base@17.0.8.1/java.util.concurrent.FutureTask.run(FutureTask.java:264)
        at java.base@17.0.8.1/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
        at java.base@17.0.8.1/java.util.concurrent.FutureTask.run(FutureTask.java:264)
        at java.base@17.0.8.1/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
        at java.base@17.0.8.1/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
        at java.base@17.0.8.1/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 commented 5 months ago

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 commented 5 months ago

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 commented 5 months ago

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 commented 5 months ago

@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 commented 5 months ago

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 commented 5 months ago

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 commented 5 months ago

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.

elmervidad99 commented 1 month ago

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 commented 1 month ago

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 commented 2 weeks ago

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/