Details
-
Task
-
Resolution: Unresolved
-
P2: Important
-
dev
-
None
Description
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
Attachments
Issue Links
- relates to
-
QTBUG-122645 dom: support semantic analysis for dependencies
-
- Closed
-