Skip to content
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

Re-factor BasePreferences to essentially be a wrapper around AppOptions #18413

Conversation

Snuffleupagus
Copy link
Collaborator

@Snuffleupagus Snuffleupagus commented Jul 9, 2024

In the MOZCENTRAL build the BasePreferences class is almost unused, since it's only being used to initialize and update the AppOptions which means that theoretically we could move the relevant code there.
However for the other build targets (e.g. GENERIC and CHROME) we still need to keep the BasePreferences class, although we can re-factor things to move the necessary validation inside of AppOptions and thus simplify the code and reduce duplication.

The patch also moves the event dispatching, for changed preference values, into AppOptions instead.

@Snuffleupagus Snuffleupagus force-pushed the BasePreferences-AppOptions-wrapper branch from e04ac83 to dc90329 Compare July 9, 2024 12:49
@Snuffleupagus
Copy link
Collaborator Author

/botio integrationtest

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Received

Command cmd_integrationtest from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.193.163.58:8877/d9dff635667b84d/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Received

Command cmd_integrationtest from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.241.84.105:8877/00b7f8245c22a11/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Success

Full output at http://54.241.84.105:8877/00b7f8245c22a11/output.txt

Total script time: 8.36 mins

  • Integration Tests: Passed

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Success

Full output at http://54.193.163.58:8877/d9dff635667b84d/output.txt

Total script time: 18.96 mins

  • Integration Tests: Passed

@Snuffleupagus Snuffleupagus marked this pull request as ready for review July 9, 2024 14:17
@timvandermeij
Copy link
Contributor

/botio-linux preview

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Received

Command cmd_preview from @timvandermeij received. Current queue size: 0

Live output at: http://54.241.84.105:8877/56022a01d32f834/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Success

Full output at http://54.241.84.105:8877/56022a01d32f834/output.txt

Total script time: 1.03 mins

Published

web/app_options.js Outdated Show resolved Hide resolved
web/preferences.js Outdated Show resolved Hide resolved
web/preferences.js Show resolved Hide resolved
@Snuffleupagus Snuffleupagus force-pushed the BasePreferences-AppOptions-wrapper branch from dc90329 to 76af87d Compare July 9, 2024 20:26
…tions`

In the MOZCENTRAL build the `BasePreferences` class is almost unused, since it's only being used to initialize and update the `AppOptions` which means that theoretically we could move the relevant code there.
However for the other build targets (e.g. GENERIC and CHROME) we still need to keep the `BasePreferences` class, although we can re-factor things to move the necessary validation inside of `AppOptions` and thus simplify the code and reduce duplication.

The patch also moves the event dispatching, for changed preference values, into `AppOptions` instead.
@Snuffleupagus Snuffleupagus force-pushed the BasePreferences-AppOptions-wrapper branch from 76af87d to d9f0ec0 Compare July 9, 2024 20:50
@timvandermeij timvandermeij merged commit 7ffea2f into mozilla:master Jul 9, 2024
9 checks passed
@timvandermeij
Copy link
Contributor

Thank you for doing this; it's a nice simplification!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants