Skip to content

Commit e880803

Browse files
committed
Cleanup comment
1 parent 1d4d54c commit e880803

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

js/src/output.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,19 @@ class OutputManager extends HTMLManager {
2727
// Define our own custom module loader for Shiny
2828
const shinyRequireLoader = async function(moduleName: string, moduleVersion: string): Promise<any> {
2929

30-
// shiny provides a shim of require.js and also sets `define.amd=false` to
31-
// allow <script>s with anonymous define()s to be loaded without error.
32-
// Note that, when anonymous define()s are used, the shim will leverage the
33-
// data-requiremodule attribute to determine the module name.
30+
// shiny provides a shim of require.js which allows <script>s with anonymous
31+
// define()s to be loaded without error. When an anonymous define() occurs,
32+
// the shim uses the data-requiremodule attribute (set by require.js) on the script
33+
// to determine the module name.
34+
// https://github.com/posit-dev/py-shiny/blob/230940c/scripts/define-shims.js#L10-L16
3435
// In the context of shinywidgets, when a widget gets rendered, it should
35-
// include another <script> tag that does `require.config({paths: {...}})`
36-
// to map the module name to the URL of the widget's JS file.
36+
// come with another <script> tag that does `require.config({paths: {...}})`
37+
// which maps the module name to a URL of the widget's JS file.
3738
const oldAmd = (window as any).define.amd;
3839

3940
// This is probably not necessary, but just in case -- especially now in a
4041
// anywidget/ES6 world, we probably don't want to load AMD modules
42+
// (plotly is one example of a widget that will fail to load if AMD is enabled)
4143
(window as any).define.amd = false;
4244

4345
// Store jQuery global since loading we load a module, it may overwrite it

0 commit comments

Comments
 (0)