Skip to content

Rename WidgetPropsV2 to WidgetProps; inline UniversalWidgetProps - #4076

Merged
benchristel merged 3 commits into
benc/widget-props-redesignfrom
benc/widget-props-3
Aug 13, 2026
Merged

Rename WidgetPropsV2 to WidgetProps; inline UniversalWidgetProps#4076
benchristel merged 3 commits into
benc/widget-props-redesignfrom
benc/widget-props-3

Conversation

@benchristel

Copy link
Copy Markdown
Member

Summary:

This is the penultimate change to close out the widget props migration. All
widgets now accept their options as a separate prop, so the old WidgetProps
is no longer used. This PR deletes the old WidgetProps and renames
WidgetPropsV2 to WidgetProps. We also inline UniversalWidgetProps into
WidgetProps since it doesn't need to be a separate type anymore.

Issue: LEMS-4354

Test plan:

CI checks should pass.

@github-actions

Copy link
Copy Markdown
Contributor

npm Snapshot

Want to try this PR's changes before it merges? Comment /snapshot below and we'll publish an npm snapshot you can install right away.

@github-actions

Copy link
Copy Markdown
Contributor

Size Change: -16 B (0%)

Total Size: 519 kB

📦 View Changed
Filename Size Change
packages/perseus/dist/es/index.js 203 kB -16 B (-0.01%)
ℹ️ View Unchanged
Filename Size
packages/kas/dist/es/index.js 20.6 kB
packages/keypad-context/dist/es/index.js 1 kB
packages/kmath/dist/es/index.js 6.31 kB
packages/math-input/dist/es/index.js 98.6 kB
packages/math-input/dist/es/strings.js 1.63 kB
packages/perseus-core/dist/es/index.item-splitting.js 13.1 kB
packages/perseus-core/dist/es/index.js 28.1 kB
packages/perseus-editor/dist/es/index.js 106 kB
packages/perseus-linter/dist/es/index.js 10.1 kB
packages/perseus-score/dist/es/index.js 9.86 kB
packages/perseus-utils/dist/es/index.js 403 B
packages/perseus/dist/es/strings.js 12.9 kB
packages/pure-markdown/dist/es/index.js 1.39 kB
packages/simple-markdown/dist/es/index.js 6.12 kB

compressed-size-action

@jeremywiebe jeremywiebe left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Such a huge improvement. Thanks for working on this Ben!

Comment thread __docs__/introduction.mdx Outdated
| Type | Description |
| ---- | ----------- |
| \`WidgetProps\<T\>\` | All widgets receive a common set of props from the parent \`Renderer\` component This set of props is defined by the \`WidgetProps\<T\>\` type (\`T\` being the specific render props the widget uses). |
| \`WidgetProps\<T\>\` | All widgets receive a common set of props from the parent \`Renderer\` component This set of props is defined by the \`WidgetProps\<T\>\` type (\`T\` being the type of the widget's own options, which arrive under the \`options\` prop). |

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
| \`WidgetProps\<T\>\` | All widgets receive a common set of props from the parent \`Renderer\` component This set of props is defined by the \`WidgetProps\<T\>\` type (\`T\` being the type of the widget's own options, which arrive under the \`options\` prop). |
| \`WidgetProps\<T\>\` | All widgets receive a common set of props from the parent \`Renderer\` component. This set of props is defined by the \`WidgetProps\<T\>\` type (\`T\` being the type of the widget's own options, which arrive under the \`options\` prop). |

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I ended up replacing this whole table with a brief paragraph. There's not that much to explain about widget props anymore!

Comment on lines 457 to +460
* The full set of props provided to all widgets when they are rendered. The
* `TWidgetOptions` generic argument are the widget-specific props that originate
* from the PerseusItem.
* widget-specific options that originate from the PerseusItem are nested under
* the `options` prop; everything else is provided to every widget regardless of
* its `type`.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Image

Base automatically changed from benc/widget-props-2 to benc/widget-props-redesign August 13, 2026 22:31
@benchristel
benchristel merged commit 242424d into benc/widget-props-redesign Aug 13, 2026
10 checks passed
@benchristel
benchristel deleted the benc/widget-props-3 branch August 13, 2026 22:49
benchristel added a commit that referenced this pull request Aug 13, 2026
## Summary:
This is the penultimate change to close out the widget props migration. All
widgets now accept their `options` as a separate prop, so the old `WidgetProps`
is no longer used. This PR deletes the old `WidgetProps` and renames
`WidgetPropsV2` to `WidgetProps`. We also inline `UniversalWidgetProps` into
`WidgetProps` since it doesn't need to be a separate type anymore.

Issue: LEMS-4354

## Test plan:

CI checks should pass.

Author: benchristel

Reviewers: jeremywiebe, nishasy, handeyeco, ivyolamit, Myranae, catandthemachines

Required Reviewers:

Approved By: jeremywiebe

Checks: ✅ 10 checks were successful

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