From 57e63718d66643434ec67f303070a647e1d74737 Mon Sep 17 00:00:00 2001 From: Carson Date: Tue, 28 Jan 2025 18:41:54 -0600 Subject: [PATCH 1/7] Workaround require.js for now by setting amd to false --- js/src/output.ts | 2 +- shinywidgets/static/output.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/js/src/output.ts b/js/src/output.ts index f844e56..6ef77db 100644 --- a/js/src/output.ts +++ b/js/src/output.ts @@ -37,7 +37,7 @@ const shinyRequireLoader = async function(moduleName: string, moduleVersion: str const oldAmd = (window as any).define.amd; // The is the original value for define.amd that require.js sets - (window as any).define.amd = {jQuery: true}; + (window as any).define.amd = false; // Store jQuery global since loading we load a module, it may overwrite it // (qgrid is one good example) diff --git a/shinywidgets/static/output.js b/shinywidgets/static/output.js index 58531c7..af110e4 100644 --- a/shinywidgets/static/output.js +++ b/shinywidgets/static/output.js @@ -36,7 +36,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac \***********************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _jupyter_widgets_html_manager__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @jupyter-widgets/html-manager */ \"@jupyter-widgets/html-manager\");\n/* harmony import */ var _jupyter_widgets_html_manager__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_jupyter_widgets_html_manager__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _comm__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./comm */ \"./src/comm.ts\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils */ \"./src/utils.ts\");\nvar _a;\n\n\n\n/******************************************************************************\n * Define a custom HTMLManager for use with Shiny\n ******************************************************************************/\nclass OutputManager extends _jupyter_widgets_html_manager__WEBPACK_IMPORTED_MODULE_0__.HTMLManager {\n // In a soon-to-be-released version of @jupyter-widgets/html-manager,\n // display_view()'s first \"dummy\" argument will be removed... this shim simply\n // makes it so that our manager can work with either version\n // https://github.com/jupyter-widgets/ipywidgets/commit/159bbe4#diff-45c126b24c3c43d2cee5313364805c025e911c4721d45ff8a68356a215bfb6c8R42-R43\n async display_view(view, options) {\n const n_args = super.display_view.length;\n if (n_args === 3) {\n return super.display_view({}, view, options);\n }\n else {\n // @ts-ignore\n return super.display_view(view, options);\n }\n }\n}\n// Define our own custom module loader for Shiny\nconst shinyRequireLoader = async function (moduleName, moduleVersion) {\n // shiny provides require.js and also sets `define.amd=false` to prevent