-
Notifications
You must be signed in to change notification settings - Fork 354
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
[LEMS-2868] Answerless ServerItemRendererWithDebugUI #2289
Conversation
…ionally render answerless data
Size Change: 0 B Total Size: 736 kB ℹ️ View Unchanged
|
npm Snapshot: PublishedGood news!! We've packaged up the latest commit from this PR (25d3d1f) and published it to npm. You Example: pnpm add @khanacademy/perseus@PR2289 If you are working in Khan Academy's webapp, you can run: ./dev/tools/bump_perseus_version.sh -t PR2289 |
…ererWithDebugUI to optionally use answerless data for rendering
} from "@khanacademy/perseus-core"; | ||
|
||
const createItemJson = ( | ||
widgetOptions: PerseusExpressionWidgetOptions, | ||
version: Version, |
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.
It seems like changing version to widgetVersion, adding extra keys, and modifying item 3 below is all that was done here. Did you add an item without answers somewhere? I think the big red and green chunks were just moved code, but I might have missed something.
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.
This looks reasonable. One bit of feedback is that I'd suggest you revert the code moves unless there's a good reason as it'll make the PR clearer what's actually being changed.
@@ -122,6 +125,16 @@ export const ExpressionItem3 = (args: StoryArgs): React.ReactElement => { | |||
); | |||
}; | |||
|
|||
export const AnswerlessExpression = (args: StoryArgs): React.ReactElement => { |
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.
Where is this used? I don't see it referenced in this PR at all.
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.
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 didn't take note this was in a .stories.tsx
file!
} from "@khanacademy/perseus-core"; | ||
|
||
const createItemJson = ( | ||
widgetOptions: PerseusExpressionWidgetOptions, | ||
version: Version, | ||
widgetVersion: Version = expressionLogic.version as Version, |
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.
Can we use satisfies
instead of as
here? Also, why do we need the cast at all? :)
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.
expressionLogic
is of type WidgetLogic
and not all widgets have versions so version?: Version
You're right thought, it was overkill. It works with widgetVersion = expressionLogic.version
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated. # Releases ## @khanacademy/[email protected] ### Patch Changes - Updated dependencies \[[`1b5f51415`](1b5f514), [`4c0b317c3`](4c0b317), [`335940746`](3359407)]: - @khanacademy/[email protected] ## @khanacademy/[email protected] ### Patch Changes - Updated dependencies \[[`1b5f51415`](1b5f514), [`4c0b317c3`](4c0b317), [`335940746`](3359407)]: - @khanacademy/[email protected] ## @khanacademy/[email protected] ### Patch Changes - Updated dependencies \[[`1b5f51415`](1b5f514), [`4c0b317c3`](4c0b317), [`335940746`](3359407)]: - @khanacademy/[email protected] - @khanacademy/[email protected] ## @khanacademy/[email protected] ### Patch Changes - [#2289](#2289) [`87420d7d3`](87420d7) Thanks [@handeyeco](https://github.com/handeyeco)! - Update ServerItemRendererWithDebugUI to optionally use answerless data for rendering - [#2313](#2313) [`3b0b1c700`](3b0b1c7) Thanks [@nishasy](https://github.com/nishasy)! - [LX] Stop locked functions from memory leaking - Updated dependencies \[[`1b5f51415`](1b5f514), [`c170c1d3c`](c170c1d), [`4c0b317c3`](4c0b317), [`335940746`](3359407)]: - @khanacademy/[email protected] - @khanacademy/[email protected] - @khanacademy/[email protected] - @khanacademy/[email protected] - @khanacademy/[email protected] - @khanacademy/[email protected] ## @khanacademy/[email protected] ### Patch Changes - [#2308](#2308) [`1b5f51415`](1b5f514) Thanks [@benchristel](https://github.com/benchristel)! - Fix a bug in numeric input scoring where `simplify` value of `false` led to incorrect scoring logic being applied - [#2319](#2319) [`4c0b317c3`](4c0b317) Thanks [@benchristel](https://github.com/benchristel)! - Internal: unskip regression tests for Perseus JSON parser and update snapshots - [#2272](#2272) [`335940746`](3359407) Thanks [@handeyeco](https://github.com/handeyeco)! - Add comments to external-facing functions ## @khanacademy/[email protected] ### Patch Changes - Updated dependencies \[[`1b5f51415`](1b5f514), [`c170c1d3c`](c170c1d), [`87420d7d3`](87420d7), [`4c0b317c3`](4c0b317), [`335940746`](3359407), [`3b0b1c700`](3b0b1c7)]: - @khanacademy/[email protected] - @khanacademy/[email protected] - @khanacademy/[email protected] - @khanacademy/[email protected] - @khanacademy/[email protected] - @khanacademy/[email protected] - @khanacademy/[email protected] ## @khanacademy/[email protected] ### Patch Changes - Updated dependencies \[[`1b5f51415`](1b5f514), [`4c0b317c3`](4c0b317), [`335940746`](3359407)]: - @khanacademy/[email protected] ## @khanacademy/[email protected] ### Patch Changes - [#2278](#2278) [`c170c1d3c`](c170c1d) Thanks [@handeyeco](https://github.com/handeyeco)! - Remove jQuery as a dependency of perseus-score - [#2272](#2272) [`335940746`](3359407) Thanks [@handeyeco](https://github.com/handeyeco)! - Add comments to external-facing functions - Updated dependencies \[[`1b5f51415`](1b5f514), [`4c0b317c3`](4c0b317), [`335940746`](3359407)]: - @khanacademy/[email protected] - @khanacademy/[email protected] ## @khanacademy/[email protected] ### Patch Changes - Updated dependencies \[[`1b5f51415`](1b5f514), [`4c0b317c3`](4c0b317), [`335940746`](3359407)]: - @khanacademy/[email protected] - @khanacademy/[email protected] - @khanacademy/[email protected] - @khanacademy/[email protected] Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Summary:
I wanted to be able to render/use widgets in Storybook, but have them rendered using answerless data rather than the full data.
Issue: LEMS-2868