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 unused JavaScript #195

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

t27duck
Copy link
Contributor

@t27duck t27duck commented May 21, 2023

The amount of JavaScript cruft is too damn high.

  • Remove jquery.blockUI - The api $.blockUI() is not used anywhere in the app.
  • Remove linkify - The api linkify() is not used anywhere in the app.
  • Remvoe jquery.elastic - All textareas already have a width of 100% so they will adjust based on the browser window.
  • Remove jquery.easing - Nothing is using a custom easing function nor is the jquery defualt changed anywhere.
  • Remove jquery.qtip and styles - It's not loaded up in application.js nor are the CSS classes used anywhere.
  • Remove jquery.supersized - It's not loaded up in application.js nor are the CSS classes used anywhere.
  • Remove jquery.carouFredSel - It's not loaded up in application.js.
  • Remove script.js - No other JS references these functions.
  • Remove jquery.fancybox - There's nothing fancy going on here and it's not even loaded.
  • Remove jquery.ui - Nope, not used.
  • Remove jquery.min - ... we're using the jquery-rails gem already...
  • Moved JavaScript in the app layout from the body to the head. This isn't 2010 anymore.
  • Refactored most of the main.js code to not rely on jQuery.

From what I can see, all the Holiday Social archive pages are each in their own self-contained folder under public and vendor their own JavaScript files (which probably also aren't used 90% of the time), but I left those alone.

The amount of JavaScript cruft is too damn high.

- Remove jquery.blockUI - The api `$.blockUI()` is not used anywhere in the app.
- Remove linkify - The api `linkify()` is not used anywhere in the app.
- Remvoe jquery.elastic - All textareas already have a width of 100% so they will adjust based on the browser window.
- Remove jquery.easing - Nothing is using a custom easing function nor is the jquery defualt changed anywhere.
- Remove jquery.qtip and styles - It's not loaded up in application.js nor are the CSS classes used anywhere.
- Remove jquery.supersized - It's not loaded up in application.js nor are the CSS classes used anywhere.
- Remove jquery.carouFredSel - It's not loaded up in application.js.
- Remove script.js - No other JS references these functions.
- Remove jquery.fancybox - There's nothing fancy going on here and it's not even loaded.
- Remove jquery.ui - Nope, not used.
- Remove jquery.min - ... we're using the jquery-rails gem already...
- Moved JavaScript in the app layout from the body to the head. This isn't 2010 anymore.
- Refactored most of the `main.js` code to not rely on jQuery.

From what I can see, all the Holiday Social archive pages are each in their own self-contained folder under `public` and vendor their own JavaScript files (which probably also aren't used 90% of the time), but I left those alone.
@@ -1,27 +1,56 @@
$(document).ready(function() {
$('textarea').elastic();
$('form.new_job_post_request, form.new_job, form.edit_job, #sign_in form').superLabels({
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than the jQuery version of Rails UJS, superlables is the only thing left from what I can tell that relies on jQuery.

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.

1 participant