Skip to content

WIP - Remove renderer's deprecated getUserInput in favor of the preferred getUserInputMap #2590

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

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

Myranae
Copy link
Contributor

@Myranae Myranae commented Jun 12, 2025

Summary:

Renderer currently has two methods for getting user input: the deprecated method getUserInput which returns an array of type UserInputArray and the preferred getUserInputMap which returns an object of type UserInputMap. The object type is the preferred format going forward and is currently used in scoring and will be used in scoring via the new Perseus service.

To remove the deprecated method, we replace all uses of it in Perseus with the preferred method and then delete tests and comments related to the deprecated method. This change will require some coordination with other teams that rely on this functionality outside of Perseus and most likely updates to where user input is consumed. Testing will take place to determine the necessary places that require updates.

Issue: LEMS-2523

Test plan:

  • Confirm all checks/tests pass
  • Add tests to Webapp around UserInputArray usage so we can locate places that need to be updated
    --- Use the tests to update all usages until all tests pass
  • Possibly play tests or some manual testing of all places known to be affected

@Myranae Myranae self-assigned this Jun 12, 2025
Copy link
Contributor

github-actions bot commented Jun 12, 2025

Size Change: -49 B (-0.01%)

Total Size: 472 kB

Filename Size Change
packages/perseus/dist/es/index.js 200 kB -49 B (-0.02%)
ℹ️ View Unchanged
Filename Size
packages/kas/dist/es/index.js 20.7 kB
packages/keypad-context/dist/es/index.js 1 kB
packages/kmath/dist/es/index.js 5.98 kB
packages/math-input/dist/es/index.js 98.6 kB
packages/math-input/dist/es/strings.js 1.61 kB
packages/perseus-core/dist/es/index.js 20.4 kB
packages/perseus-editor/dist/es/index.js 91.2 kB
packages/perseus-linter/dist/es/index.js 7.14 kB
packages/perseus-score/dist/es/index.js 9.23 kB
packages/perseus-utils/dist/es/index.js 403 B
packages/perseus/dist/es/strings.js 7.56 kB
packages/pure-markdown/dist/es/index.js 1.22 kB
packages/simple-markdown/dist/es/index.js 6.71 kB

compressed-size-action

@Myranae Myranae changed the title Remove renderer's deprecated getUserInput in favor of the preferred getUserInputMap WIP - Remove renderer's deprecated getUserInput in favor of the preferred getUserInputMap Jun 12, 2025
Comment on lines +2 to +5
"@khanacademy/perseus": major
---

Replace deprecated array format of user input with preferred object format to consolidate the user input types.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am pretty sure this is a major change, but not sure if I need to add more information to the changelog. I add more details in the PR summary, so not sure.

Copy link
Contributor

github-actions bot commented Jun 12, 2025

npm Snapshot: Published

Good news!! We've packaged up the latest commit from this PR (21cbbdb) and published it to npm. You
can install it using the tag PR2590.

Example:

pnpm add @khanacademy/perseus@PR2590

If you are working in Khan Academy's frontend, you can run the below command.

./tools/bump_perseus_version.js -t PR2590

If you are working in Khan Academy's webapp, you can run the below command.

./dev/tools/bump_perseus_version.js -s n -t PR2590

@Myranae Myranae force-pushed the tb/LEMS-2523/merge-get-user-input-map branch from a45d3b8 to 68a6c2d Compare June 18, 2025 17:56
Myranae added 3 commits June 18, 2025 12:59
…EMS-2523/merge-get-user-input-map

# Conflicts:
#	packages/perseus/src/__tests__/renderer.test.tsx
#	testing/server-item-renderer-with-debug-ui.tsx
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.

1 participant