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

misc: split lhr compat code to lib/lighthouse-compatibility.js #14701

Merged
merged 1 commit into from
Feb 1, 2023

Conversation

connorjclark
Copy link
Collaborator

Split out the changes made for convenience from those made to maintain backwards compatibility. Also exposes to node api.

@connorjclark connorjclark requested a review from a team as a code owner January 23, 2023 20:27
@connorjclark connorjclark requested review from adamraine and removed request for a team January 23, 2023 20:27
core/util.cjs Outdated
* TODO(team): we all agree the LHR shape change is technical debt we should fix
* @param {LH.Result} result
* @return {LH.ReportResult}
* Upgrades an lhr object in-place to account for changes in the data structure over major versions.
Copy link
Member

Choose a reason for hiding this comment

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

Maybe add a note here mentioning that this doesn't verify lhr shape

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Wait, what about the name/interface makes that not clear already?

Copy link
Member

Choose a reason for hiding this comment

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

Fair, it's probably fine.

core/util.cjs Outdated Show resolved Hide resolved
core/util.cjs Outdated Show resolved Hide resolved
core/util.cjs Outdated Show resolved Hide resolved
Copy link
Member

@adamraine adamraine left a comment

Choose a reason for hiding this comment

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

Looks good pending CI + spelling

@connorjclark
Copy link
Collaborator Author

connorjclark commented Jan 27, 2023

Updated to account for recent util/report util split.

shared/util.js Outdated Show resolved Hide resolved
shared/util.js Outdated Show resolved Hide resolved
shared/util.js Outdated Show resolved Hide resolved
@connorjclark connorjclark changed the title core: expose back compat as upgradeLhrForCompatability misc: split lhr compat code to lib/lighthouse-compatibility.js Jan 31, 2023
@connorjclark connorjclark merged commit ddf48a9 into main Feb 1, 2023
@connorjclark connorjclark deleted the compat-refactor branch February 1, 2023 00:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants