Skip to content

Commit 7caa4ab

Browse files
authored
bypass jsonpatch (#809)
1 parent 824eeb5 commit 7caa4ab

File tree

3 files changed

+6
-60
lines changed

3 files changed

+6
-60
lines changed

docs/source/about/changelog.rst

+4-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ more info, see the :ref:`Contributor Guide <Creating a Changelog Entry>`.
2323
Unreleased
2424
----------
2525

26-
No changes.
26+
**Changed**
27+
28+
- :pull:`809` - Avoid the use of JSON patch for diffing models.
2729

2830

2931
v0.40.1
@@ -32,7 +34,7 @@ v0.40.1
3234

3335
**Fixed**
3436

35-
- :issue:`806` - child models after a component fail to render
37+
- :issue:`806` - Child models after a component fail to render
3638

3739

3840
v0.40.0 (yanked)

src/idom/core/_fixed_jsonpatch.py

-56
This file was deleted.

src/idom/core/serve.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
from typing import Any, Awaitable, Callable, Dict, List, NamedTuple, cast
77

88
from anyio import create_task_group
9+
from jsonpatch import apply_patch
910

10-
from ._fixed_jsonpatch import apply_patch, make_patch # type: ignore
1111
from .layout import LayoutEvent, LayoutUpdate
1212
from .types import LayoutType, VdomJson
1313

@@ -74,7 +74,7 @@ def apply_to(self, model: VdomJson) -> VdomJson:
7474
@classmethod
7575
def create_from(cls, update: LayoutUpdate) -> VdomJsonPatch:
7676
"""Return a patch given an layout update"""
77-
return cls(update.path, make_patch(update.old or {}, update.new).patch)
77+
return cls(update.path, [{"op": "replace", "path": "", "value": update.new}])
7878

7979

8080
async def _single_outgoing_loop(

0 commit comments

Comments
 (0)