Look into dropping jQuery UI #7874
Replies: 10 comments 1 reply
-
See also #4034 re datepickers |
Beta Was this translation helpful? Give feedback.
-
I would like to help out on this. For now, we need a list on where jQuery is used, yes? |
Beta Was this translation helpful? Give feedback.
-
I assume all of the jquery-ui components we currently vendorize use jquery under the hood. So we would need to replace each of these components with a standalone solution that does not depend on jquery. It's an ambitious task. |
Beta Was this translation helpful? Give feedback.
-
How open are you to replacing them with React-based components? That would require adding webpacker as a dependency. Just want to set the boundaries on what we can replace the vendorized libraries with. |
Beta Was this translation helpful? Give feedback.
-
I'm pretty opened to replacing our assets with more modern solutions, not sure about others. Perhaps the task could be subdivided in two subtasks:
Word of caution though for the first task: the current state of the art around "webpacker + rails engines" is "pretty tricky". At least last time I checked was by no means straightforward how to set it up. |
Beta Was this translation helpful? Give feedback.
-
Ping @rystraum! In case you missed it, I just found this PR that you might be interested in having a look/try: #5855. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the ping @vfonic. I was sort of stuck with this because I was following this thread rails/webpacker#348. It didn't cross my mind that we can just write all the files to |
Beta Was this translation helpful? Give feedback.
-
I'd love to help. I'm not sure about the time available that I'll have, but let's see. Is there any repo where I can have a look? Maybe we could split some work? |
Beta Was this translation helpful? Give feedback.
-
I have been going through the various issues to figure out if I could remove jquery as a dependency and realized how painful must have been doing the work to migrate to webpacker, just to see it deprecated. I wonder if activeadmin should do the following:
This way it should be possible to make everybody happy:
The downside is that this will effectively need to be a breaking release, because to keep activeadmin working, people will need to add a gem to their gemfile As for dropping jquery and jquery ui, I'll leave that open. The reality that a good chunk of the js community moved on it's there, which makes it more challenging finding premade components without importing another library (incidentally, react) A solution to this would be to use custom html elements as an interface and provide an npm package that's essentially just implementing this html elements using the js code. Would love to hear thoughts on this |
Beta Was this translation helpful? Give feedback.
-
This has already been removed on the default branch for the next major release so closing this out. We've addressed the issue around date pickers by using the native date picker instead which also works great on mobile. Users can target that element using JS if they rather change it to a custom date picker. The default though will be the native date picker. We've removed the batch action form DSL and has been replaced with a partial/modal-id feature. This will give full control and arguably a better DSL for batch action modals since we'd be able to use Rails forms. Modal functionality now comes from Flowbite. |
Beta Was this translation helpful? Give feedback.
-
The jQuery UI library is massive and isn't seeing a lot of development. We should look into where its being used (e.g. calendar, tabs, modal) and see about replacing it with our own JS or smaller libraries dedicated for each.
For a date picker: https://github.com/chmln/flatpickr
Beta Was this translation helpful? Give feedback.
All reactions