Skip to content
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

Add RawJS construct for embedding raw JS and define global instances #290

Merged
merged 7 commits into from
Nov 28, 2016

Conversation

almarklein
Copy link
Member

@almarklein almarklein commented Nov 28, 2016

Fixes #279, possibly makes #275 easier, helps #104 while honoring #259.

Write raw JS:

RawJS('$')(self.node).datepicker()

...

def foo(x):
    res = []
    RawJS("""
        for (i=0; i<10; i++) {
            ...
        }
    """)

Define globals in app, ui:

# in m1.py
some_module = RawJS("require('some.module')")
foo = RawJS("[]")

# in m2.py
from m1 import foo  # hooray, we can share a constant in JS!

@almarklein almarklein merged commit b61e037 into master Nov 28, 2016
@almarklein almarklein deleted the rawjs branch November 28, 2016 14:50
@almarklein almarklein modified the milestones: v0.5, v0.4.2 Oct 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant