FRE-600: Fix code review blockers

- Consolidated duplicate UndoManagers to single instance
- Fixed connection promise to only resolve on 'connected' status
- Fixed WebSocketProvider import (WebsocketProvider)
- Added proper doc.destroy() cleanup
- Renamed isPresenceInitialized property to avoid conflict

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
2026-04-25 00:08:01 -04:00
parent 65b552bb08
commit 7c684a42cc
48450 changed files with 5679671 additions and 383 deletions

View File

@@ -0,0 +1,67 @@
var fs = require('fs-extra');
var obj = require('../util/object-path');
/**
* Converts the file contents generated by BenchmarkStatsProcessor to a DataSetComparisonResult array.
* @param {Array} arrFileObj
* @returns {Object}
*/
function mergeToMap(arrFileObj) {
return arrFileObj.reduce(function(result, fileObj) {
var name;
var libData;
for (name in fileObj) {
libData = fileObj[name];
obj.setObject(result, [libData.suite, libData.browser, libData.name], libData);
}
return result;
}, {});
}
/**
* Since every machine has its own speed, absolute test results have no absolute value.
* However, (I suspect that) the one that is the fastest will relatively be faster than the others.
* @typedef {Object} DataSetComparisonResultItem
* @prop {string} name
* @prop {string} browser
* @prop {string} suite
* @prop {boolean} success
* @prop {number} hz
* @prop {boolean} fastest - is fastest or, statistic significantly speaking, no slower than the fastest
* @prop {number} rme - relative margin of error (expressed as decimal, NOT %)
* @prop {number} rhz - relative hz compared to the fastest (expressed as decimal, NOT %)
* @prop {number} sampleSize
*/
/**
* Describes all results of a single test suite within single browser
* @typedef {Object} DataSetComparisonResult
* @prop {string} browser
* @prop {string} suite
* @prop {Object<DataSetComparisonResultItem>} resultMap - key is libName
*/
/**
*
* @param {string[]} files
* @returns {Promise<DataSetComparisonResult[]>}
*/
module.exports = function(files) {
return Promise
.all(files.map(function(file) {
return fs.readJson(file);
}))
.then(function (arrFileObj) {
var map = mergeToMap(arrFileObj);
var result = [];
var suiteName;
var browserName;
var suite;
for (suiteName in map) {
suite = map[suiteName];
for (browserName in suite) {
result.push({ browser: browserName, suite: suiteName, resultMap: suite[browserName]})
}
}
return result;
});
};

70
node_modules/fast-stable-stringify/cli/format-table.js generated vendored Normal file
View File

@@ -0,0 +1,70 @@
var table = require('markdown-table');
// Crude, but should be enough internally
function toFixedWidth(value, maxChars) {
var result = value.toFixed(2).substr(0, maxChars);
if (result[result.length - 1] == '.') {
result = result.substr(0, result.length - 2) + ' ';
}
return result;
}
/**
*
* @param {DataSetComparisonResult[]} results
* @param {Object} [options]
*/
function createTable(results, options) {
options || (options = {});
var columnAlign = ['l', 'l'];
var header = ['Suite', 'Browser'];
var libNames = [];
var rows = [];
var errorCell = 'X';
var emptyCell = '?';
var hideColumns = options.hideColumns || [];
var compareTo = options.compareTo;
results.forEach(function(comparisonResult) {
var resultMap = comparisonResult.resultMap;
var libName;
var libResults;
var result;
var compareRHZ = resultMap[compareTo] && resultMap[compareTo].rhz || 1;
for (libName in resultMap) {
// dictates order
if (libNames.indexOf(libName) === -1 && hideColumns.indexOf(libName) === -1) {
libNames.push(libName);
columnAlign.push('r');
rows.forEach(function(row) {
// new column added, push empty element
row.push(emptyCell);
})
}
}
libResults = libNames.map(function(libName) {
result = resultMap[libName];
if (result) {
if (result.success) {
return (result.fastest ? '*' : '')
+ (100 * result.rhz / compareRHZ).toFixed(2) + '% '
+ '(\xb1' + toFixedWidth(100 * (result.rhz / compareRHZ) * result.rme, 4) + '%)';
} else {
return errorCell;
}
} else {
return emptyCell;
}
});
rows.push([comparisonResult.suite, comparisonResult.browser].concat(libResults));
});
// slap header before it
rows.unshift(header.concat(libNames));
return table(rows, { align: columnAlign });
}
module.exports = function(data, options) {
return createTable(data, options);
};

19
node_modules/fast-stable-stringify/cli/index.js generated vendored Normal file
View File

@@ -0,0 +1,19 @@
var argv = require('minimist')(process.argv.slice(2));
var formatTable = require('./format-table');
var glob = require('glob');
var filesToComparisonResults = require('./files-to-comparison-results');
var pattern = argv._.length > 1 ? '{' + argv._.slice(0).join(',') + '}' : argv._[0];
var fileList = glob.sync(pattern, { nodir: true });
//console.log(fileList);
filesToComparisonResults(fileList)
.then(function(comparisonResult) {
return formatTable(comparisonResult, { hideColumns: [], compareTo: 'json-stable-stringify@1.0.1' })
})
.then(function(str) {
console.log(str);
})
.catch(function(err) {
console.error(err);
});