Closed Bug 1917885 Opened 3 months ago Closed 2 months ago

[Outreachy] Ship Uint8Array to/from base64 and hex

Categories

(Core :: JavaScript Engine, task, P2)

task

Tracking

()

RESOLVED FIXED
133 Branch
Tracking Status
relnote-firefox --- 133+
firefox133 --- fixed

People

(Reporter: dminor, Assigned: temidayoazeez032)

References

(Blocks 1 open bug)

Details

(Keywords: dev-doc-complete)

Attachments

(1 file)

The initial support for this landed in Firefox 126, I think we can consider shipping this in the next few releases.

Severity: -- → N/A
Priority: -- → P2
Status: NEW → ASSIGNED
Keywords: dev-doc-needed

This bug is to ship a new feature in SpiderMonkey. There's a checklist in the build system documentation, specifically the part that says "Ship the feature".

This feature is controlled by the "javascript.options.experimental.uint8array_base64" preference.

To enable it, do the following:

  1. Change the default value from "false" to "true" in StaticPrefList.yaml
  2. Move the preference block outside of the #ifdef NIGHTLY block, e.g. to here. Moving it outside of #ifdef NIGHTLY will make it available on beta and release versions of Firefox.
  3. Similarly, we need to move the check in JSObject.cpp outside of the #ifdef NIGHTLY block, by moving the code just above the #ifdef NIGHTLY block.
  4. And in one last place, we also need to do this in js/src/shell/js.cpp :)
  5. Once this is done, you need to check to see if changes are necessary to js/xpconnect/tests/chrome/test_xrayToJS.xhtml. This is a browser test, not a SpiderMonkey shell test, so you would need to modify your mozconfig to build the full browser. If you're not able to do this (building the full browser can be challenging on older computers) please put your work in progress up for review here, and I will run the test for you on my system, and let you know if any changes are necessary.
Assignee: dminor → nobody
Blocks: 1916757
Status: ASSIGNED → NEW
Summary: Ship Uint8Array to/from base64 and hex → [Outreachy] Ship Uint8Array to/from base64 and hex

I am looking into this issue.

Assignee: nobody → temidayoazeez032
Status: NEW → ASSIGNED
Pushed by dminor@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/725fc4cc10e7 [Outreachy] Ship Uint8Array to/from base64 and hex; r=dminor

I am not sure what might be causing the failure.

Flags: needinfo?(temidayoazeez032)

This change added four new methods to the Uint8Array constructor: setFromBase64, setFromHex, toBase64, toHex. We probably weren't running this test with --enable-uint8array-base64 previously.

We need to modify the failing test as follows:

-  assertEq(props.length, 2);
+  if (ctor === Uint8Array) {
+    assertEq(props.length, 6);
+  } else {
+    assertEq(props.length, 2);
+  }

Please amend your current commit to include this change to the test and resubmit for review.

Flags: needinfo?(temidayoazeez032)
Pushed by dminor@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/299a8665fc20 [Outreachy] Ship Uint8Array to/from base64 and hex; r=dminor
Status: ASSIGNED → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → 133 Branch
Regressions: 1924297

Could you consider nominating this for a release note? (Process info)

Flags: needinfo?(dminor)
Flags: needinfo?(temidayoazeez032)

Release Note Request (optional, but appreciated)
[Why is this notable]: This enables new functionality on UInt8Array allowing for conversion to and from base64 and hex encoding. Developers commonly need to write their own code or use a library to do this.
[Affects Firefox for Android]: Yes.
[Suggested wording]: Methods are now available on UInt8Array to allow for conversion to and from Base64 and hexadecimal encodings, this is an implementation of a Stage 3 TC39 proposal, for more details see the proposal text at https://github.com/tc39/proposal-arraybuffer-base64.
[Links (documentation, blog post, etc)]: https://github.com/tc39/proposal-arraybuffer-base64

relnote-firefox: --- → ?
Flags: needinfo?(dminor)

Thanks, added to the Fx133 nightly release notes, please allow 30 minutes for the site to update.
Keeping the relnote-firefox flag as ? to keep it on the radar for inclusion in the final Fx133 release notes.

FYI MDN docs work for this done - see https://github.com/mdn/content/issues/36547

Added to the Fx133 release notes.
Available to preview on staging, please allow 30 minutes for the site to update.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: