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

Reverts #3689 and #3738 back to the original working codebase #3830

Merged
merged 4 commits into from
Sep 12, 2023
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Revert to original code
  • Loading branch information
martinRenou committed Sep 11, 2023
commit 2e7d4f6b39c5591c0c1a5df20d2f26939399d3ee
13 changes: 2 additions & 11 deletions packages/base/src/widget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -566,21 +566,12 @@ export class WidgetModel extends Backbone.Model {
JSONExt.emptyObject;
for (const k of Object.keys(state)) {
try {
const keySerializers = serializers[k] || JSONExt.emptyObject;
let { serialize } = keySerializers;

if (serialize == null && keySerializers.deserialize === unpack_models) {
// handle https://github.com/jupyter-widgets/ipywidgets/issues/3735
serialize = deepcopyJSON;
}

if (serialize) {
state[k] = serialize(state[k], this);
if (serializers[k] && serializers[k].serialize) {
state[k] = serializers[k].serialize!(state[k], this);
} else {
// the default serializer just deep-copies the object
state[k] = JSON.parse(JSON.stringify(state[k]));
}

if (state[k] && state[k].toJSON) {
state[k] = state[k].toJSON();
}
Expand Down