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

Modernize js #72

Closed
wants to merge 4 commits into from
Closed

Modernize js #72

wants to merge 4 commits into from

Conversation

rahulsom
Copy link

@rahulsom rahulsom commented Jun 16, 2023

This change is comprised of 4 individual commits that make use of a more modern javascript style.

  1. Anonymous functions are replaced by arrow functions
  2. String concatenations have been replaced by JS templates.
  3. Within the module jQuery3 and $ are one and the same. The code uses $ so the code looks like typical jQuery code and IDEs recognize that the symbol is not undefined.
  4. Usage of var has been replaced by let. This reduces the scope of variables.

All these changes should make further refactoring of code easier.

Testing done

This change only affects the UI and currently, the UI tests are not enabled.
I've used #71 to validate the behavior. Unfortunately, that cannot be merged.
I've also checked the behavior manually.

Submitter checklist

Preview Give feedback

@kinow
Copy link
Member

kinow commented Jun 16, 2023

This has been on my todo list for ages. Thanks!!!

rahulsom added 4 commits June 16, 2023 13:23
Variables declared by `let` are only available inside the block where they’re defined.
Variables declared by `const` are like those declared by `let` but also cannot be mutated.
`const` validation seems to fail with htmlunit. So everything is `let`.

Variables declared by `var` are available throughout the function in which they’re declared.

This change makes further refactoring easier.
Copy link
Member

@kinow kinow left a comment

Choose a reason for hiding this comment

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

Looks good to me! Thanks!

I will just do a quick test (will try today, but on a tight schedule this week) running Jenkins from this branch and if there's no smoke will merge it. Thanks!

@kinow
Copy link
Member

kinow commented Jun 19, 2023

Everything appears to be working fine! LGTM, thanks!

image

@kinow kinow closed this in 055802d Jun 19, 2023
kinow added a commit that referenced this pull request Jun 19, 2023
@kinow
Copy link
Member

kinow commented Jun 19, 2023

Squashed, merged, changelog added. Thanks @rahulsom !

@rahulsom rahulsom deleted the modernize-js branch July 4, 2023 20:45
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