Skip to content

Remove getWidgetsMapFromItemData function#3416

Merged
jeremywiebe merged 5 commits intomainfrom
jer/remove-get-widgets-map-from-item-data
Mar 26, 2026
Merged

Remove getWidgetsMapFromItemData function#3416
jeremywiebe merged 5 commits intomainfrom
jer/remove-get-widgets-map-from-item-data

Conversation

@jeremywiebe
Copy link
Copy Markdown
Collaborator

Summary:

The getWidgetsMapFromItemData(itemData) function in it's entirety is return itemData.question.widgets. This is not really a function that adds any value (and in fact, the function name might actually confuse the matter).

Removing it so we don't have to maintain it.

Issue: LEMS-3949

Test plan:

pnpm test
pnpm typecheck

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 26, 2026

🗄️ Schema Change: No Changes ✅

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 26, 2026

🛠️ Item Splitting: No Changes ✅

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 26, 2026

Size Change: -40 B (-0.01%)

Total Size: 494 kB

Filename Size Change
packages/perseus/dist/es/index.js 192 kB -40 B (-0.02%)
ℹ️ View Unchanged
Filename Size
packages/kas/dist/es/index.js 20.5 kB
packages/keypad-context/dist/es/index.js 1 kB
packages/kmath/dist/es/index.js 6.21 kB
packages/math-input/dist/es/index.js 98.5 kB
packages/math-input/dist/es/strings.js 1.61 kB
packages/perseus-core/dist/es/index.item-splitting.js 11.9 kB
packages/perseus-core/dist/es/index.js 25.1 kB
packages/perseus-editor/dist/es/index.js 101 kB
packages/perseus-linter/dist/es/index.js 9.3 kB
packages/perseus-score/dist/es/index.js 9.66 kB
packages/perseus-utils/dist/es/index.js 403 B
packages/perseus/dist/es/strings.js 8.09 kB
packages/pure-markdown/dist/es/index.js 1.39 kB
packages/simple-markdown/dist/es/index.js 6.71 kB

compressed-size-action

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 26, 2026

npm Snapshot: Published

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

Example:

pnpm add @khanacademy/perseus@PR3416

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

./dev/tools/bump_perseus_version.ts -t PR3416

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

./dev/tools/bump_perseus_version.js -t PR3416

@jeremywiebe jeremywiebe force-pushed the jer/remove-get-widgets-map-from-item-data branch from 51386cd to 61bf146 Compare March 26, 2026 16:35
@jeremywiebe jeremywiebe marked this pull request as ready for review March 26, 2026 16:38
Copy link
Copy Markdown

@claude claude bot left a comment

Choose a reason for hiding this comment

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

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review to trigger a review.

Tip: disable this comment in your organization's Code Review settings.

Copy link
Copy Markdown
Member

@benchristel benchristel left a comment

Choose a reason for hiding this comment

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

LGTM!

@jeremywiebe jeremywiebe merged commit 3e1e498 into main Mar 26, 2026
11 checks passed
@jeremywiebe jeremywiebe deleted the jer/remove-get-widgets-map-from-item-data branch March 26, 2026 21:19
anakaren-rojas pushed a commit that referenced this pull request Mar 26, 2026
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]

### Major Changes

