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

Remove unnecessary JavaScript dependency jquery.migrate.js #3389

Merged
merged 1 commit into from
Sep 18, 2021

Conversation

jdufresne
Copy link
Member

The frontend JavaScript code is not using any jQuery API that requires
these compatibility shims. By removing the dependency we slightly reduce
the compiled asset size and work towards reducing overall jQuery usage.

Refs #2893

The frontend JavaScript code is not using any jQuery API that requires
these compatibility shims. By removing the dependency we slightly reduce
the compiled asset size and work towards reducing overall jQuery usage.

Refs railsadminteam#2893
@mshibuya
Copy link
Member

The frontend JavaScript code is not using any jQuery API that requires these compatibility shims.

How did you figure this out? It would be possible but I want to be careful since we have very limited test code coverage for JS logics...

@jdufresne
Copy link
Member Author

How did you figure this out? It would be possible but I want to be careful since we have very limited test code coverage for JS logics...

Good question.

I installed this PR branch in my local project and clicked around as much as possible and looked for JavaScript console errors. There were none.

Additionally, I visually scanned the JavaScript code for known incompatibilities, I did not find any.

But I agree, this is not foolproof and there is still a possibility of bugs. If you find any or already know of some, please let me know and I'll spend some time fixing them.

If there are no known bugs, we basically have two options:

  1. Keep jquery.migrate.js as it is uncertain whether or not bugs are introduced.

  2. Drop jquery.migrate.js. If a related bug is reported, address it. I'm happy to help out on this front, if you @ me in a issue ticket.

Without eventually taking the plunge, I'm not sure of a good strategy for dropping the shim. If you decide the risk isn't worth it, no hard feelings. Please feel free to close.

@mshibuya mshibuya merged commit f360f49 into railsadminteam:master Sep 18, 2021
@mshibuya
Copy link
Member

OK, I trust you 😃
Thanks for the investigation!

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.

2 participants