Get rid of usage of monkey-patched String methods.

Review Request #13491 — Created Jan. 8, 2024 and discarded

Information

Djblets
release-5.x

Reviewers

From a very early time, we had a few things that Djblets monkey-patched
into the standard String class for JS code. This change gets rid of the
use of those in the RB codebase:

  • String.trim() is a standard-library method that does what our
    String.strip() method did.
  • _.escape() and _.unescape() do what our String.htmlEncode() and
    String.htmlDecode() methods did (plus are slightly more complete).
  • String.stripTags() was only used in one place, which was already
    doing some regex transformations, so I've just moved the
    implementation of that into where it's used. We don't use that option
    at all, though, so perhaps we should just remove it from the inline
    editor too.
  • String.truncate() wasn't used anywhere.

Ran js-tests.

Summary ID
Get rid of usage of monkey-patched String methods.
From a very early time, we had a few things that Djblets monkey-patched into the standard String class for JS code. This change gets rid of the use of those in the RB codebase: * `String.trim()` is a standard-library method that does what our `String.strip()` method did. * `_.escape()` and `_.unescape()` do what our `String.htmlEncode()` and `String.htmlDecode()` methods did (plus are slightly more complete). * `String.stripTags()` was only used in one place, which was already doing some regex transformations, so I've just moved the implementation of that into where it's used. We don't use that option at all, though, so perhaps we should just remove it from the inline editor too. * `String.truncate()` wasn't used anywhere. Testing Done: Ran js-tests.
b4a4809f6c2f0bd57f9456a5a01c5c68d00c4dc8
Description From Last Updated

All these methods but truncate are still in use in Review Board. Could also be used in extensions. I'm kinda …

chipx86chipx86
chipx86
  1. 
      
  2. Show all issues

    All these methods but truncate are still in use in Review Board. Could also be used in extensions. I'm kinda feeling like we just keep these around, deprecated but available.

    1. At they very least I'd want a 2-release deprecation period.

  3. 
      
david
Review request changed
Status:
Discarded