diff --git a/.gitignore b/.gitignore index 5aa01f82a319..5aff047b0e90 100644 --- a/.gitignore +++ b/.gitignore @@ -13,6 +13,9 @@ all.css # Coverage coverage +#Build artifacts +dist/ + # CocoaPods Pods/ diff --git a/Makefile b/Makefile index 20f547a9550f..30401bb7360c 100644 --- a/Makefile +++ b/Makefile @@ -28,8 +28,10 @@ endif all: compile deploy compile: clean - NODE_OPTIONS=--max-old-space-size=8192 \ - $(WEBPACK) + NODE_OPTIONS=--max-old-space-size=8192 $(WEBPACK) --env bundle=app & \ + NODE_OPTIONS=--max-old-space-size=8192 $(WEBPACK) --env bundle=api & \ + NODE_OPTIONS=--max-old-space-size=8192 $(WEBPACK) --env bundle=workers & \ + wait clean: rm -fr $(BUILD_DIR) diff --git a/package.json b/package.json index 66b4437adb13..083d0da4e9f9 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "@internxt/css-config": "^1.1.0", "@internxt/eslint-config-internxt": "^2.0.1", "@internxt/lib": "^1.4.1", - "@internxt/sdk": "1.15.14", + "@internxt/sdk": "1.16.3", "@internxt/ui": "0.1.15", "@jitsi/excalidraw": "https://github.com/jitsi/excalidraw/releases/download/0.18.5/jitsi-excalidraw-v0.18.5.tgz", "@jitsi/js-utils": "2.6.7", diff --git a/react/features/base/meet/general/store/auth/__tests__/actions.test.ts b/react/features/base/meet/general/store/auth/__tests__/actions.test.ts index 65729b85de05..1a2c71478596 100644 --- a/react/features/base/meet/general/store/auth/__tests__/actions.test.ts +++ b/react/features/base/meet/general/store/auth/__tests__/actions.test.ts @@ -4,6 +4,15 @@ import { LocalStorageManager } from "../../../../LocalStorageManager"; import { AUTH_ACTIONS } from "../../../../middlewares"; import { initializeAuth, loginSuccess, logout, refreshTokenSuccess } from "../actions"; +vi.mock("../../../../middlewares", () => ({ + AUTH_ACTIONS: { + INITIALIZE_AUTH: "INITIALIZE_AUTH", + LOGIN_SUCCESS: "LOGIN_SUCCESS", + LOGOUT: "LOGOUT", + REFRESH_TOKEN_SUCCESS: "REFRESH_TOKEN_SUCCESS", + }, +})); + vi.mock("../../../../LocalStorageManager", () => { const mockInstance = { getNewToken: vi.fn(), diff --git a/react/features/base/meet/services/__tests__/desktop.service.test.ts b/react/features/base/meet/services/__tests__/desktop.service.test.ts index 73c5ea87c9a3..386ebb07c5c3 100644 --- a/react/features/base/meet/services/__tests__/desktop.service.test.ts +++ b/react/features/base/meet/services/__tests__/desktop.service.test.ts @@ -2,6 +2,9 @@ import { describe, it, expect, beforeEach, afterEach, vi } from 'vitest'; import operatingSystemService, { OperatingSystem } from '../operating-system.service'; import desktopService from '../desktop.service'; +vi.mock('../../../../notifications/actions', () => ({ + showErrorNotification: vi.fn(), +})); describe('desktopService', () => { const mockFetch = vi.fn(); diff --git a/react/test/setup.ts b/react/test/setup.ts index 4b3ea7d317fc..cac71d1b1c03 100644 --- a/react/test/setup.ts +++ b/react/test/setup.ts @@ -51,6 +51,6 @@ globalThis.JitsiMeetJS = { } }; -globalThis.URL.createObjectURL = vi.fn((blob) => { - return `blob:dummy-${Date.now()}` +globalThis.URL.createObjectURL = vi.fn(() => { + return `blob:dummy-${Date.now()}`; }); diff --git a/vitest.config.ts b/vitest.config.ts index 1a39c8e1e857..72f9f724401a 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -16,6 +16,7 @@ export default defineConfig({ test: { globals: true, environment: "jsdom", + isolate: true, setupFiles: ["./react/test/setup.ts"], include: ["react/features/base/meet/**/*.{test,spec}.{js,ts,jsx,tsx}"], coverage: { diff --git a/webpack.config.js b/webpack.config.js index 97880d75d501..0d65894f3996 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -111,10 +111,7 @@ function devServerProxyBypass({ path, headers }) { function getConfig(options = {}) { const { detectCircularDeps, isProduction } = options; - const parallelism = parseInt(process.env.WEBPACK_PARALLELISM, 10); - return { - ...(parallelism > 0 ? { parallelism } : {}), devtool: isProduction ? false : "eval-source-map", mode: isProduction ? "production" : "development", module: { @@ -127,6 +124,7 @@ function getConfig(options = {}) { options: { // Avoid loading babel.config.js, since we only use it for React Native. configFile: false, + cacheDirectory: true, // XXX The require.resolve below solves failures to locate the // presets when lib-jitsi-meet, for example, is npm linked in @@ -158,8 +156,8 @@ function getConfig(options = {}) { // with core-js. useBuiltIns: "usage", - // core-js version to use, must be in sync with the version in package.json. - corejs: '3.40' + // core-js version to use, must be in sync with the version in package.json. + corejs: '3.40' } ], require.resolve('@babel/preset-react') @@ -326,6 +324,8 @@ function getDevServerConfig() { } module.exports = (_env, argv) => { + const bundleFilter = _env?.bundle; + const analyzeBundle = Boolean(process.env.ANALYZE_BUNDLE); const mode = typeof argv.mode === "undefined" ? "production" : argv.mode; const isProduction = mode === "production"; @@ -339,7 +339,7 @@ module.exports = (_env, argv) => { isProduction, }; - return [ + const allConfigs = [ { ...config, entry: { @@ -349,9 +349,6 @@ module.exports = (_env, argv) => { plugins: [ ...config.plugins, ...getBundleAnalyzerPlugin(analyzeBundle, "app"), - new webpack.DefinePlugin({ - __DEV__: !isProduction, - }), new webpack.IgnorePlugin({ resourceRegExp: /^canvas$/, contextRegExp: /resemblejs$/, @@ -364,20 +361,14 @@ module.exports = (_env, argv) => { process: "process/browser", }), new webpack.DefinePlugin({ - "process.env": (() => { - const keys = [ - "DRIVE_NEW_API_URL", - "PAYMENTS_API_URL", - "MEET_API_URL", - ]; - const env = {}; - keys.forEach((key) => { - if (process.env[key]) { - env[key] = process.env[key]; - } - }); - return JSON.stringify(env); - })(), + __DEV__: !isProduction, + "process.env": JSON.stringify( + Object.fromEntries( + ["DRIVE_NEW_API_URL", "PAYMENTS_API_URL", "MEET_API_URL"] + .filter((k) => process.env[k]) + .map((k) => [k, process.env[k]]), + ), + ), }), new webpack.ProvidePlugin({ Buffer: ["buffer", "Buffer"], @@ -464,4 +455,18 @@ module.exports = (_env, argv) => { performance: getPerformanceHints(perfHintOptions, 30 * 1024), }, ]; + + if (bundleFilter) { + const filterMap = { + app: ['app.bundle', 'alwaysontop', 'close3'], + api: ['external_api'], + workers: ['face-landmarks-worker', 'noise-suppressor-worklet', + 'screenshot-capture-worker'], + }; + const allowed = new Set(filterMap[bundleFilter] ?? []); + return allConfigs.filter(c => + Object.keys(c.entry).some(k => allowed.has(k)) + ); + } + return allConfigs; }; diff --git a/wrangler.jsonc b/wrangler.jsonc index ac88c8b9113d..315561174dcc 100644 --- a/wrangler.jsonc +++ b/wrangler.jsonc @@ -1,5 +1,8 @@ { "name": "meet-web", "compatibility_date": "2026-01-29", - "pages_build_output_dir": "./dist" -} + "assets": { + "directory": "./dist", + "not_found_handling": "single-page-application" + } +} \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index a0fc99dcaf89..7e742920d9cf 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2655,13 +2655,12 @@ dependencies: uuid "^11.1.0" -"@internxt/sdk@1.15.14": - version "1.15.14" - resolved "https://registry.yarnpkg.com/@internxt/sdk/-/sdk-1.15.14.tgz#f9f6f35832dea50fc6642fadfd61c974ed3f1a03" - integrity sha512-QGdQg8jtR3FZCwowGoIXniN7DConu2duUcBDHsLDM5kJ6hymtXwejUzqdVg4DDSatTvvHD2YobEINgh6ND6ysw== +"@internxt/sdk@1.16.3": + version "1.16.3" + resolved "https://registry.yarnpkg.com/@internxt/sdk/-/sdk-1.16.3.tgz#b9e5fdd98352704fd78067a22da1762951deaec4" + integrity sha512-GmX9eYBOBB09wr5e9yW3gUIR3Pn2AgZBXzZd1HvzwS96AonclcEWY1/+uoZ9qLO4SdvYquiOjXfLYNJGg99ugQ== dependencies: - axios "1.15.2" - internxt-crypto "1.0.2" + axios "^1.16.0" "@internxt/ui@0.1.15": version "0.1.15" @@ -3128,23 +3127,11 @@ dependencies: eslint-scope "5.1.1" -"@noble/ciphers@^2.0.1", "@noble/ciphers@^2.1.1": +"@noble/ciphers@^2.0.1": version "2.2.0" resolved "https://registry.yarnpkg.com/@noble/ciphers/-/ciphers-2.2.0.tgz#84fb45ac9332925d643b80f89ceb0ea2f21dba95" integrity sha512-Z6pjIZ/8IJcCGzb2S/0Px5J81yij85xASuk1teLNeg75bfT07MV3a/O2Mtn1I2se43k3lkVEcFaR10N4cgQcZA== -"@noble/ciphers@^2.1.1": - version "2.2.0" - resolved "https://registry.yarnpkg.com/@noble/ciphers/-/ciphers-2.2.0.tgz#84fb45ac9332925d643b80f89ceb0ea2f21dba95" - integrity sha512-Z6pjIZ/8IJcCGzb2S/0Px5J81yij85xASuk1teLNeg75bfT07MV3a/O2Mtn1I2se43k3lkVEcFaR10N4cgQcZA== - -"@noble/curves@^2.0.1": - version "2.2.0" - resolved "https://registry.yarnpkg.com/@noble/curves/-/curves-2.2.0.tgz#981be3aadc3bbfbcdb245e78cc97aa6f759246c2" - integrity sha512-T/BoHgFXirb0ENSPBquzX0rcjXeM6Lo892a2jlYJkqk83LqZx0l1Of7DzlKJ6jkpvMrkHSnAcgb5JegL8SeIkQ== - dependencies: - "@noble/hashes" "2.2.0" - "@noble/curves@~2.0.0": version "2.0.1" resolved "https://registry.yarnpkg.com/@noble/curves/-/curves-2.0.1.tgz#64ba8bd5e8564a02942655602515646df1cdb3ad" @@ -3157,16 +3144,16 @@ resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-2.0.1.tgz#fc1a928061d1232b0a52bb754393c37a5216c89e" integrity sha512-XlOlEbQcE9fmuXxrVTXCTlG2nlRXa9Rj3rr5Ue/+tX+nmkgbX720YHh0VR3hBF9xDvwnb8D2shVGOwNx+ulArw== -"@noble/hashes@2.2.0", "@noble/hashes@^2.0.1": - version "2.2.0" - resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-2.2.0.tgz#22da1d16a469954fce877055d559900a6c73b63b" - integrity sha512-IYqDGiTXab6FniAgnSdZwgWbomxpy9FtYvLKs7wCUs2a8RkITG+DFGO1DM9cr+E3/RgADRpFjrKVaJ1z6sjtEg== - "@noble/hashes@^1.2.0": version "1.8.0" resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.8.0.tgz#cee43d801fcef9644b11b8194857695acd5f815a" integrity sha512-jCs9ldd7NwzpgXDIf6P3+NrHh9/sD6CQdxHyjQI+h/6rDNo88ypBxxz45UDuZHz9r3tNz7N/VInSVoVdtXEI4A== +"@noble/hashes@^2.0.1": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-2.2.0.tgz#22da1d16a469954fce877055d559900a6c73b63b" + integrity sha512-IYqDGiTXab6FniAgnSdZwgWbomxpy9FtYvLKs7wCUs2a8RkITG+DFGO1DM9cr+E3/RgADRpFjrKVaJ1z6sjtEg== + "@noble/post-quantum@^0.5.2": version "0.5.4" resolved "https://registry.yarnpkg.com/@noble/post-quantum/-/post-quantum-0.5.4.tgz#bd1095647c61e4c8fd317fa8a3977db8cd28a4b9" @@ -4877,19 +4864,6 @@ resolved "https://registry.yarnpkg.com/@sayem314/react-native-keep-awake/-/react-native-keep-awake-1.3.1.tgz#59cd52923ba3000adfec6918a3a935ae335575a7" integrity sha512-gAqLCVQ2SgrMki9MZJzQiYn9EjOGDYze+dYKs7s7T4qfRrUxCK8Pe50mE0Y/WQqzaYY6uzdjTHzmWhACiEy5Zw== -"@scure/base@2.2.0": - version "2.2.0" - resolved "https://registry.yarnpkg.com/@scure/base/-/base-2.2.0.tgz#1311378ed247df6d58f8eb8941921965e97e5747" - integrity sha512-b8XEupJibegiXV+tDUseI8oLQc8ei3d/4Jkb2RpbHh3MfE054ov3uIz2dhFkB3FI8iwYkEh0gGCApkrYggkPNg== - -"@scure/bip39@^2.0.1": - version "2.2.0" - resolved "https://registry.yarnpkg.com/@scure/bip39/-/bip39-2.2.0.tgz#7a3da0564aa2af919280a12b892d4b57e1bf30be" - integrity sha512-T/Bj/YvYMNkIPq6EENO6/rcs2e7qTNuyoUXf0KBFDmp0ZDu0H2X4Lq6yC3i0c8PcWkov5EbW+yQZZbdMmk154A== - dependencies: - "@noble/hashes" "2.2.0" - "@scure/base" "2.2.0" - "@sec-ant/readable-stream@^0.4.1": version "0.4.1" resolved "https://registry.yarnpkg.com/@sec-ant/readable-stream/-/readable-stream-0.4.1.tgz#60de891bb126abfdc5410fdc6166aca065f10a0c" @@ -7118,12 +7092,12 @@ available-typed-arrays@^1.0.7: dependencies: possible-typed-array-names "^1.0.0" -axios@1.15.2: - version "1.15.2" - resolved "https://registry.yarnpkg.com/axios/-/axios-1.15.2.tgz#eb8fb6d30349abace6ade5b4cb4d9e8a0dc23e5b" - integrity sha512-wLrXxPtcrPTsNlJmKjkPnNPK2Ihe0hn0wGSaTEiHRPxwjvJwT3hKmXF4dpqxmPO9SoNb2FsYXj/xEo0gHN+D5A== +axios@^1.16.0: + version "1.16.0" + resolved "https://registry.yarnpkg.com/axios/-/axios-1.16.0.tgz#f8e5dd931cef2a5f8c32216d5784eda2f8750eb7" + integrity sha512-6hp5CwvTPlN2A31g5dxnwAX0orzM7pmCRDLnZSX772mv8WDqICwFjowHuPs04Mc8deIld1+ejhtaMn5vp6b+1w== dependencies: - follow-redirects "^1.15.11" + follow-redirects "^1.16.0" form-data "^4.0.5" proxy-from-env "^2.1.0" @@ -10617,11 +10591,6 @@ flatted@^3.2.9: resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.3.3.tgz#67c8fad95454a7c7abebf74bb78ee74a44023358" integrity sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg== -flexsearch@^0.8.205: - version "0.8.212" - resolved "https://registry.yarnpkg.com/flexsearch/-/flexsearch-0.8.212.tgz#b9509af778a991b938292e36fe0809a4ece4b940" - integrity sha512-wSyJr1GUWoOOIISRu+X2IXiOcVfg9qqBRyCPRUdLMIGJqPzMo+jMRlvE83t14v1j0dRMEaBbER/adQjp6Du2pw== - flow-enums-runtime@^0.0.6: version "0.0.6" resolved "https://registry.yarnpkg.com/flow-enums-runtime/-/flow-enums-runtime-0.0.6.tgz#5bb0cd1b0a3e471330f4d109039b7eba5cb3e787" @@ -10644,7 +10613,7 @@ follow-redirects@^1.0.0: resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.11.tgz#777d73d72a92f8ec4d2e410eb47352a56b8e8340" integrity sha512-deG2P0JfjrTxl50XGCDyfI97ZGVCxIpfKYmfyrQ54n5FO/0gfIES8C/Psl6kWVDolizcaaxZJnTS0QSMxvnsBQ== -follow-redirects@^1.15.11: +follow-redirects@^1.16.0: version "1.16.0" resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.16.0.tgz#28474a159d3b9d11ef62050a14ed60e4df6d61bc" integrity sha512-y5rN/uOsadFT/JfYwhxRS5R7Qce+g3zG97+JrtFZlC9klX/W5hD7iiLzScI4nZqUS7DNUdhPgw4xI8W2LuXlUw== @@ -11056,11 +11025,6 @@ hash-base@~3.0.4: inherits "^2.0.4" safe-buffer "^5.2.1" -hash-wasm@^4.12.0: - version "4.12.0" - resolved "https://registry.yarnpkg.com/hash-wasm/-/hash-wasm-4.12.0.tgz#f9f1a9f9121e027a9acbf6db5d59452ace1ef9bb" - integrity sha512-+/2B2rYLb48I/evdOIhP+K/DD2ca2fgBjp6O+GBEnCDk2e4rpeXIK8GvIyRPjTezgmWn9gmKwkQjjx6BtqDHVQ== - hash.js@^1.0.0, hash.js@^1.0.3: version "1.1.7" resolved "https://registry.yarnpkg.com/hash.js/-/hash.js-1.1.7.tgz#0babca538e8d4ee4a0f8988d68866537a003cf42" @@ -11289,11 +11253,6 @@ human-signals@^8.0.1: resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-8.0.1.tgz#f08bb593b6d1db353933d06156cedec90abe51fb" integrity sha512-eKCa6bwnJhvxj14kZk5NCPc6Hb6BdsU9DZcOnmQKSnO1VKrfV0zCvtttPZUsBvjmNDn8rpcJfpwSYnHBjc95MQ== -husky@^9.1.7: - version "9.1.7" - resolved "https://registry.yarnpkg.com/husky/-/husky-9.1.7.tgz#d46a38035d101b46a70456a850ff4201344c0b2d" - integrity sha512-5gs5ytaNjBrh5Ow3zrvdUUY+0VxIuWVL4i9irt6friV+BqdCfmV11CQTWMiBYWHbXhco+J1kHfTOUkePhCDvMA== - hyperdyperid@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/hyperdyperid/-/hyperdyperid-1.2.0.tgz#59668d323ada92228d2a869d3e474d5a33b69e6b" @@ -11372,11 +11331,6 @@ idb-keyval@6.0.3: dependencies: safari-14-idb-fix "^3.0.0" -idb@^8.0.3: - version "8.0.3" - resolved "https://registry.yarnpkg.com/idb/-/idb-8.0.3.tgz#c91e558f15a8d53f1d7f53a094d226fc3ad71fd9" - integrity sha512-LtwtVyVYO5BqRvcsKuB2iUMnHwPVByPCXFXOpuU96IZPPoPN6xjOGxZQ74pgSVVLQWtUOYgyeL4GE98BY5D3wg== - ieee754@^1.1.13, ieee754@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352" @@ -11520,22 +11474,6 @@ internmap@^1.0.0: resolved "https://registry.yarnpkg.com/internmap/-/internmap-1.0.1.tgz#0017cc8a3b99605f0302f2b198d272e015e5df95" integrity sha512-lDB5YccMydFBtasVtxnZ3MRBHuaoE8GKsppq+EchKL2U4nK/DmEpPHNH8MZe5HkMtpSiTSOZwfN0tzYjO/lJEw== -internxt-crypto@0.0.14: - version "0.0.14" - resolved "https://registry.yarnpkg.com/internxt-crypto/-/internxt-crypto-0.0.14.tgz#1290b2a70190c23d25b83483de8200d9eafae00f" - integrity sha512-gIvqgou0r86kSk6x2t6pxAh9dJiob/sQ1Y3TdGnAF4Qq2RD++4Aq1b6NY2UqfUYV4vPhWsd2BkFS71jAyVrXpA== - dependencies: - "@noble/ciphers" "^2.1.1" - "@noble/curves" "^2.0.1" - "@noble/hashes" "^2.0.1" - "@noble/post-quantum" "^0.5.2" - "@scure/bip39" "^2.0.1" - flexsearch "^0.8.205" - hash-wasm "^4.12.0" - husky "^9.1.7" - idb "^8.0.3" - uuid "^13.0.0" - interpret@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/interpret/-/interpret-3.1.1.tgz#5be0ceed67ca79c6c4bc5cf0d7ee843dcea110c4" @@ -17736,11 +17674,6 @@ uuid@^11.1.0: resolved "https://registry.yarnpkg.com/uuid/-/uuid-11.1.0.tgz#9549028be1753bb934fc96e2bca09bb4105ae912" integrity sha512-0/A9rDy9P7cJ+8w1c9WD9V//9Wj15Ce2MPz8Ri6032usz+NfePxx5AcN3bN+r6ZL6jEo066/yNYB3tn4pQEx+A== -uuid@^13.0.0: - version "13.0.2" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-13.0.2.tgz#41bc9c07b12f665089c205f6507976adbdf84ff8" - integrity sha512-vzi9uRZ926x4XV73S/4qQaTwPXM2JBj6/6lI/byHH1jOpCzb0zDbfytgA9LcN/hzb2l7WQSQnxITOVx5un/wGw== - uuid@^8.3.2: version "8.3.2" resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2"