Skip to content

Remove unnecessary computed() #133

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

Closed
wants to merge 1 commit into from
Closed

Conversation

whitphx
Copy link
Owner

@whitphx whitphx commented Jul 28, 2025

No description provided.

Copy link

changeset-bot bot commented Jul 28, 2025

⚠️ No Changeset found

Latest commit: cff42bf

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@whitphx whitphx requested a review from Copilot July 28, 2025 15:53
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR removes unnecessary computed() wrapping from arrow endpoint properties in the FancyArrow component. The changes simplify the code by converting computed properties to direct property access since the endpoint compilation doesn't need reactive updates.

  • Adds a type guard function isSnapTarget to improve type safety
  • Removes computed() wrappers from from and to properties
  • Updates type checking logic to use the new type guard function

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
components/parse-option.ts Adds isSnapTarget type guard function for better type safety
components/FancyArrow.vue Removes unnecessary computed() wrappers and updates type checking logic

y: props.y2,
}),
);
const from = compileArrowEndpointProps({
Copy link
Preview

Copilot AI Jul 28, 2025

Choose a reason for hiding this comment

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

Removing computed() may break reactivity. If any of the props (from, q1, id1, pos1, x1, y1) change, the from value will not update automatically, potentially causing stale data to be used in the component.

Copilot uses AI. Check for mistakes.

Comment on lines +45 to +52
const to = compileArrowEndpointProps({
shorthand: props.to,
q: props.q2,
id: props.id2,
pos: props.pos2,
x: props.x2,
y: props.y2,
});
Copy link
Preview

Copilot AI Jul 28, 2025

Choose a reason for hiding this comment

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

Removing computed() may break reactivity. If any of the props (to, q2, id2, pos2, x2, y2) change, the to value will not update automatically, potentially causing stale data to be used in the component.

Copilot uses AI. Check for mistakes.

@whitphx
Copy link
Owner Author

whitphx commented Jul 29, 2025

Reactivity is needed as #134

@whitphx whitphx closed this Jul 29, 2025
@whitphx whitphx deleted the fix/remove-unnecessary-computed branch August 12, 2025 17:14
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.

1 participant