Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
VPN-5472: Merge Mozilla.Shared.qmlcomponents into Mozilla.VPN module #8843
VPN-5472: Merge Mozilla.Shared.qmlcomponents into Mozilla.VPN module #8843
Changes from all commits
5ca6eaa
a51b982
e12e64d
ccc2515
2599cf3
76b65d7
40eb857
7bf0be6
91afa0d
0ec5897
e04c7fb
9e0b934
d1bafc7
5d89cf2
2dec33c
4f22df4
ebddc2f
c059d73
ce44ede
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why the changes in this file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In order to move this class into the Nebula library, it was important to make sure that the C++ code doesn't depend on code in the
mozillavpn
target, otherwise this would result in a dependency loop. This mostly just required that we drop the use of the VPN's logging infrastructure and just do it in pure Qt.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why remove this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally I was finding that the QML types registered implicitly by the
mozillavpn
target were failing to make it into the QML namespace. To work around it, this PR is attempting to move all the QML type registration into themozillavpn-ui
target and we do it insrc/ui/types/MZAddonMessage.h
with theQML_FOREIGN()
macro instead.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This wasn't introduced by your changes but does it still make sense to register MZAccessibleNotification and MZI18n here instead of qmlengineholder? Seems odd to be handling this in two places.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, it is a bit weird registering things in multiple places like this. However, my ideal solution, if I were up to another refactoring challenge, would be to combine the
Mozilla.VPN
andMozilla.Shared
modules together. They are vestigial remains of our attempt to modularize the codebase and doing so would require that we register everything in the QML module instead of callingqmlRegisterSingletonInstance()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why move this in?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I couldn't find a way to conditionally register a singleton type purely using
qt_add_qml_module()
in a way that would respect the feature flags so I figured the cleanest solution was to register all the QML types in theMozilla.VPN
module (and to do so consistently regardless of feature flagging).In order to replicate the intended behaviour of the C++ code that this replaces, it was necessary to ensure that the
ProductsHandler
class doesn't do anything when the feature flag is disabled even if we happen to instantiate it.