Skip to content

Commit 2a9199d

Browse files
authored
Merge pull request #6580 from datalayer-externals/fix/custom-preload
Ensure custom preload is correctly handled
2 parents 8e5d4f5 + ab71610 commit 2a9199d

File tree

4 files changed

+15
-2
lines changed

4 files changed

+15
-2
lines changed

docs/environment.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ dependencies:
1313
- sphinx
1414
- terminado
1515
- myst-parser
16-
- nbclassic==0.4.5
16+
- nbclassic==0.4.6
1717
- pip:
1818
- nbsphinx
1919
- Send2Trash

notebook/templates/page.html

+12
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,18 @@
9898
}
9999
})
100100

101+
// error-catching custom-preload.js shim.
102+
define("custom-preload", function (require, exports, module) {
103+
try {
104+
var custom = require('custom/custom-preload');
105+
console.debug('loaded custom-preload.js');
106+
return custom;
107+
} catch (e) {
108+
console.error("error loading custom-preload.js", e);
109+
return {};
110+
}
111+
})
112+
101113
document.nbjs_translations = {{ nbjs_translations|safe }};
102114
document.documentElement.lang = navigator.language.toLowerCase();
103115
</script>

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@
122122
'Send2Trash>=1.8.0',
123123
'terminado>=0.8.3',
124124
'prometheus_client',
125-
'nbclassic==0.4.5',
125+
'nbclassic==0.4.6',
126126
],
127127
extras_require = {
128128
'test': ['pytest', 'coverage', 'requests', 'testpath',

tools/build-main.js

+1
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ var rjs_config = {
6060

6161
exclude: [
6262
"custom/custom",
63+
"custom/custom-preload",
6364
]
6465
};
6566

0 commit comments

Comments
 (0)