-   [#3416](#3416) [`3e1e498bf5`](3e1e498) Thanks [@jeremywiebe](https://github.com/jeremywiebe)! - Remove trivial function `getWidgetsMapFromItemData` - access widgets via `.question.widgets` instead.

### Patch Changes

-   [#3388](#3388) [`3f091b70cb`](3f091b7) Thanks [@nishasy](https://github.com/nishasy)! - [Image] | (UX) | Upscale Graphies within image zoom view

-   Updated dependencies \[[`6267d162b4`](6267d16), [`669ed4e6b1`](669ed4e), [`2d8df47440`](2d8df47)]:
    -   @khanacademy/[email protected]
    -   @khanacademy/[email protected]
    -   @khanacademy/[email protected]
    -   @khanacademy/[email protected]
    -   @khanacademy/[email protected]
    -   @khanacademy/[email protected]

## @khanacademy/[email protected]

### Major Changes

-   [#3414](#3414) [`669ed4e6b1`](669ed4e) Thanks [@benchristel](https://github.com/benchristel)! - Remove `null` from the type of `PerseusItem.answerArea`.

### Minor Changes

-   [#3406](#3406) [`6267d162b4`](6267d16) Thanks [@ivyolamit](https://github.com/ivyolamit)! - Use kmath canonicalTangentCoefficients for both Grapher and Interactive Graph widgets and then remove the duplicate code in grapher-util

## @khanacademy/[email protected]

### Minor Changes

-   [#3406](#3406) [`6267d162b4`](6267d16) Thanks [@ivyolamit](https://github.com/ivyolamit)! - Use kmath canonicalTangentCoefficients for both Grapher and Interactive Graph widgets and then remove the duplicate code in grapher-util

### Patch Changes

-   Updated dependencies \[[`6267d162b4`](6267d16), [`669ed4e6b1`](669ed4e)]:
    -   @khanacademy/[email protected]
    -   @khanacademy/[email protected]

## @khanacademy/[email protected]

### Patch Changes

-   Updated dependencies \[[`6267d162b4`](6267d16), [`669ed4e6b1`](669ed4e)]:
    -   @khanacademy/[email protected]

## @khanacademy/[email protected]

### Patch Changes

-   Updated dependencies \[[`6267d162b4`](6267d16), [`669ed4e6b1`](669ed4e)]:
    -   @khanacademy/[email protected]

## @khanacademy/[email protected]

### Patch Changes

-   Updated dependencies \[[`6267d162b4`](6267d16), [`669ed4e6b1`](669ed4e)]:
    -   @khanacademy/[email protected]
    -   @khanacademy/[email protected]

## @khanacademy/[email protected]

### Patch Changes

-   Updated dependencies \[[`6267d162b4`](6267d16), [`669ed4e6b1`](669ed4e), [`2d8df47440`](2d8df47), [`3f091b70cb`](3f091b7), [`3e1e498bf5`](3e1e498)]:
    -   @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

-   [#3419](#3419) [`2d8df47440`](2d8df47) Thanks [@anakaren-rojas](https://github.com/anakaren-rojas)! - changes return types of linter functions to not be readonly array; exports linterwarningitem

-   Updated dependencies \[[`6267d162b4`](6267d16), [`669ed4e6b1`](669ed4e)]:
    -   @khanacademy/[email protected]
    -   @khanacademy/[email protected]

Author: khan-actions-bot

Reviewers: claude[bot], anakaren-rojas

Required Reviewers:

Approved By: anakaren-rojas

Checks: ⏭️  2 checks have been skipped, ✅ 6 checks were successful

Pull Request URL: #3412
catandthemachines pushed a commit that referenced this pull request Apr 1, 2026
## Summary:

The `getWidgetsMapFromItemData(itemData)` function in it's entirety is `return itemData.question.widgets`. This is not really a function that adds any value (and in fact, the function name might actually confuse the matter).  

Removing it so we don't have to maintain it.

Issue: LEMS-3949

## Test plan:

`pnpm test`
`pnpm typecheck`

Author: jeremywiebe

Reviewers: claude[bot], benchristel, anakaren-rojas

Required Reviewers:

Approved By: benchristel

Checks: ⏭️  1 check has been skipped, ✅ 10 checks were successful

Pull Request URL: #3416
catandthemachines pushed a commit that referenced this pull request Apr 1, 2026
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]

### Major Changes

-   [#3416](#3416) [`3e1e498bf5`](3e1e498) Thanks [@jeremywiebe](https://github.com/jeremywiebe)! - Remove trivial function `getWidgetsMapFromItemData` - access widgets via `.question.widgets` instead.

### Patch Changes

-   [#3388](#3388) [`3f091b70cb`](3f091b7) Thanks [@nishasy](https://github.com/nishasy)! - [Image] | (UX) | Upscale Graphies within image zoom view

-   Updated dependencies \[[`6267d162b4`](6267d16), [`669ed4e6b1`](669ed4e), [`2d8df47440`](2d8df47)]:
    -   @khanacademy/[email protected]
    -   @khanacademy/[email protected]
    -   @khanacademy/[email protected]
    -   @khanacademy/[email protected]
    -   @khanacademy/[email protected]
    -   @khanacademy/[email protected]

## @khanacademy/[email protected]

### Major Changes

-   [#3414](#3414) [`669ed4e6b1`](669ed4e) Thanks [@benchristel](https://github.com/benchristel)! - Remove `null` from the type of `PerseusItem.answerArea`.

### Minor Changes

-   [#3406](#3406) [`6267d162b4`](6267d16) Thanks [@ivyolamit](https://github.com/ivyolamit)! - Use kmath canonicalTangentCoefficients for both Grapher and Interactive Graph widgets and then remove the duplicate code in grapher-util

## @khanacademy/[email protected]

### Minor Changes

-   [#3406](#3406) [`6267d162b4`](6267d16) Thanks [@ivyolamit](https://github.com/ivyolamit)! - Use kmath canonicalTangentCoefficients for both Grapher and Interactive Graph widgets and then remove the duplicate code in grapher-util

### Patch Changes

-   Updated dependencies \[[`6267d162b4`](6267d16), [`669ed4e6b1`](669ed4e)]:
    -   @khanacademy/[email protected]
    -   @khanacademy/[email protected]

## @khanacademy/[email protected]

### Patch Changes

-   Updated dependencies \[[`6267d162b4`](6267d16), [`669ed4e6b1`](669ed4e)]:
    -   @khanacademy/[email protected]

## @khanacademy/[email protected]

### Patch Changes

-   Updated dependencies \[[`6267d162b4`](6267d16), [`669ed4e6b1`](669ed4e)]:
    -   @khanacademy/[email protected]

## @khanacademy/[email protected]

### Patch Changes

-   Updated dependencies \[[`6267d162b4`](6267d16), [`669ed4e6b1`](669ed4e)]:
    -   @khanacademy/[email protected]
    -   @khanacademy/[email protected]

## @khanacademy/[email protected]

### Patch Changes

-   Updated dependencies \[[`6267d162b4`](6267d16), [`669ed4e6b1`](669ed4e), [`2d8df47440`](2d8df47), [`3f091b70cb`](3f091b7), [`3e1e498bf5`](3e1e498)]:
    -   @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

-   [#3419](#3419) [`2d8df47440`](2d8df47) Thanks [@anakaren-rojas](https://github.com/anakaren-rojas)! - changes return types of linter functions to not be readonly array; exports linterwarningitem

-   Updated dependencies \[[`6267d162b4`](6267d16), [`669ed4e6b1`](669ed4e)]:
    -   @khanacademy/[email protected]
    -   @khanacademy/[email protected]

Author: khan-actions-bot

Reviewers: claude[bot], anakaren-rojas

Required Reviewers:

Approved By: anakaren-rojas

Checks: ⏭️  2 checks have been skipped, ✅ 6 checks were successful

Pull Request URL: #3412
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