Comments (10)
Also I think related to this is support for export default
syntax.
The question is how to implement it? If __all__
is not a list
, perhaps?
from metapensiero.pj.
so the function/class is accessible at vue.Vue?
the standard Python's:
from vue import Vue
should work in that case or
import vue as Vue
if it's a default import:
$ pj -s -
from vue import Vue
import vue as Vue
import {Vue} from 'vue';
import * as Vue from 'vue';
About the default exports, I simply don't think it's much of a feature.. anywayI've thought about using all too, but doesn't seem right...
from metapensiero.pj.
I had tried that and I couldn't get it to work but now I learned it was because of an issue with Webpack and module loading webpack/webpack#4039 - apparently you can't mix import
and module.exports
so it's a small but important feature.
from metapensiero.pj.
I guess import {Vue} from 'vue'
is different from import Vue from 'vue'
.
I was able to get the behaviour I need with from vue import default as Vue
:
<script lang="py?compiler=pj">
from vue import default as Vue
from vue__codemirror__lite import default as VueCodeMirror
Vue.use(VueCodeMirror)
class Component:
def __init__(self):
self['data'] = lambda: { 'code': '2' }
self['computed'] = { 'data': lambda: 2 }
__all__ = Component()
</script>
from metapensiero.pj.
That is after applying patch for default export.
from metapensiero.pj.
I was wrong, this should be the "non obvious" default import using named imports:
import {default as bar} from 'foo';
from metapensiero.pj.
@icarito Please see the referenced commit and see if it now works for you!
from metapensiero.pj.
I still have to update the docs
from metapensiero.pj.
Thanks for your updates! Also I suggest to implement anonymous default export as in https://gitlab.com/metapensiero/metapensiero.pj/merge_requests/35
from metapensiero.pj.
Hi @icarito, I'm closing this. It seems superseded by the changes in the repo. Open a new one for any remaining issues. Also note that i've made a new release, so you don't have to refer directly to a snapshot of the repo in your requirements.txt
from metapensiero.pj.
Related Issues (20)
- Fails on simple byte sequence: ValueError: Unknown data type received. HOT 3
- Name 'int' is reserved in JavaScript. HOT 3
- Proposing a PR to fix a few small typos HOT 1
- py2many test cases HOT 3
- python descending range doesn't produce correct javascript code HOT 1
- Problems when translating class HOT 2
- TransformationError: Node type 'Global': Line: 37, column: 4. No transformation for the node HOT 5
- Nested classes? HOT 4
- Is the project maintained? HOT 4
- Can we get a release of v0.12 HOT 1
- Support calling python list functions on variable without wrapping it in list() call HOT 2
- TransformationError: Node type 'GeneratorExp' [...] No transformation for the node HOT 2
- isdigit() function should be converted to !isNaN HOT 1
- @dataclass not supported HOT 1
- python list append should be converted to push HOT 1
- Support for backticks within f strings HOT 1
- Conversion of 'None' to null HOT 1
- Support for writing to basic text files HOT 2
- Support for comments HOT 2
- AssertionError on complex list index HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from metapensiero.pj.