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: Upgrade immer to v9 #1135

Merged
merged 2 commits into from
Aug 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion editor.planx.uk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"formik": "^2.2.9",
"graphql": "^16.5.0",
"graphql-tag": "^2.12.6",
"immer": "^7.0.14",
"immer": "^9.0.15",
"js-cookie": "^3.0.1",
"jwt-decode": "^3.1.2",
"lodash": "^4.17.21",
Expand Down
14 changes: 5 additions & 9 deletions editor.planx.uk/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion editor.planx.uk/src/@planx/graph/__tests__/move.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ test("move within same parent", () => {
b: {},
});
expect(ops).toEqual([
{ od: ["a", "b"], oi: ["b", "a"], p: ["_root", "edges"] },
{ p: ["_root", "edges", 0], ld: "a", li: "b" },
{ p: ["_root", "edges", 1], ld: "b", li: "a" },
Comment on lines 18 to +20
Copy link
Contributor Author

@DafyddLlyr DafyddLlyr Aug 30, 2022

Choose a reason for hiding this comment

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

A little tricky to get to the bottom of this one initially. The test fails once v8.0.2 is installed, changelog here - https://github.com/immerjs/immer/releases/tag/v8.0.2

I believe this is the relevant change - immerjs/immer#648

Essentially, the move() graph function now generates two "list" (li & ld) operations as opposed to a two "object" operations (od & oi).

]);
});

Expand Down