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

Rename _recipe and _deployment fields on ModComponent #9253

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

twschiller
Copy link
Contributor

@twschiller twschiller commented Oct 8, 2024

What does this PR do?

Discussion

  • Do we want to mark as deploymentMetadata instead of deploymentMetadata?. PR currently uses ? which is the old behavior. But we could use the migration as an opportunity to ensure the property exists but the value might be undefined

Remaining Work

  • Double-check CI is green

Future Work

  • Drop standaloneModComponentRefFactory
  • Search for "standalone" in codebase and remove unnecessary branches/code

For more information on our expectations for the PR process, see the
code review principles doc

@twschiller twschiller self-assigned this Oct 8, 2024
Comment on lines +197 to 199
* @see ModComponentBase.modMetadata
* @since 2.0.5
*/
Copy link
Collaborator

Choose a reason for hiding this comment

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

I wonder if there already exists, or if we can create, a lint rule that requires all @<foo>s to be at the end of the JSDoc 🤔

Copy link

github-actions bot commented Oct 8, 2024

Playwright test results

passed  135 passed
flaky  3 flaky
skipped  4 skipped

Details

report  Open report ↗︎
stats  142 tests across 46 suites
duration  13 minutes, 25 seconds
commit  56981bd
info  For more information on how to debug and view this report, see our readme

Flaky tests

chrome › tests/pageEditor/addStarterBrick.spec.ts › Add starter brick to mod
msedge › tests/pageEditor/addStarterBrick.spec.ts › Add new mod with different starter brick components
msedge › tests/pageEditor/addStarterBrick.spec.ts › Add starter brick to mod

Skipped tests

chrome › tests/regressions/doNotCloseSidebarOnPageEditorSave.spec.ts › #8104: Do not automatically close the sidebar when saving in the Page Editor
msedge › tests/regressions/doNotCloseSidebarOnPageEditorSave.spec.ts › #8104: Do not automatically close the sidebar when saving in the Page Editor
chrome › tests/runtime/googleSheetsIntegration.spec.ts › can activate a google spreadsheet mod with config options
msedge › tests/runtime/googleSheetsIntegration.spec.ts › can activate a google spreadsheet mod with config options

/**
* @deprecated - Do not use versioned state types directly
*/
export type ModComponentBaseV4<Config extends UnknownObject = UnknownObject> =
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Reviewer Note: type change is here

@@ -200,9 +217,32 @@ function migrateModComponentStateV4toV5(
};
}

function migrateModComponentStateV5toV6(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Reviewer note: here's the migration

@twschiller twschiller added this to the 2.1.5 milestone Oct 8, 2024
Copy link

codecov bot commented Oct 8, 2024

Codecov Report

Attention: Patch coverage is 89.04110% with 8 lines in your changes missing coverage. Please review.

Project coverage is 75.11%. Comparing base (8318d74) to head (56981bd).
Report is 351 commits behind head on main.

Files with missing lines Patch % Lines
src/background/telemetry.ts 50.00% 1 Missing ⚠️
.../extensionConsole/pages/packageEditor/EditPage.tsx 0.00% 1 Missing ⚠️
.../extensionConsole/pages/settings/useDiagnostics.ts 50.00% 1 Missing ⚠️
.../modListingPanel/ActivatedModComponentListItem.tsx 50.00% 1 Missing ⚠️
src/pageEditor/store/analysisManager.ts 0.00% 1 Missing ⚠️
src/starterBricks/helpers.ts 0.00% 1 Missing ⚠️
src/store/modComponents/modComponentSlice.ts 80.00% 1 Missing ⚠️
src/store/modComponents/modComponentStorage.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9253      +/-   ##
==========================================
+ Coverage   74.24%   75.11%   +0.86%     
==========================================
  Files        1332     1370      +38     
  Lines       40817    42299    +1482     
  Branches     7634     7890     +256     
==========================================
+ Hits        30306    31774    +1468     
- Misses      10511    10525      +14     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -687,4 +731,38 @@ describe("mod component state migrations", () => {
);
});
});

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Migration test cases

(x) => x.id,
),
extensions: modComponents.filter((x) => !x._recipe),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Dropped extensions because it would always be empty

@@ -57,7 +57,7 @@ function useDeactivateMod(): (useDeactivateConfig: Config) => Promise<void> {

const modComponentIds = uniq(
[...activatedModComponents, ...modComponentFormStates]
.filter((x) => getModId(x) === modId)
.filter((x) => x.modMetadata.id === modId)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Got rid of getModId because both formState and modComponent have the same prop name now

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.

2 participants