Mark monkey-patched String methods as deprecated.

Review Request #13497 — Created Jan. 9, 2024 and submitted

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. For the most part these were
either unused or duplicated by library code:

  • 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 copied the
    implementation of that into where it's used.
  • String.truncate() isn't used anywhere.

This change marks all of them as deprecated and replaces our
implementation with the third-party ones where we can.

Ran js-tests.

Summary ID
Mark monkey-patched String methods as deprecated.
From a very early time, we had a few things that Djblets monkey-patched into the standard String class for JS code. For the most part these were either unused or duplicated by library code: * `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 copied the implementation of that into where it's used. * `String.truncate()` isn't used anywhere. This change marks all of them as deprecated and replaces our implementation with the third-party ones where we can. Testing Done: Ran js-tests.
f153538b8b6afd98b1629490925a32f170cf1f7d
Description From Last Updated

These should all say Djblets 6.

chipx86chipx86
chipx86
  1. 
      
  2. Show all issues

    These should all say Djblets 6.

  3. 
      
david
maubin
  1. Ship It!
  2. 
      
david
Review request changed
Status:
Completed
Change Summary:
Pushed to release-5.x (c767c4e)