A platform for community discussion. Free, open, simple.
DEV: Switch to hotlinked version of Zoom SDK (#41778)
David Taylor92bb4d422e64
diff --git a/frontend/discourse/app/lib/load-zoom-meeting-sdk.js b/frontend/discourse/app/lib/load-zoom-meeting-sdk.jsdeleted file mode 100644index 3808cc576d0..00000000000--- a/frontend/discourse/app/lib/load-zoom-meeting-sdk.js+++ /dev/null@@ -1,14 +0,0 @@-/*-Plugins & themes are unable to async-import npm modules directly.-This wrapper provides them with a way to use the Zoom Meeting SDK, while keeping the `import()` in core's codebase.-*/--// Client View (`ZoomMtg`) - renders the full Zoom client UI.-export async function loadZoomMeetingSdk() {- return (await import("@zoom/meetingsdk")).ZoomMtg;-}--// Component View (`ZoomMtgEmbedded`) - embeds Zoom inside a container element.-export async function loadZoomMeetingSdkEmbedded() {- return (await import("@zoom/meetingsdk/embedded")).default;-}diff --git a/frontend/discourse/package.json b/frontend/discourse/package.jsonindex d39c17a0ce5..eb5f2d8485f 100644--- a/frontend/discourse/package.json+++ b/frontend/discourse/package.json@@ -56,7 +56,6 @@"@lezer/highlight": "^1.2.3","@lezer/javascript": "^1.5.4","@lezer/lr": "^1.4.8",- "@zoom/meetingsdk": "6.2.0","ace-builds": "^1.44.0","chart.js": "4.5.1","chartjs-adapter-moment": "^1.0.1",@@ -95,11 +94,6 @@"prosemirror-state": "^1.4.4","prosemirror-transform": "^1.12.0","prosemirror-view": "^1.41.8",- "react": "18.2.0",- "react-dom": "18.2.0",- "react-redux": "8.1.2",- "redux": "4.2.1",- "redux-thunk": "2.4.2","rete": "^2.0.6","rete-area-plugin": "^2.1.5","rete-connection-plugin": "^2.0.5",diff --git a/plugins/discourse-calendar/assets/javascripts/discourse/components/livestream/zoom-page.gjs b/plugins/discourse-calendar/assets/javascripts/discourse/components/livestream/zoom-page.gjsindex e7015f1902e..1392b821fcc 100644--- a/plugins/discourse-calendar/assets/javascripts/discourse/components/livestream/zoom-page.gjs+++ b/plugins/discourse-calendar/assets/javascripts/discourse/components/livestream/zoom-page.gjs@@ -7,12 +7,12 @@ import { modifier } from "ember-modifier";import bodyClass from "discourse/helpers/body-class";import getURL from "discourse/lib/get-url";import { wantsNewWindow } from "discourse/lib/intercept-click";-import { loadZoomMeetingSdk } from "discourse/lib/load-zoom-meeting-sdk";import DButton from "discourse/ui-kit/d-button";import { i18n } from "discourse-i18n";import DiscoursePostEvent from "discourse/plugins/discourse-calendar/discourse/components/discourse-post-event";import DiscoursePostEventEvent from "discourse/plugins/discourse-calendar/discourse/models/discourse-post-event-event";import fetchZoomJoinPayload from "../../lib/fetch-zoom-join-payload";+import { loadZoomMeetingSdk } from "../../lib/load-zoom-meeting-sdk";import { isWithinEventTimeframe } from "../../models/discourse-post-event-event";import MobileEmbeddableChatModal from "./modal/mobile-embeddable-chat-modal";diff --git a/plugins/discourse-calendar/assets/javascripts/discourse/lib/load-zoom-meeting-sdk.js b/plugins/discourse-calendar/assets/javascripts/discourse/lib/load-zoom-meeting-sdk.jsnew file mode 100644index 00000000000..0599bcdcff1--- /dev/null+++ b/plugins/discourse-calendar/assets/javascripts/discourse/lib/load-zoom-meeting-sdk.js@@ -0,0 +1,31 @@+import loadScript from "discourse/lib/load-script";++// The Zoom Meeting SDK is hotlinked from Zoom's CDN rather than bundled, so it+// stays out of Discourse's build and Zoom serves matching wasm/AV assets from+// the same origin. Bump this to adopt a newer SDK release.+// https://developers.zoom.us/docs/meeting-sdk/web/get-started/+const ZOOM_SDK_VERSION = "6.2.0";+const CDN = "https://source.zoom.us";++// Shared by both views; React must precede ReactDOM, and Redux precede its thunk.+const DEPENDENCIES = ["react", "react-dom", "redux", "redux-thunk", "lodash"];++async function loadDependencies() {+ for (const dep of DEPENDENCIES) {+ await loadScript(`${CDN}/${ZOOM_SDK_VERSION}/lib/vendor/${dep}.min.js`);+ }+}++// Client View (`ZoomMtg`) - renders the full Zoom client UI.+export async function loadZoomMeetingSdk() {+ await loadDependencies();+ await loadScript(`${CDN}/zoom-meeting-${ZOOM_SDK_VERSION}.min.js`);+ return window.ZoomMtg;+}++// Component View (`ZoomMtgEmbedded`) - embeds Zoom inside a container element.+export async function loadZoomMeetingSdkEmbedded() {+ await loadDependencies();+ await loadScript(`${CDN}/zoom-meeting-embedded-${ZOOM_SDK_VERSION}.min.js`);+ return window.ZoomMtgEmbedded;+}diff --git a/plugins/discourse-calendar/assets/javascripts/discourse/lib/zoom-meeting-session.js b/plugins/discourse-calendar/assets/javascripts/discourse/lib/zoom-meeting-session.jsindex c50dcb655a4..a273fe3f34b 100644--- a/plugins/discourse-calendar/assets/javascripts/discourse/lib/zoom-meeting-session.js+++ b/plugins/discourse-calendar/assets/javascripts/discourse/lib/zoom-meeting-session.js@@ -1,8 +1,8 @@import { tracked } from "@glimmer/tracking";import { setOwner } from "@ember/owner";-import { loadZoomMeetingSdkEmbedded } from "discourse/lib/load-zoom-meeting-sdk";import { i18n } from "discourse-i18n";import fetchZoomJoinPayload from "./fetch-zoom-join-payload";+import { loadZoomMeetingSdkEmbedded } from "./load-zoom-meeting-sdk";import { computeZoomViewSize, syncZoomLayout } from "./zoom-component-view-dom";import { serializeZoomError } from "./zoom-error";diff --git a/plugins/discourse-calendar/plugin.rb b/plugins/discourse-calendar/plugin.rbindex 7ab7606d2ac..d2615155200 100644--- a/plugins/discourse-calendar/plugin.rb+++ b/plugins/discourse-calendar/plugin.rb@@ -44,10 +44,7 @@ register_svg_icon "star"register_svg_icon "file-arrow-up"register_svg_icon "location-pin"register_svg_icon "arrows-up-to-line"-extend_content_security_policy(- script_src: %w[https://source.zoom.us],- worker_src: %w[https://source.zoom.us blob:],-)+extend_content_security_policy(worker_src: %w[https://source.zoom.us blob:])module ::DiscourseCalendarPLUGIN_NAME = "discourse-calendar"diff --git a/pnpm-lock.yaml b/pnpm-lock.yamlindex db103b624ae..a2717cf6d2f 100644--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@ -294,9 +294,6 @@ importers:'@lezer/lr':specifier: ^1.4.8version: 1.4.10- '@zoom/meetingsdk':- specifier: 6.2.0- version: 6.2.0([email protected])([email protected]([email protected]))([email protected]([email protected]([email protected]))([email protected])([email protected]))([email protected])([email protected]([email protected]))([email protected])ace-builds:specifier: ^1.44.0version: 1.44.0@@ -411,21 +408,6 @@ importers:prosemirror-view:specifier: ^1.41.8version: 1.41.8- react:- specifier: 18.2.0- version: 18.2.0- react-dom:- specifier: 18.2.0- version: 18.2.0([email protected])- react-redux:- specifier: 8.1.2- redux:- specifier: 4.2.1- version: 4.2.1- redux-thunk:- specifier: 2.4.2- version: 2.4.2([email protected])rete:specifier: ^2.0.6version: 2.0.6@@ -576,7 +558,7 @@ importers:version: 2.1.1(patch_hash=6f462c5d8fcc3ebcc27fc038b7be66b9337f0c848ad18e37a2101cb62b29ede5)(@babel/[email protected])ember-cli:specifier: ~7.0.1- version: 7.0.1(@babel/[email protected])(@types/[email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])+ version: 7.0.1(@babel/[email protected])(@types/[email protected])([email protected])([email protected])([email protected])ember-cli-deprecation-workflow:specifier: ^4.0.1version: 4.0.1(@babel/[email protected])@@ -633,7 +615,7 @@ importers:version: 22.0.0testem:specifier: ^3.20.1- version: 3.20.1(@babel/[email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])+ version: 3.20.1(@babel/[email protected])([email protected])([email protected])([email protected])typescript:specifier: ^5.9.3version: 5.9.3@@ -2915,11 +2897,6 @@ packages:resolution: {integrity: sha512-00UxlRaIUvYm4R4W9WYkN8/J+kV8fmOQ7okeH6YFtGWFMt3odD45tpG5yA5wnL7HE6lLgjaTW5n14ju2hl2NNA==}deprecated: This is a stub types definition. glob provides its own type definitions, so you do not need this installed.- '@types/[email protected]':- resolution: {integrity: sha512-PQTyIulDkIDro8P+IHbKCsw7U2xxBYflVzW/FgWdCAePD9xGSidgA76/GeJ6lBKoblyhf9pBY763gbrN+1dI8g==}- peerDependencies:- '@types/react': '*'-'@types/[email protected]':resolution: {integrity: sha512-SeyVJXlCZpEki5F0ghuYe+L+PprQta6nRZqhONt9F13dWBtR/ftoaIbdRQ7cis7womE+X2LKhsDdDtkkDhJS6g==}@@ -2971,9 +2948,6 @@ packages:'@types/[email protected]':resolution: {integrity: sha512-6WaYesThRMCl19iryMYP7/x2OVgCtbIVflDGFpWnb9irXI3UjYE4AzmYuiUKY1AJstGijoY+MgUszMgRxIYTYw==}- '@types/[email protected]':- resolution: {integrity: sha512-EwmlvuaxPNej9+T4v5AuBPJa2x2UOJVdjCtDHgcDqitUeOtjnJKJ+apYjVcAoBEMjKW1VVFGZLUb5+qqa09XFA==}-'@types/[email protected]':resolution: {integrity: sha512-ThVF6DCVhA8kUGy+aazFQ4kXQ7E1Ty7A3ypFOe0IcJV8O/M511G99AW24irKrW56Wt44yG9+ij8FaqoBGkuBXg==}@@ -3130,16 +3104,6 @@ packages:resolution: {integrity: sha512-A9gOqLdi6cV4ibazAjcQufGj0B1y/vDqYrcuP6d/6x8P27gRS8643Dj9o1dEKtB6O7fwxb2FgBmJS2mX7gpvdw==}engines: {node: '>=14.6'}- '@zoom/[email protected]':- resolution: {integrity: sha512-QVoZKZMtt0xMuwQRyEQrh4wVWjsMSrqko9wbFS21E6eoTSGjq/Q2iSrUtkYjwPes1skXXmItuxW2ZpLS6zschg==}- peerDependencies:- lodash: ^4.18.1- react: 18.2.0- react-dom: 18.2.0- react-redux: 8.1.2- redux: 4.2.1- redux-thunk: 2.4.2-resolution: {integrity: sha512-SlFk3QSqeuvmN/anaIteUkB6ipBHoG1jq5gfQZU2kqvbkDW3Iab7SNufj4io4e8StvuIshD+loJnsQgTEvq6dA==}@@ -5216,9 +5180,6 @@ packages:resolution: {integrity: sha512-Xwwo44whKBVCYoliBQwaPvtd/2tYFkRQtXDWj1nackaV2JPXx3L0+Jvd8/qCJ2p+ML0/XVkJ2q+Mr+UVdpJK5w==}engines: {node: '>=12.0.0'}- resolution: {integrity: sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==}-resolution: {integrity: sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA==}engines: {node: '>=0.10.0'}@@ -6004,10 +5965,6 @@ packages:resolution: {integrity: sha512-CdaO738xRapbKIMVn2m4F6KTj4j7ooJ8POVnebSgKo3KBz5axNXRAL7ZdRjIV6NOr2Uf4vjtRkxrFETOioCqSA==}engines: {node: '>= 12.0.0'}- resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==}- hasBin: true-resolution: {integrity: sha512-7fm3l3NAF9WfN6W3JOmf5drwpVqX78JtoGJ3A6W0a6ZnldM41w2fV5D490psKFTpMds8TJse/eHLFFsNHHjHgg==}@@ -6962,42 +6919,6 @@ packages:resolution: {integrity: sha512-K5zQjDllxWkf7Z5xJdV0/B0WTNqx6vxG70zJE4N0kBs4LovmEYWJzQGxC9bS9RAKu3bgM40lrd5zoLJ12MQ5BA==}engines: {node: '>= 0.10'}- resolution: {integrity: sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==}- peerDependencies:- react: ^18.2.0-- resolution: {integrity: sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==}-- resolution: {integrity: sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==}-- resolution: {integrity: sha512-xJKYI189VwfsFc4CJvHqHlDrzyFTY/3vZACbE+rr/zQ34Xx1wQfB4OTOSeOSNrF6BDVe8OOdxIrAnMGXA3ggfw==}- peerDependencies:- '@types/react': ^16.8 || ^17.0 || ^18.0- '@types/react-dom': ^16.8 || ^17.0 || ^18.0- react: ^16.8 || ^17.0 || ^18.0- react-dom: ^16.8 || ^17.0 || ^18.0- react-native: '>=0.59'- redux: ^4 || ^5.0.0-beta.0- peerDependenciesMeta:- '@types/react':- optional: true- '@types/react-dom':- optional: true- react-dom:- optional: true- react-native:- optional: true- redux:- optional: true-- resolution: {integrity: sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==}- engines: {node: '>=0.10.0'}-resolution: {integrity: sha512-yILWifhaSEEytfXI76kB9xEEiG1AiozaCJZ83A87ytjRiN+jVibXjedjCRNjoZviinhG+4UkalO3mWTd8u5O0Q==}engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0}@@ -7027,14 +6948,6 @@ packages:resolution: {integrity: sha512-8eEWsNCkV2rvwKLS1Cvp5agNjMhwRe2um+y32B2+3LqOzg4C9BBPs6vzAfV16Ivb8B9HPNKIqd8OrdBws8kNlQ==}- resolution: {integrity: sha512-+P3TjtnP0k/FEjcBL5FZpoovtvrTNT/UXd4/sluaSyrURlSlhLSzEdfsTBW7WsKB6yPvgd7q/iZPICFjW4o57Q==}- peerDependencies:- redux: ^4-- resolution: {integrity: sha512-LAUYz4lc+Do8/g7aeRa8JkyDErK6ekstQaqWQrNRW//MY1TvCEpMtpTWvlQ+FPbWCx+Xixu/6SHt5N0HR+SB4w==}-resolution: {integrity: sha512-00o4I+DVrefhv+nX0ulyi3biSHCPDe+yLv5o/p6d/UVlirijB8E16FtfwSAi4g3tcqrQ4lRAqQSoFEZJehYEcw==}engines: {node: '>= 0.4'}@@ -7303,9 +7216,6 @@ packages:resolution: {integrity: sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA==}engines: {node: '>=v12.22.7'}- resolution: {integrity: sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==}-resolution: {integrity: sha512-SHiNtMOUGWBQJwzISiVYKu82GiV4QYGePp3odlY1tuKO7gPtphAT5R/py0fA6xtbgLL/RvtJZnU9b8s0F1q0Xg==}engines: {node: '>= 8.9.0'}@@ -8048,11 +7958,6 @@ packages:resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==}- resolution: {integrity: sha512-Pp6GSwGP/NrPIrxVFAIkOQeyw8lFenOHijQWkUTrDvrF4ALqylP2C/KCkeS9dpUM3KvYRQhna5vt7IL95+ZQ9w==}- peerDependencies:- react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0-resolution: {integrity: sha512-m/7/FSqjJNAzF2La448c/aEom0gJy7HY7Y509h6l0ePvEkFictAGptwWaj1msWJ38JbfEDOUoE8kqFee9EHKdA==}@@ -10868,10 +10773,6 @@ snapshots:dependencies:glob: 13.0.6- '@types/[email protected]':- dependencies:- hoist-non-react-statics: 3.3.2-'@types/[email protected]':dependencies:'@types/sizzle': 2.3.10@@ -10918,8 +10819,6 @@ snapshots:'@types/[email protected]': {}- '@types/[email protected]': {}-'@types/[email protected]':dependencies:'@types/node': 25.9.1@@ -11153,15 +11052,6 @@ snapshots:'@xmldom/[email protected]': {}- '@zoom/[email protected]([email protected])([email protected]([email protected]))([email protected]([email protected]([email protected]))([email protected])([email protected]))([email protected])([email protected]([email protected]))([email protected])':- dependencies:- lodash: 4.18.1- react: 18.2.0- react-dom: 18.2.0([email protected])- redux: 4.2.1- redux-thunk: 2.4.2([email protected])-dependencies:focusable-selectors: 0.8.4@@ -12128,15 +12018,13 @@ snapshots:ora: 3.4.0through2: 3.0.2- [email protected](@babel/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]):+ [email protected](@babel/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected]):optionalDependencies:'@babel/core': 7.29.7ejs: 3.1.10handlebars: 4.7.9lodash: 4.18.1mustache: 4.2.0- react: 18.2.0- react-dom: 18.2.0([email protected])underscore: 1.13.8@@ -12577,7 +12465,7 @@ snapshots:transitivePeerDependencies:- supports-color- [email protected](@babel/[email protected])(@types/[email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]):+ [email protected](@babel/[email protected])(@types/[email protected])([email protected])([email protected])([email protected]):dependencies:'@ember-tooling/blueprint-blueprint': 0.3.0'@ember-tooling/blueprint-model': 0.6.3@@ -12656,7 +12544,7 @@ snapshots:silent-error: 1.1.1sort-package-json: 3.6.1symlink-or-copy: 1.3.1- testem: 3.20.1(@babel/[email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])tiny-lr: 2.0.0tree-sync: 2.1.0walk-sync: 4.0.2@@ -13931,10 +13819,6 @@ snapshots:- dependencies:- react-is: 16.13.1-dependencies:parse-passwd: 1.0.0@@ -14705,10 +14589,6 @@ snapshots:safe-stable-stringify: 2.5.0triple-beam: 1.4.1- dependencies:- js-tokens: 4.0.0-dependencies:tslib: 2.8.1@@ -15680,33 +15560,6 @@ snapshots:iconv-lite: 0.7.2unpipe: 1.0.0- dependencies:- loose-envify: 1.4.0- react: 18.2.0- scheduler: 0.23.2-- [email protected]: {}-- [email protected]: {}-- dependencies:- '@babel/runtime': 7.29.7- '@types/hoist-non-react-statics': 3.3.7- '@types/use-sync-external-store': 0.0.3- hoist-non-react-statics: 3.3.2- react: 18.2.0- react-is: 18.3.1- use-sync-external-store: 1.6.0([email protected])- optionalDependencies:- react-dom: 18.2.0([email protected])- redux: 4.2.1-- dependencies:- loose-envify: 1.4.0-@@ -15750,14 +15603,6 @@ snapshots:dependencies:esprima: 3.0.0- dependencies:- redux: 4.2.1-- dependencies:- '@babel/runtime': 7.29.7-dependencies:call-bind: 1.0.9@@ -16069,10 +15914,6 @@ snapshots:dependencies:xmlchars: 2.2.0- dependencies:- loose-envify: 1.4.0-dependencies:'@types/json-schema': 7.0.15@@ -16697,7 +16538,7 @@ snapshots:commander: 2.20.3source-map-support: 0.5.21- [email protected](@babel/[email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]):+ [email protected](@babel/[email protected])([email protected])([email protected])([email protected]):dependencies:'@xmldom/xmldom': 0.9.10backbone: 1.6.1@@ -16705,7 +16546,7 @@ snapshots:chokidar: 5.0.0commander: 14.0.3compression: 1.8.1- consolidate: 1.0.4(@babel/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])+ consolidate: 1.0.4(@babel/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected])execa: 9.6.1express: 5.2.1glob: 13.0.6@@ -17051,10 +16892,6 @@ snapshots:dependencies:punycode: 2.3.1- dependencies:- react: 18.2.0-