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

Default shouldEmitPatchOnChange to false #108

Merged
merged 1 commit into from
Jul 11, 2024

Conversation

scott-rc
Copy link
Contributor

@scott-rc scott-rc commented Jul 11, 2024

We added shouldEmitPatchOnChange in #107, but defaulted it to true.

After starting to use shouldEmitPatchOnChange in Gadget, we realized that users should opt-in to emitting patches for snapshotted view changes rather than having to opt-out. This PR fixes that.

This is technically a breaking change but since so few people use mobx-quick-tree and #107 has been released for less than 24h this should be fine.

@scott-rc scott-rc force-pushed the sc/default-should-track-changes-to-false branch from 6b22061 to cd3d23f Compare July 11, 2024 14:27
@@ -72,27 +72,6 @@ describe("class model snapshotted views", () => {
expect(instance.slug).toEqual("test");
});

test("an observable instance emits a patch when the view value changes", () => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This test is already covered inside the describe("shouldEmitPatchOnChange", ...) tests.

Copy link

codspeed-hq bot commented Jul 11, 2024

CodSpeed Performance Report

Merging #108 will improve performances by 60.91%

Comparing sc/default-should-track-changes-to-false (cd3d23f) with main (91de9d1)

Summary

⚡ 1 improvements
✅ 10 untouched benchmarks

Benchmarks breakdown

Benchmark main sc/default-should-track-changes-to-false Change
instantiating deep references 143.1 µs 89 µs +60.91%

@scott-rc scott-rc marked this pull request as ready for review July 11, 2024 14:58
@scott-rc scott-rc merged commit a5d2865 into main Jul 11, 2024
6 checks passed
@scott-rc scott-rc deleted the sc/default-should-track-changes-to-false branch July 11, 2024 18:27
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