Skip to content
This repository has been archived by the owner on May 25, 2021. It is now read-only.

"No state to show" when state contain window #1393

Open
nindza90 opened this issue Jun 9, 2019 · 2 comments
Open

"No state to show" when state contain window #1393

nindza90 opened this issue Jun 9, 2019 · 2 comments

Comments

@nindza90
Copy link

nindza90 commented Jun 9, 2019

When component contains window then state doesnt show(we have message: "No state to show").
I think it is connection with this bugs: #1389, #1368.

I have solution:
my changes in augury/src/utils/serialize.ts

import { parse, stringify } from 'jsan';

/// The intent of serialize() is to create a function that is itself able to
/// reconstruct {@param object} into an exact clone that includes circular
/// references and objects that are not normally serializable by something like
/// {@link JSON.stringify}. It returns a string containing the code for the
/// reconstructor function. That value can be passed to a Function constructor
/// which will parse it into a function that can then be invoked to recreate
/// the original object. In this way we are able to serialize an object for
/// transmission across thread boundaries even if it is very complex and
/// contains `unserializable' constructs (like circular references). This is
/// used in our message passing operations to reliably send complex objects.

function windowReplacer(key, value) {
  if (value && value.window === value) {
    return '[WINDOW]';
  }
  return value;
}

/// Serialize a complex object into a function that can recreate the object.
export const serialize = value => {
  return stringify(value, windowReplacer, null, false);
};

/// Deserialize a function string and invoke the resulting object recreator.
export const deserialize = value => {
  return value === 'null' || value === null ? null : parse(value);
};

I found the same problem in other extension:
zalmoxisus/redux-devtools-extension#598
and here is fix:
zalmoxisus/redux-devtools-extension@adbda74

@yallen011
Copy link
Contributor

Hi @nindza90 if you have a proposed solution to this issue, can you please create a pull request and reference this issue in the pull request.

@feeloor
Copy link
Contributor

feeloor commented Dec 5, 2019

Hi @nindza90,

We just released a new version of Augury (1.24.0). Could you please try that version and see if that solves your issue. We have updated some of the serialize functionality in there.

Thanks.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants