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 from jquery-ujs to rails-ujs #4666

Open
10 tasks
christinach opened this issue Dec 30, 2024 · 0 comments
Open
10 tasks

Migrate from jquery-ujs to rails-ujs #4666

christinach opened this issue Dec 30, 2024 · 0 comments
Assignees
Labels
maintenance Ticket related to maintenance that needs to be done

Comments

@christinach
Copy link
Member

christinach commented Dec 30, 2024

What maintenance needs to be done?

In our Ruby on Rails app use the rails-ujs library.

Level of urgency

  • High
  • Moderate
  • Low

EOL upgrade

  • EOL Date MM/DD/YYYY

Why is this maintenance needed?

Acceptance criteria

  • In application.js replace jquery_ujs with rails-ujs. Require it after jquery.
  • Replace instances of $.rails. with Rails.
  • Use new event parameter syntax. For example:
    instead of
$(document).on("ajax:success", function(event, data, status, xhr) {
  ...
});

use

$(document).on("ajax:success", function(event) {
  var data = event.detail[0];
  var status = event.detail[1];
  var xhr = event.detail[2];
  ...
});
  • Migrate JQuery events to UJS events (separate ticket)
  • Correct AJAX type (separate ticket)
  • Replace JQuery trigger() with native events dispatching: click() method or dispatchEvent() method. (separate ticket)

Implementation notes, if any

Reference for this ticket: https://dev.to/nejremeslnici/migrating-from-jquery-ujs-to-rails-ujs-k9m

Assigned @christinach to complete writing the rest of the tickets that are in the acceptance criteria.

@christinach christinach added the maintenance Ticket related to maintenance that needs to be done label Dec 30, 2024
@christinach christinach self-assigned this Dec 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Ticket related to maintenance that needs to be done
Projects
None yet
Development

No branches or pull requests

1 participant