manatlan / vbuild Goto Github PK
View Code? Open in Web Editor NEW"Compile" your VueJS components (sfc/*.vue) to standalone html/js/css ... python only (no need of nodejs). Support python components too !
License: MIT License
"Compile" your VueJS components (sfc/*.vue) to standalone html/js/css ... python only (no need of nodejs). Support python components too !
License: MIT License
Hi,
I know it may be a thing of taste, but I'm frequently writing like this:
def MOUNTED(self):
self.dark = window.matchMedia("(prefers-color-scheme: dark)").matches
self['$emit']('input', self.current)
self['$root'].dark = self.dark
def WATCH_dark(self, sta, oldStatus, name='dark'):
self['$vuetify'].theme.dark = sta
self['$root']['$emit']("dark-changed", sta)
self['$root'].dark = self.dark
I wonder if we could make an alias or a solution to rename $root, $emit, $on, and so on into _root etc? Could this be done at the level of vbuild, like the component methods are? I'm using the Python components, thank you a lot!
For some reason I'm not getting to trigger @dragstart
. Could this come from vbuild?
Running the example from the documentation for minimizing JavaScript:
>>> import vbuild
>>> js="""async function mymethod(...a) {
... var f=(...a) => {let b=12}
... }
... """
>>> min=vbuild.minimize(js)
Results in the following error:
Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/vbuild.py", line 59, in jsminOnline
r = json.loads( response.read() )
File "/usr/lib/python3.5/json/__init__.py", line 312, in loads
s.__class__.__name__))
TypeError: the JSON object must be str, not 'bytes'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.5/dist-packages/vbuild.py", line 43, in minimize
return jsminOnline(code)
File "/usr/local/lib/python3.5/dist-packages/vbuild.py", line 63, in jsminOnline
raise VBuildException("minimize error: %s" % e)
vbuild.VBuildException: minimize error: the JSON object must be str, not 'bytes'
It appears the CSS attribute selector tags are reversed during rendering. For example, given the following:
<style scoped>
div {
font-size: 5em;
text-align: center;
}
It renders to:
*[data-static-vue-component] div {font-size: 5em; text-align: center; }
Instead, it should render to the following to properly select tag:
div [data-static-vue-prospect_card] {font-size: 5em; text-align: center; }
I'm using python components and can't seem to trigger BEFOREDESTROY?
It should trigger before hiding an element (with v-show), I believe.
I can trigger DESTROYED but not BEFOREDESTROY maybe I'm doing something wrong.
It is mentioned in VueJS's docs that this is possible:
https://vue-loader.vuejs.org/guide/scoped-css.html#mixing-local-and-global-styles
But trying it didn't work as it seemed to only render the scoped style.
is this support optional api and composition api
i didnt yet saw those two thing side by side on python
also i wonder why the transcrypt not updating much the community also too low cause of no discord
First things first: vbuild is a great project, doing one thing very well. Our own project NiceGUI uses it internally to convert SFCs to HTML/JavaScript/CSS.
Only recently we noticed a few bugs that we would love to see fixed. Especially for the deprecation warning #10 there's already a pull request #9.
Now I'm thinking about copying the code into our own project or forking the whole repo. But, to make bugfixes available to the community, we would need to release a separate PyPI package as a successor to vbuild. Maybe it's better to "take over" this repo and continue developing the existing package. I'm just not sure if my team and I would be a good fit, since some of the current issues require quite some deep knowledge of Vue and JS, which we might be lacking.
@manatlan What's your thought on this?
And is there anyone interested in actively supporting this project?
vbuild/__init__.py:230: DeprecationWarning: invalid escape sequence '\*'
css = re.sub(re.compile("/\*.*?\*/", re.DOTALL), "", css)
Line 230 in 6b266fd
This is being promoted to a SyntaxWarning
in Python 3.12:
A backslash-character pair that is not a valid escape sequence now generates a SyntaxWarning, instead of DeprecationWarning. For example, re.compile("\d+.\d+") now emits a SyntaxWarning ("\d" is an invalid escape sequence), use raw strings for regular expression: re.compile(r"\d+.\d+"). In a future Python version, SyntaxError will eventually be raised, instead of SyntaxWarning. (Contributed by Victor Stinner in gh-98401.)
This will break in a future Python release when this is promoted to a SyntaxError
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.