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

Add bokehjs' mathjax bundle #11525

Merged
merged 15 commits into from
Aug 26, 2021
Merged

Add bokehjs' mathjax bundle #11525

merged 15 commits into from
Aug 26, 2021

Conversation

IuryPiva
Copy link
Contributor

@IuryPiva IuryPiva commented Aug 23, 2021

this.status = "failed"
}
}
}

const default_provider: MathJaxProvider = new CDNProvider()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, we finally have a bundle, but what now? How do we use it? What's the point of having a CDN provider and include a bundle at the same time?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice question, this slip through. I'm thinking of solving it by using a config from Python and having the BundleProvider as default, but is there a need to use the CDN provider ever again?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There may be, but we will see. In the meantime figure out how to configure this (note this needs to work both from Python and JS).

@mattpap
Copy link
Contributor

mattpap commented Aug 25, 2021

Does this require any other external resources (CSS, fonts, ...)? Was this tested with networking disabled (e.g. in devtools)?

@IuryPiva
Copy link
Contributor Author

Does this require any other external resources (CSS, fonts, ...)? Was this tested with networking disabled (e.g. in devtools)?

Just tested with BundleProvider as default. No external resource is needed, no errors show when using with network disabled.

@mattpap mattpap changed the title add mathjax bundle Add bokehjs' mathjax bundle Aug 26, 2021
js, tag = bes.autoload_static(test_plot, CDN, "some/path")
r = deepcopy(CDN)
# Skip bokeh-mathjax for older versions
r.js_components.remove("bokeh-mathjax")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those tests are very presumptions regarding the state of resources between versions. I don't like this approach, especially given that deepcopy may not be guaranteed to copy CDN object correctly. Perhaps monkeypatching _js_components would be better, to match components with versions. I will merge this for the time being, but this needs some though in near future.

@mattpap mattpap merged commit af6af09 into branch-2.4 Aug 26, 2021
@mattpap mattpap deleted the iurypiva/create-mathjax-bundle branch August 26, 2021 15:28
bryevdv pushed a commit that referenced this pull request Dec 13, 2021
* add mathjax bundle provider

* add trailing commas

* add mathjax bundle legacy test

* docs

* update expected scripts len

* print mathjax bundle size

* skip tests for unexisting mathjax bundle versions

* deepcopy import directly

* skip version check for bokeh-mathjax

* update scripts length

* prevent terser to convert non-ascii characters becoming invalid

* test for console errors on embed

* trailing comma

* use bundle as default provider

* add link to terser issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants