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

Refactor dependency management in DOM

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Unresolved
    • Icon: P2: Important P2: Important
    • Some future release
    • dev
    • QML: Tooling
    • None

      Currently loading of dependencies by DOM is hidden and way nontransparent. Dependencies are being added to the load queue implicitly as a callback for the LoadFile depending on the options with which DomEnvironment was created.

       

      Taking into account the Environment can be created, copied multiple times and moved around, it makes it hard to reason about the code attempting to loadFile whether it's going to load it with or without dependencies.

      Due to that problem, this commit https://codereview.qt-project.org/c/qt/qtdeclarative/+/527933?tab=comments has introduced a stack overflow, which was manifesting only on some platforms due to circular dependency: loadFile -> loadPendingDependencies -> advanceLoad -> loadFile (which should have been loadFileWithoutDependencies disregard of which options Env has)

       

      In the end, it's arguably a better option to

      a) remove Options:NoDependencies from the DomEnviroment

      b) expose 2 high level functions on the DomEnvironment loadFile (which will load only a file without dependencies and without adding them implicitly to the loading queue) and loadFileWithDependencies, which will do loading and spawn loading of dependencies in a more explicit manner.

      c) Refactor and think about the better separation of concerns introducing specially designated QmlJSLoader or smth like that. Which will handle dependencies etc.

       

      related: QTBUG-119550

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

            dima.a Dmitrii Akshintsev
            dima.a Dmitrii Akshintsev
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes