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

Knip 4: remove MovablePoint duplicate export #1774

Merged
merged 8 commits into from
Oct 22, 2024
Merged

Knip 4: remove MovablePoint duplicate export #1774

merged 8 commits into from
Oct 22, 2024

Conversation

handeyeco
Copy link
Contributor

@handeyeco handeyeco commented Oct 21, 2024

Summary:

MovablePoint was being exported twice: export class MovablePoint and export default MovablePoint

Found by Knip.

@handeyeco handeyeco self-assigned this Oct 21, 2024
@khan-actions-bot
Copy link
Contributor

khan-actions-bot commented Oct 21, 2024

Gerald

Required Reviewers
  • @Khan/perseus for changes to knip.config.ts, package.json, yarn.lock, .changeset/short-sheep-happen.md, packages/perseus/src/interactive2/movable-point.tsx

Don't want to be involved in this pull request? Comment #removeme and we won't notify you of further changes.

@khan-actions-bot khan-actions-bot requested a review from a team October 21, 2024 16:19
@handeyeco handeyeco changed the title remove duplicate export Knip 4: remove MovablePoint duplicate export Oct 21, 2024
@handeyeco handeyeco requested a review from benchristel October 21, 2024 16:19
Copy link
Contributor

github-actions bot commented Oct 21, 2024

npm Snapshot: Published

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

Example:

yarn add @khanacademy/perseus@PR1774

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

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

Copy link
Contributor

github-actions bot commented Oct 21, 2024

Size Change: 0 B

Total Size: 867 kB

ℹ️ View Unchanged
Filename Size
packages/kas/dist/es/index.js 38.8 kB
packages/keypad-context/dist/es/index.js 760 B
packages/kmath/dist/es/index.js 4.27 kB
packages/math-input/dist/es/index.js 78 kB
packages/math-input/dist/es/strings.js 1.79 kB
packages/perseus-core/dist/es/index.js 1.48 kB
packages/perseus-editor/dist/es/index.js 281 kB
packages/perseus-linter/dist/es/index.js 22.2 kB
packages/perseus/dist/es/index.js 420 kB
packages/perseus/dist/es/strings.js 3.4 kB
packages/pure-markdown/dist/es/index.js 3.66 kB
packages/simple-markdown/dist/es/index.js 12.4 kB

compressed-size-action

Copy link
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.

I'd prefer to keep the named export and remove the default export.

Named exports make it easier to find where stuff is defined or used by grepping.

@khan-actions-bot khan-actions-bot requested a review from a team October 22, 2024 14:36
@handeyeco handeyeco requested a review from benchristel October 22, 2024 14:37
@handeyeco
Copy link
Contributor Author

@benchristel Thanks for the feedback. I don't really agree, but I made the change anyway. I think I see your point, that renaming imports is less explicit with default exports (import Whatever from "something" vs import {Something as Whatever} from "something"). I could certainly be convinced, I just think it's inconsistent with the rest of our code base.

No skin off my back either way though. I appreciate you taking the time to review all of these.

Base automatically changed from add-knip to main October 22, 2024 14:57
@@ -801,5 +801,3 @@ function getKey(eventName: string, id: string): string {
function getEventName(key: string): string {
return key.split(":")[0];
}

export default MovablePoint;
Copy link
Collaborator

Choose a reason for hiding this comment

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

We really should have a final call on whether we use default exports or named. I find a single named export kinda weird, but it protects against an import changing the name and being confusing. 🤔

@handeyeco handeyeco merged commit cb3b8f3 into main Oct 22, 2024
9 checks passed
@handeyeco handeyeco deleted the knip-4 branch October 22, 2024 15:33
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.

4 participants