Comments (7)
(this might be a possible approach for Bokeh to do its widgets)
from flexx.
There has been an occurance where Chrome would block JS in a flexx app, probably because of the eval that we use. Using a formalized protocol should get rid of that.
from flexx.
mmm... now that I think of it, that's not entirely true. Model classes that are defined after the page has been served will be dynamically defined, using eval. Well, at least eval would be used way less.
from flexx.
Related to #143
from flexx.
Mmm, it seems that eval()
would be a good way to load modules dynamically, and still have them show up as "files" in the debugger, using //# sourceURL=hello.js
.
Eval is not necesarily evil, as long as you do it in a way that does not allow misuse. Since the server sends the source over a websocket, I don't think this is a problem. Arguments about performance don't matter these days.
We might want to look at https://developer.chrome.com/extensions/contentSecurityPolicy to prevent the Chrome browser from blocking eval, though.
from flexx.
Did you also see this variant on the same scheme? Serving a JS file that has //@ sourceURL=foo.js
at the beginning will also show it in the devtools.
http://stackoverflow.com/a/18007439/552379
from flexx.
Had a look at the protocol during some of the late app refactoring. Most commands consist of a command and then a string. There are a few exceptions of commands that have more "arguments", but they can safely be space-splitted. Commands that are just strings also have advantages, e.g. in exported notebooks. Therefore, I chose to leave it as is. The commands can still be formalized, though I don't think there is much need while its only our Py and our JS talking to eachother.
from flexx.
Related Issues (20)
- how to set a timer HOT 10
- the pycomponents has conflicts with js? HOT 8
- Run as a desktop app, how to close the incognito window? HOT 1
- How to Change the "Starting Flexx App"? HOT 2
- Run as a desktop app, how to hide or remove the close button on the browser ? HOT 1
- Trying to build a SPA / Saas with Flexx HOT 1
- Flexx lacks of a lot of features HOT 4
- I couldn't find any example of sending ajax request and getting response HOT 1
- PlotlyWidget in offline mode HOT 2
- "Lost connection to server" on every little connection error/timeout HOT 6
- Is there a way to send data from my client side js widget to server side (for example images, videos)? HOT 5
- 使用freeze失败
- Error 404 on leaflet.py example HOT 9
- _mutate_xxx‘s bug or for some other reason HOT 2
- No certificate found HOT 2
- Lost connection with server: message too big (1009) HOT 1
- ui css:max-height < min-height HOT 6
- 'Too many open files' error HOT 14
- Use flx.create_element to create a label in the for loop, bind the onclick event, and dynamically transfer parameters. lambda fun error HOT 1
- use multiprocessing in flexx after freeze, The window keeps popping up HOT 8
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 flexx.