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

chore: simplify viewbox cloning #935

Merged
merged 1 commit into from
Sep 27, 2024
Merged

chore: simplify viewbox cloning #935

merged 1 commit into from
Sep 27, 2024

Conversation

philippfromme
Copy link
Contributor

@philippfromme philippfromme commented Sep 27, 2024

Proposed Changes

Uses structuredClone to clone viewbox and simplifies test.

Previously code like this would get a reference to _cachedViewbox and then modify it.

Follow-up to #931

Checklist

To ensure you provided everything we need to look at your PR:

  • Brief textual description of the changes present
  • Visual demo attached
  • Steps to try out present, i.e. using the @bpmn-io/sr tool
  • Related issue linked via Closes {LINK_TO_ISSUE} or Related to {LINK_TO_ISSUE}

@nikku
Copy link
Member

nikku commented Sep 27, 2024

Ok, so this is where things break (we mutate the source), and we do it internally. The fix could also have been to not mutate the returned result.

I'm fine with the proposed fix though (safe in all cases).

@nikku nikku merged commit d1d9c75 into develop Sep 27, 2024
8 of 10 checks passed
@bpmn-io-tasks bpmn-io-tasks bot removed the needs review Review pending label Sep 27, 2024
@nikku nikku deleted the structured-clone branch September 27, 2024 14:53
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.

3 participants