-
Notifications
You must be signed in to change notification settings - Fork 709
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
Adapt kolibri to use latest version of xstate library #12783
base: develop
Are you sure you want to change the base?
Conversation
Build Artifacts
|
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 read through the code and it largely looks great - I love seeing v5 in action here and that the API changes were relatively straightforward.
The one issue I noted regarding the wizardMachine guards might be blocking - I didn't spin it up yet and may be missing something there. Otherwise, just a suggestion to update a comment.
@@ -103,11 +102,11 @@ export const wizardMachine = createMachine( | |||
{ | |||
// `cond` takes a function that returns a Boolean, continuing to the |
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.
Picking a nit - the comment here still references cond
.
return context.fullOrLOD === DeviceTypePresets.FULL; | ||
}, | ||
isNewFacility: context => context.facilityNewOrImport === FacilityTypePresets.NEW, | ||
isImportFacility: context => context.facilityNewOrImport === FacilityTypePresets.IMPORT, |
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 notice that the function passed to guard
seems to be expecting an object on the first param (relevant docs) shaped like { context, event }
-- but here we only handle one param as if it's the context.
Makes me wonder if there might be issues uncovered by tests in the setup wizard because of this.
Summary
Changes in machines and components to upgrade xstate library in kolibri from version 4 to version 5.
This PR will have to stay in draft until learningequality/kolibri-design-system#814 can be merged, so kolibri design system uses xstate version 5 too.
Until KDS uses this library tests of the implementation won't work as it will drag xstate v4.
References
Closes: #11614
Reviewer guidance
Testing checklist
PR process
Reviewer checklist
yarn
andpip
)