Comments (6)
Should we add a UMD? Something like github.com/umdjs/umd/blob/master/templates/returnExports.js
from qmlweb.
@ChALkeR Yeah, i was getting annoyed at all the globals floating around.
Think it would be good to make a separate module for the parser/loading stuff, 'qmlweb-parse' for example, then this module can be required by the gulp task or future server side needs.
@labsin UMD looks good. Are there any implications except the extra code to wrap around?
from qmlweb.
@henrikrudstrom Actually, I think we can just use CJS and Browserify/Webpack. I will take a look at this soon.
from qmlweb.
Checkout the browserified
branch to see a few tweaks I've done to make qmlweb usable directly from nodejs.
The encapsulate helpers are gone, there aren't any global variables left (apart from the AutoLoader, which might need to move somewhere else, since it's useless for the nodejs environment).
I've made some exports, but mainly I've cut the access from the external world to most of what was stored in global variables. We should discuss on what gets exported and what doesn't.
We might also consider removing some of the gulp concatenation in favor of uses of require
. That would be a much harder piece of work though, and not being an expert in node's require function, I'm not completely sure this is the best approach.
Anyhow, it would definitely help in making qmlweb more modular.
I can make a PR if you figure what I did in browserified
was the way to go.
I'm not sure about the last step. I had to generate two lib/qt.js
: one for nodejs, and one that takes the nodejs version and uses browserify on it.
from qmlweb.
The proper way to fix this is described in #173, I think.
I nearly completed the split, see #215, #216, qmlweb/qmlweb-parser#6.
All those three points are done in qmlweb/qmlweb-parser#6.
from qmlweb.
Implemented in qmlweb-parser.
from qmlweb.
Related Issues (20)
- Live reloading implementation HOT 2
- I was not able to run example HOT 9
- Get started is required HOT 2
- `npm run test` fails on windows HOT 5
- singleton definition is not supported by readQmlDir
- Qml for real project (Answer) HOT 1
- Cannot start simplest example, need help. HOT 2
- qml text in rectangle position bug HOT 2
- How to start? HOT 1
- Error: No constructor found for "TapHandler" HOT 3
- ability to import external libraries HOT 4
- Missing support for Gradient
- If the font is loaded after the document has been set up, the width and height of Text are off
- Uglify name mangling breaks qmlweb
- Help using qmlweb with nodejs server HOT 1
- Support of ES6+ HOT 3
- Is Possible To Add WebView or WebEngine To QmlWeb? HOT 1
- How can I load a project instead of a single qml file๏ผ HOT 1
- Is this project still being maintained? HOT 5
- Several questions about QMLWeb architecture. HOT 1
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 qmlweb.