-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Package broken when installing in JSPM #22
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
Comments
After this #18 is merged Run Note: Not at the my work computer now so I may have missed something |
We'll make sure the |
Should be fixed in Can you confirm? (I'm having a hard time setting up |
Hi @etpinard. I gave it another try. Unfortunately it doesn't work yet. The primary issues I am seeing right now:
"jspm": {
"main": "dist/plotly.js"
} |
I have it working with JSPM. Regading your points:
|
You're right, that works. Sorry, I failed to see that the dependencies are bundled into the file. So in that case, installation from github (
|
I think maybe the "dependencies" should be an empty object Kind of a side note I'm not personally suggesting that anything be added to plotly's |
The only thing currently preventing me from using plotly.js with SystemJS/JSPM is glslify-deps. glslify-deps requires graceful-fs here: https://github.com/stackgl/glslify-deps/blob/master/index.js#L2 which causes I don't know enough about glslify to suggest a solution at this point... except maybe modularize the code in a way that separates the glsl stuff from the d3 stuff. |
@Hypercubed the only plotly.js dependency that depends on glslify-deps is glslify I'm not sure how jspm updates the dependencies from patch to patch, but using npm, |
That's correct... but I'm still having some issues. |
|
Not a great solution but you can force jspm to skip graceful-fs entirely with the override: "npm:[email protected]": {
"main": "fs.js"
}, I think all the gl plots won't work but d3 will. |
Also, it will not work unless the |
So, jspm doesn't implement npm's postinstall hook. Sounds to me like the only robust of using plotly.js with jspm is to use the bundled up Is there a way to make |
That's correct. JSPM explicitly does not run postinstall (jspm/npm#36 (comment)). Building Anyway, yes, the To make jspm use the dist version you can add this to "jspm": {
"main": "dist/plotly.js"
} |
BTW... here is a jspm test app (install via github): https://gist.github.com/Hypercubed/05c132fc2996fc7795da install via npm (doesn't work because it is missing the |
@etpinard Unless there is a particular reason for building on installation, the build step could be moved to "prepublish". |
The issue here is that multiple dependences are then duplicated (e.g. As @Hypercubed said:
We have a working jspm install using
It required just two changes:
This patching by hand was just to make the minimum of changes; clearly this ‘problem’ can be fixed by depending on specific versions etc
So it seems if these two problems are addressed, we will be able to install the non- Any thoughts on how best to go about solving these?
|
@subash-a The issue regarding However, |
@guybedford - please can you help advise on the best way forward? |
@myitcv I have doubts that shiming |
@Hypercubed - I think all we're talking about here is the |
I'm not very familiar with glslify... But my understanding is that it is like Browserify for shaders. When generating the dist files Browserify is used but not bundled. Likewise when using the CJS version Browserify is not used at all. glslify, like Browserify, is usually part of the build step. For webpack they created Feel free to say I miss understand... I may. |
No, not saying you've misunderstood here at all. Indeed your comments about Rather that for us (I work with @subash-a), loading the |
Same here, same goal. My point is I think the webgl/gsgl stuff is still going to be a problem even if we solve the above issues. Personally I'm interested in the d3 plotting.... If the webgl stuff were a separate module or somehow allow a modular build I'd be happy. |
I don't have that much knowledge of this use case so I'm not sure how much I can really help. Note that jspm 0.17 will be coming with full server side support so these issues should go away. Since this is only for running in the browser though can you not just do a |
@guybedford If this allows |
If so, that support is tracking in jspm/npm#10. |
Sounds like it exactly, thanks for weighing in to pick things apart. |
After #164, the css and svg built files are checked in to git and published on npm. No need to worry about the |
Using our "sub" npm dist package (added in #2670, which have 0️⃣ dependency) should be a breeze with jspm, so I'll close this issue, but please notify us if that's not the case. |
Not that plotly would necessarily have to support JSPM, but it's also not possible to shim around the issue because there is neither a true source nor a true distribution format in the NPM package.
The
package.json
points tosrc/index.js
, which relies onbuild/ploticon
and other files in the build folder. Meanwhile,dist/plotly.js
– presumably intended for distribution given the name – begins withvar Plotly = require('../src/plotly');
which seems wrong.The text was updated successfully, but these errors were encountered: