-
-
Notifications
You must be signed in to change notification settings - Fork 550
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
Fake requirejs & JS transform specific to electron frontends #1714
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1714 +/- ##
=========================================
+ Coverage 79.04% 80.15% +1.1%
=========================================
Files 62 60 -2
Lines 2047 1990 -57
=========================================
- Hits 1618 1595 -23
+ Misses 429 395 -34 |
804d36d
to
6f98be2
Compare
Ready for feedback @lgeiger, primarily for the sake of Hydrogen. I started with "just make it work" and haven't adapted the |
b0affc3
to
2756395
Compare
expect(component.shouldComponentUpdate({ data: "<b>woo</b>" })).toBeFalsy(); | ||
expect( | ||
component.shouldComponentUpdate({ data: "<b>womp</b>" }) | ||
).toBeTruthy(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't realize that Stephen Colbert wrote enzyme.
ad0657b
to
6290cac
Compare
Full query across all public notebooks for use of requirejs calls: https://bigquery.cloud.google.com/savedquery/300830567303:6116513b17ca4a77b58fec869fe5a846 😄 |
As a result of doing these queries, the modules that we should support include:
Possible contenders:
Other large uses, haven't diagnosed much about them:
|
Here are all the modules in public repos. These are uniqued yet not counted very well...:
Decent survey though. Note that I filtered out any occurences that were less than 2. |
6290cac
to
1ed9390
Compare
Note that dato / graphlab / turi come up often in the results as well, as part of a coursera course. I can't tell if they're well supported any more -- I'd like to use a canonical version as much as possible. |
Ok now that I've had a go at this for a bit, it's definitely seeming like we'd need to approach parts of this differently: Long term planJS output and HTML output should have the same output context / area. This likely means doing a unified iframed (webview for electron) display area. We'd still inject dependencies (vega, plotly, etc.) Short term planProvide |
cd28ad4
to
bdee152
Compare
* Support the specific require path for both of these * Includes vega-embed and d3 in deps
c2fa1f0
to
eb2aa80
Compare
Once this passes, it's ready to go and provides us a nice path for supporting vega/altair, d3, and informing users in a much richer way about what we can and can't support. |
Just tried out this branch 🎉 I'm hitting a strange bug when trying a simple bokeh example: from bokeh.io import push_notebook, show, output_notebook
from bokeh.layouts import row, gridplot
from bokeh.plotting import figure, show, output_file
output_notebook()
import numpy as np
x = np.linspace(0, 4*np.pi, 100)
y = np.sin(x)
TOOLS = "pan,wheel_zoom,box_zoom,reset,save,box_select"
p1 = figure(title="Legend Example", tools=TOOLS)
p1.circle(x, y, legend="sin(x)")
p1.circle(x, 2*y, legend="2*sin(x)", color="orange")
p1.circle(x, 3*y, legend="3*sin(x)", color="green")
show(p1) This used to work in previous versions of nteract, but now the app completely crashes without any debug output. |
Whoa! Ok I'll check that out. |
I'm beginning to think that HTML output should end up in an iframe that we provide certain libraries into, while also handling the resize. I'm going to try out a little mockup. |
Will come back to this again later. Cleaning up PRs for now. |
This thread has been automatically locked because it has not had recent activity. Please open a new issue for related bugs and link to relevant comments in this thread. |
This is the beginning of custom transforms for electron based frontends to handle "Jupyter-style" JS and HTML in a secure and friendly way. Secure because we could lock it down. Friendly because we'll try to match some invariants:
require
-- will likely use thevm
module for js runtimerequire
paths, including vega and others since we already support vegaThere's no code here yet, figured I should post where I'm headed with it.
After this PR I'm going to make a version that is web specific that will use the requirejs helper code.
Libraries to support
nbextensions/jupyter-vega/index
d3
Libraries definitely not going to be supported as part of this:
plotly
- we already handle the plotly mimetype, we won't support thetext/html
version from themRelated PR: #1709