-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Complex objects unexpectedly represented as strings #468
Comments
Sorry about the late reply, going now through the backlog. This should be implemented on monitors part, either log monitor or inspector. Or we can handle that in |
Thanks @zalmoxisus, I'll take a look this week. If it's OK with you I'll send a PR and we can discuss. Feel free to assign this issue to me :) |
Hey @zalmoxisus, I'm looking at this now. I've noticed that the tests seem to be failing for at least two of the devtools repos. I've just done an Here is the output for
And here is the output for
It looks to me like the assertion might be set up incorrectly. Currently the expectation is |
Do we have a contributor guide somewhere that outlines architecture and testing practices? The only docs I could find were instructions on how to use the devtools. |
Hey @rufusraghunath thanks for working on that. Looks like A contributor guide is a good idea, I'll work on that after moving everything into a monorepo to make it easier for new contributors, now we have everything split into more than 20 repos. Regarding this issue, you'd want to check it in Inside the extension we're using jsan.parse(jsan.stringify(new Date(), null, null, true)) |
Great, I definitely think there'd be some value to a guide... I've been
spending quite a lot of time just reading through the different repos
trying to understand how they are connected and what the responsibility of
each is. That could be made easier with some architectural notes.
Thanks for the pointers. I'm going to try to reproduce the issue and then
trace where it comes from.
I've worked on a Lerna migration before, so let me know if you'd like some
help with the monorepo effort. It definitely involves some complexity, and
an extra pair of eyes never hurts :)
…On Thu, Nov 29, 2018, 06:13 Mihail Diordiev ***@***.*** wrote:
Hey @rufusraghunath <https://github.com/rufusraghunath> thanks for
working on that. Looks like jss inside redux-devtools-instrument changed
the way styles are represented. That shouldn't affect anything except
tests. You can use yarn instead of npm install which locks subdependeces.
We could add that in README, it was written before yarn appeared. Or
could fix that test and update.
A contributor guide is a good idea, I'll work on that after moving
everything into a monorepo
<reduxjs/redux-devtools#412> to make it easier
for new contributors, now we have everything split into more than 20 repos.
Regarding this issue, you'd want to check it in javascript-stringify
<https://github.com/blakeembrey/javascript-stringify> and in
react-json-tree <https://github.com/alexkuz/react-json-tree>.
Inside the extension we're using jsan for serialization, and it supports
Date (not converting into string), I've checked:
jsan.parse(jsan.stringify(new Date(), null, null, true))
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#468 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AOkarMUcPBdDUQOBYP5xcAAlJ4jI4brpks5uz8FegaJpZM4Sfzpp>
.
|
That would be great if you can help. If you have time to work on this, a pr on redux-devtools would be welcome or I'll start that these days and we can continue the discussion there. It will be slow gradual process to migrate all the repositories, but can start with |
Ok cool, so you want to create a new repo for the monorepo, rather than
adding Lerna to an existing repo? How will we be able to keep the
contribution history? Does Github provide some way to do that?
Go ahead and do the first one, and I'll see if I can pick up some other
repos after that. Maybe tag me in your PR for redux-devtools when you make
it so I can get some context? We can discuss more there.
…On Thu, Nov 29, 2018, 13:45 Mihail Diordiev ***@***.*** wrote:
That would be great if you can help. If you have time to work on this, a
pr on redux-devtools <https://github.com/reduxjs/redux-devtools> would be
welcome or I'll start that these days and we can continue the discussion
there. It will be slow gradual process to migrate all the repositories, but
can start with redux-devtools there. After that I'll make PRs for every
repository to keep all the contribution history in the new one. For the
extension we'll keep the current repository as a legacy for 2.x version,
while creating 3.x in the monorepo.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#468 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AOkarITD_l1BDrBvjqE-6FP6zUdL5bCBks5u0CsxgaJpZM4Sfzpp>
.
|
No new repo, the idea is to transform About the history for other repos we want to move, there's no much work there, I'll just create a new branch or fork, move everything into a new I'll change the structure and try that, then will ping you in that PR if want to help with lerna config. |
I fixed a regression in jsan which was causing this issue, and now Dates are handled well for state/action tree and raw view: It works in latest version on Chrome Store.
About monorepo, I wasn't right, that idea would work if either If you'll find time to look into setting lerna and do a PR against |
OK, great, that's really helpful. In that case, I think we'll be able to close this issue oncethe two follow-up items are done? About monorepo - I'm happy to put in some work over the next month, but I'll need some more information.
I also have some basic questions around contributing to this project:
I think we would really benefit from a contributor guidelines document 👍 |
I made a minimal implementation just few hours ago. I didn't rely on lerna much, using just yarn workspaces and made a node script to run linting and tests inside packages. Probably would be great to have the same rules and dev dependences among packages, but let's keep it after moving them all. Still unsure about publishing and how to proceed with release tags,
I'll publish a PR now, so we can continue discussing there. For now we just need a minimal configuration, so I can move packages slowly there.
We can improve this later, I'll just move repos gradually. If you'll have time PRs on improving that would be much appreciated.
Agree, we have 2 packages there, which is the one which repo we are using and I also moved instrumentation, which is the main part of redux devtools (it was actually moved from there few years ago).
The plan is to have most of functionality decoupled in other packages and have unit tests and snapshots for React components there. While for chrome/firefox extension having mostly e2e tests. Currently devpanel loads the same script as for extension window, so we are just testing that page with selenium. Just if all monitors rendered and if we can get the data from the client part, for which we are using a In next version devpanel page will inject the script directly (in order to be used not only for a browser tab), so it needs to stay in Chrome devpanel. I'm exploring Most of the code is pretty old, I removed gulp and made a lot of things easier in Not sure if moving all the tests in the root part of monorepo instead of having tests inside for every package is better.
The most sensitive part is instrumentation, because it wraps all Redux part even if the extension is not in use (not opened extension devpanel or window), so it can break users apps, since many sites are leaving As for the extension part, it has a lot of experimental features, which are not even documented. More tests weren't added since the beginning, so the situation is not quite plausible here. The goal is to move most of injected part outside with good coverage there, while react components should be covered in monitors packages and
All repositories are using Travis. For the extension (this repository) we're also using Appveyor for e2e tests on Windows.
Yes, we need such document. I'll work on it. UPDATE: Let's move it to reduxjs/redux-devtools#416 |
OK great, I'll head over to |
Hi @zalmoxisus, thanks for this fantastic extension! I've been using the redux-devtools-extension for around 1.5 years and found it really useful.
One thing that has always bothered me is that complex objects appear to be represented as strings. For example, when storing a
Date
in the state, the devtools show you itstoString()
rather than the object itself. This can make it hard to know whether you've persisted the correct type of data into the store, which has helped create a few bugs for me in the past. I'd much rather be shown a plain object (even though that would be more messy) and only see a string when the data in the store is actually a string.If there isn't already an established solution to this, would you be open to me submitting a PR?
Thanks for your help!
The text was updated successfully, but these errors were encountered: