dependencies: Upgrade JavaScript dependencies.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg 2024-10-03 16:30:52 -07:00 committed by Tim Abbott
parent 7bd0df408d
commit 7bd5ec28ae
14 changed files with 2910 additions and 2728 deletions

View File

@ -125,6 +125,7 @@ module.exports = {
"unicorn/no-process-exit": "off", "unicorn/no-process-exit": "off",
"unicorn/no-useless-undefined": "off", "unicorn/no-useless-undefined": "off",
"unicorn/numeric-separators-style": "off", "unicorn/numeric-separators-style": "off",
"unicorn/prefer-global-this": "off",
"unicorn/prefer-module": "off", "unicorn/prefer-module": "off",
"unicorn/prefer-node-protocol": "off", "unicorn/prefer-node-protocol": "off",
"unicorn/prefer-string-raw": "off", "unicorn/prefer-string-raw": "off",

View File

@ -11,7 +11,7 @@
}, },
"dependencies": { "dependencies": {
"@astrojs/check": "^0.9.3", "@astrojs/check": "^0.9.3",
"@astrojs/starlight": "^0.26.1", "@astrojs/starlight": "^0.28.2",
"astro": "^4.10.2", "astro": "^4.10.2",
"sharp": "^0.33.5", "sharp": "^0.33.5",
"typescript": "^5.4.5" "typescript": "^5.4.5"

View File

@ -1,6 +1,6 @@
{ {
"private": true, "private": true,
"packageManager": "pnpm@9.8.0+sha512.8e4c3550fb500e808dbc30bb0ce4dd1eb614e30b1c55245f211591ec2cdf9c611cabd34e1364b42f564bd54b3945ed0f49d61d1bbf2ec9bd74b866fcdc723276", "packageManager": "pnpm@9.12.0+sha512.4abf725084d7bcbafbd728bfc7bee61f2f791f977fd87542b3579dcb23504d170d46337945e4c66485cd12d588a0c0e570ed9c477e7ccdd8507cf05f3f92eaca",
"dependencies": { "dependencies": {
"@babel/core": "^7.5.5", "@babel/core": "^7.5.5",
"@babel/preset-env": "^7.5.5", "@babel/preset-env": "^7.5.5",
@ -12,7 +12,8 @@
"@giphy/js-components": "^5.13.0", "@giphy/js-components": "^5.13.0",
"@giphy/js-fetch-api": "^5.6.0", "@giphy/js-fetch-api": "^5.6.0",
"@koa/bodyparser": "^5.0.0", "@koa/bodyparser": "^5.0.0",
"@sentry/browser": "^7.51.2", "@sentry/browser": "^8.33.1",
"@sentry/core": "^8.33.1",
"@uppy/core": "^4.2.0", "@uppy/core": "^4.2.0",
"@uppy/drag-drop": "^4.0.2", "@uppy/drag-drop": "^4.0.2",
"@uppy/progress-bar": "^4.0.0", "@uppy/progress-bar": "^4.0.0",
@ -31,7 +32,7 @@
"core-js": "^3.37.0", "core-js": "^3.37.0",
"css-loader": "^7.1.1", "css-loader": "^7.1.1",
"css-minimizer-webpack-plugin": "^7.0.0", "css-minimizer-webpack-plugin": "^7.0.0",
"date-fns": "^3.3.1", "date-fns": "^4.1.0",
"email-addresses": "^5.0.0", "email-addresses": "^5.0.0",
"emoji-datasource-google": "^15.0.1", "emoji-datasource-google": "^15.0.1",
"emoji-datasource-google-blob": "npm:emoji-datasource-google@^3.0.0", "emoji-datasource-google-blob": "npm:emoji-datasource-google@^3.0.0",
@ -124,17 +125,17 @@
"commander": "^12.0.0", "commander": "^12.0.0",
"confusing-browser-globals": "^1.0.11", "confusing-browser-globals": "^1.0.11",
"css.escape": "^1.5.1", "css.escape": "^1.5.1",
"diff": "^5.0.0", "diff": "^7.0.0",
"difflib": "^0.2.4", "difflib": "^0.2.4",
"enhanced-resolve": "^5.8.2", "enhanced-resolve": "^5.8.2",
"es-check": "^7.0.0", "es-check": "^7.0.0",
"eslint": "^8.0.1", "eslint": "^8.0.1",
"eslint-config-prettier": "^9.0.0", "eslint-config-prettier": "^9.0.0",
"eslint-import-resolver-webpack": "^0.13.4", "eslint-import-resolver-webpack": "^0.13.4",
"eslint-plugin-formatjs": "^4.0.2", "eslint-plugin-formatjs": "^5.0.0",
"eslint-plugin-import": "^2.22.0", "eslint-plugin-import": "^2.22.0",
"eslint-plugin-no-jquery": "^3.0.2", "eslint-plugin-no-jquery": "^3.0.2",
"eslint-plugin-unicorn": "^55.0.0", "eslint-plugin-unicorn": "^56.0.0",
"jsdom": "^25.0.0", "jsdom": "^25.0.0",
"minimist": "^1.2.6", "minimist": "^1.2.6",
"mkdirp": "^3.0.1", "mkdirp": "^3.0.1",
@ -142,8 +143,8 @@
"nyc": "^17.0.0", "nyc": "^17.0.0",
"openapi-examples-validator": "^5.0.0", "openapi-examples-validator": "^5.0.0",
"prettier": "^3.0.0", "prettier": "^3.0.0",
"puppeteer": "^22.2.0", "puppeteer": "^23.5.0",
"source-map": "npm:source-map-js@1.0.1", "source-map": "npm:source-map-js@^1.2.1",
"stylelint": "^16.2.0", "stylelint": "^16.2.0",
"stylelint-config-standard": "^36.0.0", "stylelint-config-standard": "^36.0.0",
"svgo": "^3.0.0", "svgo": "^3.0.0",
@ -159,9 +160,10 @@
}, },
"pnpm": { "pnpm": {
"overrides": { "overrides": {
"source-map@^0.6": "npm:source-map-js@1.0.1" "source-map@^0.6": "npm:source-map-js@^1.2.1"
}, },
"patchedDependencies": { "patchedDependencies": {
"puppeteer-core": "patches/puppeteer-core.patch",
"source-sans@3.46.0": "patches/source-sans@3.46.0.patch", "source-sans@3.46.0": "patches/source-sans@3.46.0.patch",
"tippy.js@6.3.7": "patches/tippy.js@6.3.7.patch" "tippy.js@6.3.7": "patches/tippy.js@6.3.7.patch"
} }

View File

@ -0,0 +1,56 @@
diff --git a/lib/cjs/puppeteer/common/QueryHandler.js b/lib/cjs/puppeteer/common/QueryHandler.js
index db0ff2ee001ac452b6de5804ec8810e566992299..13437d905fe4fca94ad69e4e2fd95ba6b2cce89a 100644
--- a/lib/cjs/puppeteer/common/QueryHandler.js
+++ b/lib/cjs/puppeteer/common/QueryHandler.js
@@ -163,8 +163,7 @@ class QueryHandler {
return await frame.isolatedRealm().adoptHandle(elementOrFrame);
})(), false);
const { visible = false, hidden = false, timeout, signal } = options;
- const polling = options.polling ??
- (visible || hidden ? "raf" /* PollingOptions.RAF */ : "mutation" /* PollingOptions.MUTATION */);
+ const polling = visible || hidden ? "raf" /* PollingOptions.RAF */ : options.polling;
try {
const env_4 = { stack: [], error: void 0, hasError: false };
try {
diff --git a/lib/es5-iife/puppeteer-core-browser.js b/lib/es5-iife/puppeteer-core-browser.js
index 3262ea9f5fed2d0e3d7a0ece16ad31c7e5bc4cf6..f73deab795a92d80c913adafb6c3eff7eda5e5e0 100644
--- a/lib/es5-iife/puppeteer-core-browser.js
+++ b/lib/es5-iife/puppeteer-core-browser.js
@@ -4594,7 +4594,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
timeout,
signal
} = options;
- const polling = options.polling ?? (visible || hidden ? "raf" /* PollingOptions.RAF */ : "mutation" /* PollingOptions.MUTATION */);
+ const polling = visible || hidden ? "raf" /* PollingOptions.RAF */ : options.polling;
try {
const env_4 = {
stack: [],
diff --git a/lib/esm/puppeteer/common/QueryHandler.js b/lib/esm/puppeteer/common/QueryHandler.js
index b07ddf54fb1830c8ddc42dc6d0452b288696caa4..cb0203c7c1f98f03ea6658b33c8da3710ab71b29 100644
--- a/lib/esm/puppeteer/common/QueryHandler.js
+++ b/lib/esm/puppeteer/common/QueryHandler.js
@@ -160,8 +160,7 @@ export class QueryHandler {
return await frame.isolatedRealm().adoptHandle(elementOrFrame);
})(), false);
const { visible = false, hidden = false, timeout, signal } = options;
- const polling = options.polling ??
- (visible || hidden ? "raf" /* PollingOptions.RAF */ : "mutation" /* PollingOptions.MUTATION */);
+ const polling = visible || hidden ? "raf" /* PollingOptions.RAF */ : options.polling;
try {
const env_4 = { stack: [], error: void 0, hasError: false };
try {
diff --git a/src/common/QueryHandler.ts b/src/common/QueryHandler.ts
index f377771f22a193164760e703c2f3af123588ab16..db10e1cf94ada080c710f33d4dda6f4a116400fa 100644
--- a/src/common/QueryHandler.ts
+++ b/src/common/QueryHandler.ts
@@ -162,9 +162,7 @@ export class QueryHandler {
})();
const {visible = false, hidden = false, timeout, signal} = options;
- const polling =
- options.polling ??
- (visible || hidden ? PollingOptions.RAF : PollingOptions.MUTATION);
+ const polling = visible || hidden ? PollingOptions.RAF : options.polling;
try {
signal?.throwIfAborted();

File diff suppressed because it is too large Load Diff

View File

@ -49,4 +49,4 @@ API_FEATURE_LEVEL = 299 # Last bumped for org level group create/manage permiss
# historical commits sharing the same major version, in which case a # historical commits sharing the same major version, in which case a
# minor version bump suffices. # minor version bump suffices.
PROVISION_VERSION = (293, 1) # bumped 2024-09-24 to upgrade Transifex CLI PROVISION_VERSION = (294, 0) # bumped 2024-10-03 to upgrade JavaScript dependencies

View File

@ -25,6 +25,7 @@ const keys_map = new Map([
const fn_shortcuts = new Set(["Home", "End", "PgUp", "PgDn"]); const fn_shortcuts = new Set(["Home", "End", "PgUp", "PgDn"]);
export function has_mac_keyboard(): boolean { export function has_mac_keyboard(): boolean {
// eslint-disable-next-line @typescript-eslint/no-deprecated
return /mac/i.test(navigator.platform); return /mac/i.test(navigator.platform);
} }

View File

@ -194,6 +194,7 @@ export function copy_handler(): void {
// TODO: Add a reference for this statement, I just tested // TODO: Add a reference for this statement, I just tested
// it in console for various selection directions and found this // it in console for various selection directions and found this
// to be the case not sure why there is no online reference for it. // to be the case not sure why there is no online reference for it.
// eslint-disable-next-line @typescript-eslint/no-deprecated
document.execCommand("copy"); document.execCommand("copy");
return; return;
} }
@ -201,6 +202,7 @@ export function copy_handler(): void {
if (!skip_same_td_check && start_id === end_id) { if (!skip_same_td_check && start_id === end_id) {
// Check whether the selection both starts and ends in the // Check whether the selection both starts and ends in the
// same message. If so, Let the browser handle this. // same message. If so, Let the browser handle this.
// eslint-disable-next-line @typescript-eslint/no-deprecated
document.execCommand("copy"); document.execCommand("copy");
return; return;
} }
@ -219,6 +221,7 @@ export function copy_handler(): void {
// Select div so that the browser will copy it // Select div so that the browser will copy it
// instead of copying the original selection // instead of copying the original selection
select_div($div, selection); select_div($div, selection);
// eslint-disable-next-line @typescript-eslint/no-deprecated
document.execCommand("copy"); document.execCommand("copy");
remove_div($div, ranges); remove_div($div, ranges);
} }

View File

@ -3,7 +3,11 @@
import type {MessageDescriptor} from "@formatjs/intl"; import type {MessageDescriptor} from "@formatjs/intl";
import {DEFAULT_INTL_CONFIG, IntlErrorCode, createIntl, createIntlCache} from "@formatjs/intl"; import {DEFAULT_INTL_CONFIG, IntlErrorCode, createIntl, createIntlCache} from "@formatjs/intl";
import type {FormatXMLElementFn, PrimitiveType} from "intl-messageformat"; import type {
FormatXMLElementFn,
Options as IntlMessageFormatOptions,
PrimitiveType,
} from "intl-messageformat";
import _ from "lodash"; import _ from "lodash";
import {page_params} from "./base_page_params"; import {page_params} from "./base_page_params";
@ -26,7 +30,13 @@ export const intl = createIntl(
cache, cache,
); );
export const $t = intl.formatMessage.bind(intl); export function $t(
descriptor: MessageDescriptor,
values?: Record<string, PrimitiveType | FormatXMLElementFn<string, string>>,
opts?: IntlMessageFormatOptions,
): string {
return intl.formatMessage(descriptor, values, opts);
}
export const default_html_elements = Object.fromEntries( export const default_html_elements = Object.fromEntries(
["b", "code", "em", "i", "kbd", "p", "strong"].map((tag) => [ ["b", "code", "em", "i", "kbd", "p", "strong"].map((tag) => [

View File

@ -407,6 +407,7 @@ export function create<ItemType extends {type: string}>(
const text = e.originalEvent.clipboardData?.getData("text/plain").replaceAll("\n", ","); const text = e.originalEvent.clipboardData?.getData("text/plain").replaceAll("\n", ",");
// insert text manually // insert text manually
// eslint-disable-next-line @typescript-eslint/no-deprecated
document.execCommand("insertText", false, text); document.execCommand("insertText", false, text);
if (funcs.createPillonPaste()) { if (funcs.createPillonPaste()) {

View File

@ -266,8 +266,7 @@ export function initialize(): void {
message_list_tooltip(".message-list .message-time", { message_list_tooltip(".message-list .message-time", {
onShow(instance) { onShow(instance) {
const $time_elem = $(instance.reference); const $time_elem = $(instance.reference);
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions const $row = $time_elem.closest(".message_row");
const $row = $time_elem.closest(".message_row") as JQuery;
assert(message_lists.current !== undefined); assert(message_lists.current !== undefined);
const message = message_lists.current.get(rows.id($row))!; const message = message_lists.current.get(rows.id($row))!;
// Don't show time tooltip for locally echoed message. // Don't show time tooltip for locally echoed message.

View File

@ -1,4 +1,5 @@
import * as Sentry from "@sentry/browser"; import * as Sentry from "@sentry/browser";
import {SPAN_STATUS_OK} from "@sentry/core";
import $ from "jquery"; import $ from "jquery";
import assert from "minimalistic-assert"; import assert from "minimalistic-assert";
import {z} from "zod"; import {z} from "zod";
@ -772,7 +773,7 @@ export function show(raw_terms: NarrowTerm[], show_opts: ShowMessageViewOpts): v
op: "function", op: "function",
}; };
await Sentry.startSpan(post_span_context, async () => { await Sentry.startSpan(post_span_context, async () => {
span?.setStatus("ok"); span?.setStatus({code: SPAN_STATUS_OK});
await new Promise((resolve) => setTimeout(resolve, 0)); await new Promise((resolve) => setTimeout(resolve, 0));
resize.resize_stream_filters_container(); resize.resize_stream_filters_container();
}); });

View File

@ -79,7 +79,7 @@ if (sentry_params !== undefined) {
sampleRate: sentry_params.sample_rate, sampleRate: sentry_params.sample_rate,
tracesSampler(samplingContext) { tracesSampler(samplingContext) {
const base_rate = sentry_params.trace_rate; const base_rate = sentry_params.trace_rate;
const name = samplingContext.transactionContext.name; const name = samplingContext.name;
return base_rate * (sample_rates.get(name) ?? 1); return base_rate * (sample_rates.get(name) ?? 1);
}, },
initialScope(scope) { initialScope(scope) {

View File

@ -191,6 +191,7 @@ export function listener_for_preferred_color_scheme_change(callback: () => void)
if (media_query_list.addEventListener) { if (media_query_list.addEventListener) {
media_query_list.addEventListener("change", listener); media_query_list.addEventListener("change", listener);
} else { } else {
// eslint-disable-next-line @typescript-eslint/no-deprecated
media_query_list.addListener(listener); media_query_list.addListener(listener);
} }
} }