-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Fix import link #339
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 import link #339
Conversation
This example works for me on most recent <script type="importmap">
{
"imports": {
"d3": "https://cdn.skypack.dev/d3@7"
}
}
</script> located above the py-script. If ESM import mapping doesn't work in some context, then the underlying bug needs to be fixed, not the import changed. |
Actually, import maps are not widely supported (https://caniuse.com/?search=importmap). Only chromium-based browsers support it. That's unfortunate, given that one of the points for this example was to show this off. There seems to be a polyfill (https://github.com/guybedford/es-module-shims) available, so we may want to use this instead, though I didn't test it. |
I see. |
i have been thinking about rebuilding all the examples without import maps. i dont want to showcase js i want to showcase python, with light and very simple js. we dont want beginners to have to learn js and js patterns |
I agree with @verhulstm take on this. |
FWIW: FF has partial support for the most recent import stuff. I'm using es-module-shims here, and indeed it gives full support for at least FF. |
I don't mean to threadjack here, but given "I think it would be nice to have complex examples to showcase how far you can go using the power of both langs", is there a process for submitting examples/demos? The three.js thing I'm working on[1] is all Python, driving the three.js library. It's not overly complex and (I think, anyway :) ) shows off a fair number of Python features, some interesting pyscript features (referring to a main script using pyscript tags, including external py files), as well as how to work with an existing JS lib in a Pythonic way. [1] It works; I'm currently in that infinitely recursive "tweak the aesthetics" phase. |
There is value in this example. D3 has been a desired project in the Python Viz ecosystem for ages ... Now, removing complexity makes a lot of sense in general but if it's not possible in this case, I'd keep the example and 1. Try the polyfill or 2. Point out that works only on Chrome. @tildebyte no problem, thanks for your question. We are working on a process to better welcome community examples. In the meantime I'd suggest to open a PR if you want to out the example in front of others to review |
Hey, I was running the examples and noticed the JS part of this one wasn't running anymore because it couldn't find the npm d3.
This is a fix. :)