Support py-script
What problem does this feature solve?
py-script has been recently announced to work in the browser. See https://pyscript.net
I would like to propose to support
As far as I can tell, the Vue compiler doesn't respect this (which is obvious for HTML).
What does the proposed API look like?
For instance, these two lines generates a SyntaxError: invalid syntax
:
<py-script>
from astropy import time
print(time.Time('2451545', format='jd'))
</py-script>
I don't see a valid use case for this, and you didn't provide one. I don'T think we should invest any resources in supporting this as it's a niche technology right now.
I agree that I didn't provide any use case. And mine is probably small, I agree too. However, I don't think it is a niche technology. Given the activity in the academic community (and even outside), there will be IMHO a lot of Python people wanting to create scientific websites using their python code.
Being able to integrate sophisticated existing python code (even based on powerful libraries like numpy or pandas) inside Vue SFCs would be truly awesome, and opens a lot of possibilities for scientific websites.
That's the main reason for the absence of use case: there are too many possible. Moreover, the only suggestion I wanted to make was to respect the indentation inside these special tags. I have no idea how difficult it is, however.
I do agree to have this possibility would be just awesome, I love Vue and I love python, I tolerate JS, but just the idea of using python with Vue is exciting, it's a paradigm shift level idea, that will bring with it a huge mature community
Sorry but this is not something that Vue will support. Loading a 200kb file + interpreting python at runtime comes with huge performance overhead and you probably don't want to actually use it in anything but toy / personal projects.
The cost of supporting it requires the Vue compiler to be able to analyze python AST and replicate all current SFC script/template coupling logic for python, which is a lot of work for toy use cases. If someone wants to work on this a hobby, it could probably be done via custom block API of SFCs. I just don't see this happening in core.