var_dump icon indicating copy to clipboard operation
var_dump copied to clipboard

Json dump

Open PurpleBabar opened this issue 7 years ago • 8 comments

Hi :)

Would you be interested in someone implementing json dumps handling ? :)

cheerz :)

PurpleBabar avatar May 05 '17 08:05 PurpleBabar

Hey PurpleBarbar!

This chrome extension was actually inspired by https://chrome.google.com/webstore/detail/jsonview/chklaanhfefbnpoihckbnefhakgolnmc which does JSON parsing.

I think they do a pretty good job, do you think we will be able to do it better?

PhilipReasa avatar May 05 '17 15:05 PhilipReasa

Hey :)

Not sure, about better, but i'd be pretty happy, to have all dumps in one extension rather than have two extensions for the same job :/

what's your opinion on that ?

cheerz

PurpleBabar avatar May 09 '17 08:05 PurpleBabar

I agree it would be nice to have both in one place. If we can keep the abstraction really clean so that maintaining it is easy I would love to have this!

PhilipReasa avatar May 12 '17 14:05 PhilipReasa

Ok i'll see if it's possible to do that :P

PurpleBabar avatar May 12 '17 15:05 PurpleBabar

I'll see if I can find some time to prepare the code for this abstraction as well. Things are a little messy at the moment :)

On Fri, May 12, 2017 at 8:42 AM PurpleBabar [email protected] wrote:

Ok i'll see if it's possible to do that :P

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/Rece/var_dump/issues/27#issuecomment-301112076, or mute the thread https://github.com/notifications/unsubscribe-auth/ABnOtOed5knLu8tpvNG5wT1exfVyqvHxks5r5H3ngaJpZM4NRpuf .

PhilipReasa avatar May 12 '17 23:05 PhilipReasa

I took a look at the extension code last night, and it seems rather complex to me for the moment :p i will give it another shot today, to see if it's possible to keep the abstraction as it is :)

I imagined an another pattern for the construction:

Detect what is dumped then instantiate a type of parser with an interface guaranting some basic functionnalities and then render the parsed result... what would you think of that ?

Tha abstraction would be base on a parser and we could even dump more and more things just by adding a parser no ?

Cheerz :)

PurpleBabar avatar May 13 '17 06:05 PurpleBabar

Sorry for the slow replies - life is super busy right now.

I like the approach you are thinking about. If we can abstract the "initiation" phase we can make this super flexible.

Currently the "parsing" happens via a PEGJS (https://pegjs.org/) grammar. I really like how well this has been working, so I suggest all other things (i.e. JSON dumps) also use a formal grammar like this.

PhilipReasa avatar May 15 '17 05:05 PhilipReasa

Ok :) i'll try to propose a pull request with these tools in mind :)

PurpleBabar avatar May 15 '17 11:05 PurpleBabar