Skip to content
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

Create a function to get the public options for LabelImage #2171

Merged
merged 5 commits into from
Jan 29, 2025

Conversation

benchristel
Copy link
Member

Issue: LEMS-2769

Test plan:

yarn test

Copy link
Contributor

github-actions bot commented Jan 29, 2025

npm Snapshot: Published

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

Example:

yarn add @khanacademy/perseus@PR2171

If you are working in Khan Academy's webapp, you can run:

./dev/tools/bump_perseus_version.sh -t PR2171

Copy link
Contributor

github-actions bot commented Jan 29, 2025

Size Change: +108 B (+0.01%)

Total Size: 1.48 MB

Filename Size Change
packages/perseus-core/dist/es/index.js 43.2 kB +86 B (+0.2%)
packages/perseus/dist/es/index.js 381 kB +22 B (+0.01%)
ℹ️ View Unchanged
Filename Size
packages/kas/dist/es/index.js 39 kB
packages/keypad-context/dist/es/index.js 760 B
packages/kmath/dist/es/index.js 86.8 kB
packages/math-input/dist/es/index.js 77.6 kB
packages/math-input/dist/es/strings.js 1.79 kB
packages/perseus-editor/dist/es/index.js 688 kB
packages/perseus-linter/dist/es/index.js 22.2 kB
packages/perseus-score/dist/es/index.js 113 kB
packages/perseus/dist/es/strings.js 5.82 kB
packages/pure-markdown/dist/es/index.js 3.66 kB
packages/simple-markdown/dist/es/index.js 12.5 kB

compressed-size-action

Copy link
Contributor

@Myranae Myranae left a comment

Choose a reason for hiding this comment

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

Looks good! Added some comments/questions, but nothing blocking. Looks like there are some prettier formatting issues in the label-image.tsx file though

Comment on lines 17 to 19
hideChoicesFromInstructions: boolean;
multipleAnswers: boolean;
static: boolean;
Copy link
Contributor

Choose a reason for hiding this comment

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

Curious why these ones are listed as boolean while the others reference the original widget options. Wouldn't it be good to reference the original type for all of the fields that are unchanged?

Comment on lines +39 to +40
const {answers: _, ...publicData} = marker;
return publicData;
Copy link
Contributor

Choose a reason for hiding this comment

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

So here, instead of building out the wanted object, you're using destructuring to pull out answers, is that correct? What does using the underscore do? Is that just to help signify that we aren't interested in the answers here? Looks like it's needed to satisfy ESLint.

Copy link
Member Author

Choose a reason for hiding this comment

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

What does using the underscore do? Is that just to help signify that we aren't interested in the answers here?

Correct!

@@ -0,0 +1,5 @@
---
"@khanacademy/perseus-core": minor
Copy link
Contributor

Choose a reason for hiding this comment

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

Should there be a line here for perseus since there are changes there as well?

Copy link
Member Author

Choose a reason for hiding this comment

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

Good catch! I guess this is one reason not to generate the changeset until the PR is reviewed 🤔

@benchristel benchristel merged commit a470c79 into main Jan 29, 2025
8 checks passed
@benchristel benchristel deleted the benc/label-image branch January 29, 2025 22:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants