GithubHelp home page GithubHelp logo

Comments (6)

labsin avatar labsin commented on May 8, 2024

Should we add a UMD? Something like github.com/umdjs/umd/blob/master/templates/returnExports.js

from qmlweb.

henrikrudstrom avatar henrikrudstrom commented on May 8, 2024

@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.

ChALkeR avatar ChALkeR commented on May 8, 2024

@henrikrudstrom Actually, I think we can just use CJS and Browserify/Webpack. I will take a look at this soon.

from qmlweb.

Plaristote avatar Plaristote commented on May 8, 2024

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.

ChALkeR avatar ChALkeR commented on May 8, 2024

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.

ChALkeR avatar ChALkeR commented on May 8, 2024

Implemented in qmlweb-parser.

from qmlweb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.