Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix mathjax default url and bump ipywidgets packages #1496

Merged
merged 6 commits into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/voila/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
},
"browserslist": ">0.8%, not ie 11, not op_mini all, not dead",
"dependencies": {
"@jupyter-widgets/base": "^6.0.6",
"@jupyter-widgets/jupyterlab-manager": "^5.0.9",
"@jupyter-widgets/base": "^6.0.10",
"@jupyter-widgets/jupyterlab-manager": "^5.0.13",
"@jupyterlab/application": "^4.0.0",
"@jupyterlab/apputils": "^4.0.0",
"@jupyterlab/apputils-extension": "^4.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/voila/src/tools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export function shouldUseMathJax2() {
PageConfig.setOption(
urlParam,
url === 'null'
? 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/MathJax.js'
? 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/3.2.2/es5/latest.min.js'
: url
);
PageConfig.setOption(
Expand Down
2 changes: 1 addition & 1 deletion ui-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "Voila UI Tests",
"private": true,
"scripts": {
"start": "voila ../notebooks --no-browser --show_tracebacks True --Voila.mathjax_url=https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/MathJax.js",
"start": "voila ../notebooks --no-browser --show_tracebacks True",
"start:detached": "yarn run start&",
"test": "npx playwright test",
"test:debug": "PWDEBUG=1 playwright test",
Expand Down
10 changes: 5 additions & 5 deletions ui-tests/tests/voila.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ test.describe('Voila performance Tests', () => {
const testFunction = async () => {
await page.goto(`/voila/render/${notebookName}.ipynb?template=classic`);
// wait for the widgets to load
await page.waitForSelector('span[role="presentation"] >> text=x');
await page.waitForSelector('.slider-container');
};
await addBenchmarkToTest(notebookName, testFunction, testInfo, browserName);

Expand All @@ -103,7 +103,7 @@ test.describe('Voila performance Tests', () => {
const testFunction = async () => {
await page.goto(`/voila/render/${notebookName}.ipynb`);
// wait for the widgets to load
await page.waitForSelector('span.mjx-char >> text=x');
await page.waitForSelector('.slider-container');
};
await addBenchmarkToTest(notebookName, testFunction, testInfo, browserName);
// change the value of the slider
Expand All @@ -128,7 +128,7 @@ test.describe('Voila performance Tests', () => {
const testFunction = async () => {
await page.goto(`/voila/render/${notebookName}.ipynb?theme=dark`);
// wait for the widgets to load
await page.waitForSelector('span[role="presentation"] >> text=x');
await page.waitForSelector('.slider-container');
};
await addBenchmarkToTest(notebookName, testFunction, testInfo, browserName);

Expand All @@ -148,7 +148,7 @@ test.describe('Voila performance Tests', () => {
`/voila/render/${notebookName}.ipynb?theme=JupyterLab%20Miami%20Nights`
);
// wait for the widgets to load
await page.waitForSelector('span[role="presentation"] >> text=x');
await page.waitForSelector('.slider-container');
};
await addBenchmarkToTest(notebookName, testFunction, testInfo, browserName);

Expand Down Expand Up @@ -334,7 +334,7 @@ test.describe('Voila performance Tests', () => {
const notebookName = 'reveal';
const testFunction = async () => {
await page.goto(`/voila/render/${notebookName}.ipynb`);
await page.waitForSelector('span[role="presentation"] >> text=x');
await page.waitForSelector('.slider-container');
};
await addBenchmarkToTest(notebookName, testFunction, testInfo, browserName);
expect(await page.screenshot()).toMatchSnapshot(`${notebookName}.png`);
Expand Down
3 changes: 2 additions & 1 deletion voila/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ def get_page_config(base_url, settings, log, voila_configuration: VoilaConfigura
}
mathjax_config = settings.get("mathjax_config", "TeX-AMS_CHTML-full,Safe")
mathjax_url = settings.get(
"mathjax_url", "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/MathJax.js"
"mathjax_url",
"https://cdnjs.cloudflare.com/ajax/libs/mathjax/3.2.2/es5/latest.min.js",
)
page_config.setdefault("mathjaxConfig", mathjax_config)
page_config.setdefault("fullMathjaxUrl", mathjax_url)
Expand Down
Loading
Loading