-
Notifications
You must be signed in to change notification settings - Fork 357
CSProgram: renderer user input state #2584
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
base: renderer-user-input-core
Are you sure you want to change the base?
Conversation
Size Change: +26 B (+0.01%) Total Size: 473 kB
ℹ️ View Unchanged
|
npm Snapshot: PublishedGood news!! We've packaged up the latest commit from this PR (df5f178) and published it to npm. You Example: pnpm add @khanacademy/perseus@PR2584 If you are working in Khan Academy's frontend, you can run the below command. ./tools/bump_perseus_version.js -t PR2584 If you are working in Khan Academy's webapp, you can run the below command. ./dev/tools/bump_perseus_version.js -s n -t PR2584 |
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.
More great improvements. I'm really happy to see another usage of changeable get removed - gosh was it adding a needless mess.
@@ -8,7 +8,6 @@ import * as React from "react"; | |||
import _ from "underscore"; | |||
|
|||
import {getDependencies} from "../../dependencies"; | |||
import * as Changeable from "../../mixins/changeable"; |
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.
YES THANK YOU. Little by little, we're finally getting rid of this.
Summary:
See the parent PR for more context. Part of LEMS-3208.
In #2566 I add additional APIs to let widgets consume
userInput
from a parent and to update that parent state usinghandleUserInput
, while also supporting the legacy way of storing user input (which was a combination of internal widget state and stashing state in a random blob in Renderer). This PR is part of a series of PRs that go widget-by-widget to use the new API.This is a generic summary I'm putting on each PR and not every point will be applicable to every widget, but the common themes are:
getSerializedState
andgetUserInputFromSerializedState
to keep supporting the expected results.userInput
state in Renderer. This means consuminguserInput
in the component and callinghandleUserInput
on change.transform
did something to initialize user input state, I moved the logic togetStartUserInput
.staticTransform
did something to get correct state in static widgets, I moved the logic togetCorrectUserInput
.Please see the parent PR for more information.
CSProgramEditor doesn't use CSProgram, so this shouldn't affect the editing experience