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

lib/util.js: Modernize Javascript code and usages #435

Open
8 tasks
StephenChan opened this issue Feb 2, 2022 · 0 comments
Open
8 tasks

lib/util.js: Modernize Javascript code and usages #435

StephenChan opened this issue Feb 2, 2022 · 0 comments
Labels
Milestone

Comments

@StephenChan
Copy link
Member

  • Use ES6 classes and syntax.
  • util.trimSpaces() is obsoleted by the standard String.prototype.trim().
  • Function.prototype.curry() is probably not necessary. Better to learn and directly use the Javascript idiom(s) for partial function application. Not sure off the top of my head, but may involve bind() or apply().
  • String.prototype.endsWith() and String.prototype.startsWith() are already built into modern browsers.
  • String.prototype.format() is obsoleted by template literals.
  • $(document).ajaxSend() should either be canned if not needed, or reworked to work for fetch() as well as jQuery.ajax(). The current Django docs show how to rework this in a way that's agnostic to the Ajax implementation.
  • Try not to rely on jQuery in general.
  • While we're at it, update docs/design/browser_compatibility.rst to stop caring about IE compatibility altogether; doesn't seem worth the trouble for us.
@StephenChan StephenChan added this to the 2.0 milestone Feb 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant