jsoncrack.com icon indicating copy to clipboard operation
jsoncrack.com copied to clipboard

Added 'url' query parameter for loading JSON files

Open VladCuciureanu opened this issue 2 years ago • 10 comments

Solves #149

This adds a way to load JSON files via the 'url' query parameter

Example: /editor?url=http://ip.jsontest.com/

VladCuciureanu avatar Oct 05 '22 10:10 VladCuciureanu

Can we make it to work on Widget page too? Also can we use fetch API instead of XMLHttpReqeust for more general convention?

AykutSarac avatar Oct 05 '22 17:10 AykutSarac

Can we make it to work on Widget page too? Also can we use fetch API instead of XMLHttpReqeust for more general convention?

Done :)

VladCuciureanu avatar Oct 05 '22 18:10 VladCuciureanu

Can we add a loading state and display the <Loading /> component while fetching data? (considering the fetch failing case)

AykutSarac avatar Oct 06 '22 18:10 AykutSarac

Can we add a loading state and display the <Loading /> component while fetching data? (considering the fetch failing case)

Is something like this what you had in mind?

VladCuciureanu avatar Oct 07 '22 09:10 VladCuciureanu

Can we add a loading state and display the <Loading /> component while fetching data? (considering the fetch failing case)

Is something like this what you had in mind?

I couldn't view the link you sent but what I meant is similar to when you paste big json and it display's "Parsing JSON" screen. You can test it with https://www.reddit.com/r/all.json

AykutSarac avatar Oct 10 '22 19:10 AykutSarac

Should be good then.

VladCuciureanu avatar Oct 12 '22 08:10 VladCuciureanu

Solves #149

This adds a way to load JSON files via the 'url' query parameter

Example: /editor?url=http://ip.jsontest.com/

I create it in a PR #70 , but it is closed.

victorbrambati avatar Oct 14 '22 21:10 victorbrambati

@AykutSarac I'm ok with either impl so it's up to you

VladCuciureanu avatar Oct 15 '22 14:10 VladCuciureanu

@AykutSarac I'm ok with either impl so it's up to you

I'm not a fan of creating new states honestly, so I'd go for this one as it's more up to date. Have you added the loading state yet?

AykutSarac avatar Oct 15 '22 14:10 AykutSarac

@AykutSarac I'm ok with either impl so it's up to you

I'm not a fan of creating new states honestly, so I'd go for this one as it's more up to date. Have you added the loading state yet?

Yep. Ready for review/merge

VladCuciureanu avatar Oct 15 '22 15:10 VladCuciureanu

Thanks for working on it, however this implementation does not satisfy with project and breaks its mechanism at some point, I think it's mostly because it does not have a proper documentation. I'll handle this at a new PR, thanks for the contribution! 🙂

AykutSarac avatar Oct 30 '22 10:10 AykutSarac