Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-22356

Investigate support for 3rd party JS libraries


    • Type: Suggestion
    • Status: In Progress
    • Priority: P2: Important
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:


      Research if and how we should support 3rd party javascript libraries from QML.

      JavaScript libraries may attempt to do things not allowed by the QML JS environment. For example:

      Modify native objects:

      Modify the global object:

      Many libraries seem to be looking for either a browser environment or a CommonJS-like environment:

      In some cases, existing libraries can be made to work with code like:

      var window = {}

      Possible solutions:

      • Many libraries introspect their JS environment and tweak their code to cater for different environments. We could offer a standard way to identify the QML environment, allowing libraries to tweak themselves to our environment as well
      • We could consider introducing a new pragma, or allowing ".pragma library" imports to do special things (e.g. have their own (private?) editable global object)
      • A pragma that bootstraps some sort of compatibility layer (like Envjs)

      Other notes:


          Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.



              • Assignee:
                shausman Simon Hausmann
                brasser Michael Brasser (closed Nokia identity) (Inactive)
              • Votes:
                19 Vote for this issue
                24 Start watching this issue


                • Created:

                  Gerrit Reviews

                  There are no open Gerrit changes