v136 ยท javascript

Update ProgressEvent to use double type for 'loaded' and 'total'

The ProgressEvent has attributes `loaded` and `total` indicating the progress, and their type is `unsigned long long` now. With this feature, the type for these two attributes is changed to `double` instead, which gives the developer more control over the value. For example, the developers can now create a ProgressEvent with the `total` of 1 and the `load

concepts

  1. Progress double

    ProgressEvent.loaded / total move to double. Supports transfers over 4GB without overflowing.

  2. AI streaming progress

    The other half of the change: fractional progress where total = 1 and loaded ramps 0..1 — the Writing Assistance APIs use case that drove the type change.

  3. Overflow Stress Test

    Synthesise events with loaded/total up to 2 PB. Watch the bar cross the pre-136 32-bit overflow line (4.29 GB) and keep going — double stays exact up to 2 53.

  4. Precision Calculator

    Drag a slider to emit fractional ProgressEvent values (0.0โ€“1.0) for the AI streaming use case, build custom events with any loaded/total values, and see an overflow boundary table showing where the old unsigned long long integer type failed and where double stays exact.

why it shipped

https://github.com/webmachinelearning/writing-assistance-apis/issues/15

references