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

Refactor buildSettings internals and add RPCSettings to settings #4352

Merged
merged 1 commit into from
Mar 28, 2022

Conversation

lyzadanger
Copy link
Contributor

@lyzadanger lyzadanger commented Mar 24, 2022

This PR is primarily concerned with refactoring the internal logic in build-settings module to be less ambiguous and more amenable to extension. The only outward-facing changes is that some information pertaining to making RPC requests is now retained on a new RPCSettings object that is part of SidebarSettings. We will need to "persist" information about which frame and origin to make RPC requests at (in settings) to be able to communicate about annotation activity to the LMS app to support improved Canvas grading submissions.

Part of hypothesis/lms#3647

Depends on #4351 (that one's ready to go, just held up by GitHub outages today, will deploy in the morning)

@codecov
Copy link

codecov bot commented Mar 24, 2022

Codecov Report

Merging #4352 (7a87abb) into master (1bfd85e) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master    #4352   +/-   ##
=======================================
  Coverage   99.14%   99.14%           
=======================================
  Files         225      225           
  Lines        8580     8585    +5     
  Branches     2032     2033    +1     
=======================================
+ Hits         8507     8512    +5     
  Misses         73       73           
Impacted Files Coverage Δ
src/sidebar/config/build-settings.js 100.00% <100.00%> (ø)

📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

*
* @param {ConfigFromHost} configFromHost
* @param {Window} window_
* @return {import('../../types/config').RPCSettings|null}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, minor nit. This was already imported and @typedef-d in this module.

Copy link
Member

@robertknight robertknight left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had a few comments and suggestions, but the changes overall make sense and the structure of buildSettings is now much easier to follow.

Base automatically changed from config-settings-naming to master March 25, 2022 11:35
@lyzadanger lyzadanger force-pushed the build-settings branch 2 times, most recently from 3394a5f to e46ece2 Compare March 25, 2022 13:19
Add a new `RPCSettings` type to retain RPC-related settings in
`SidebarSettings`. These are derived from values provided in
`ConfigFromHost`.

Refactor internals of `buildSettings` to have a less ambiguous flow and
retain RPC settings.

Part of hypothesis/lms#3647
@lyzadanger lyzadanger merged commit cf731e3 into master Mar 28, 2022
@lyzadanger lyzadanger deleted the build-settings branch March 28, 2022 12:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants