Skip to content

bypass jsonpatch #809

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

Merged
merged 1 commit into from
Sep 13, 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
6 changes: 4 additions & 2 deletions docs/source/about/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ more info, see the :ref:`Contributor Guide <Creating a Changelog Entry>`.
Unreleased
----------

No changes.
**Changed**

- :pull:`809` - Avoid the use of JSON patch for diffing models.


v0.40.1
Expand All @@ -32,7 +34,7 @@ v0.40.1

**Fixed**

- :issue:`806` - child models after a component fail to render
- :issue:`806` - Child models after a component fail to render


v0.40.0 (yanked)
Expand Down
56 changes: 0 additions & 56 deletions src/idom/core/_fixed_jsonpatch.py

This file was deleted.

4 changes: 2 additions & 2 deletions src/idom/core/serve.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
from typing import Any, Awaitable, Callable, Dict, List, NamedTuple, cast

from anyio import create_task_group
from jsonpatch import apply_patch

from ._fixed_jsonpatch import apply_patch, make_patch # type: ignore
from .layout import LayoutEvent, LayoutUpdate
from .types import LayoutType, VdomJson

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


async def _single_outgoing_loop(
Expand Down