Git Product home page Git Product logo

triggerdotdev / jsonhero-web Goto Github PK

View Code? Open in Web Editor NEW
9.0K 47.0 483.0 57.51 MB

JSON Hero is an open-source, beautiful JSON explorer for the web that lets you browse, search and navigate your JSON files at speed. ๐Ÿš€. Built with ๐Ÿ’œ by the Trigger.dev team.

Home Page: https://jsonhero.io

License: Apache License 2.0

TypeScript 94.66% JavaScript 0.46% CSS 0.20% Dockerfile 0.04% MDX 4.64%
json developer-tools tools viewer devtools json-viewer react typescript hacktoberfest

jsonhero-web's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jsonhero-web's Issues

Edit option in JsonHero

I have installed the extension 'jsonhero.io tools for VS Code'. It opens the .json file in the browser but it does not have an edit option. Could you please let me know where do I get the edit option when the file opens in the browser. Thanks.

Support passing endpoint as URL param

To share JSON Hero with dynamic endpoint (e.g. IDs on an REST API documentation) would be necessary to pass endpoint through URL with something like https://jsonhero.io/new?url=https://someapi.io/v1/id, right?
It's already possible? If not, wdyt about this feature?

Crashes a few seconds after loading in browser

How to replicate:

  • Clone repo and npm install
  • npm start
  • Browse to http://localhost:8787
  • Wait for about 5 seconds

This error appears in the browser:

Error: Unexpected Server Error
    at handleDataRequest (/Users/scott/Tools/jsonhero-web/node_modules/@remix-run/server-runtime/esm/server.js:163:31)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at requestHandler (/Users/scott/Tools/jsonhero-web/node_modules/@remix-run/server-runtime/esm/server.js:41:20)
    at handleEvent (/Users/scott/Tools/jsonhero-web/node_modules/@remix-run/cloudflare-workers/esm/worker.js:98:18)
    at EventTarget.[kDispatchFetch] (/Users/scott/Tools/jsonhero-web/node_modules/@miniflare/core/src/standards/event.ts:359:13)
    at Server.<anonymous> (/Users/scott/Tools/jsonhero-web/node_modules/@miniflare/http-server/src/index.ts:168:20)

In the console:

[1] GET /build/routes/actions/getPreview.$url-JE4JRBGI.js 200 OK (6.18ms)
[1] ReferenceError: PEEKALINK_API_KEY is not defined
[1]     at getPeekalink (/Users/scott/Tools/jsonhero-web/app/services/uriPreview.server.ts:17:3)
[1]     at getUriPreview (/Users/scott/Tools/jsonhero-web/app/services/uriPreview.server.ts:71:33)
[1]     at processTicksAndRejections (node:internal/process/task_queues:96:5)
[1]     at loader2 (/Users/scott/Tools/jsonhero-web/build/route:/Users/scott/Tools/jsonhero-web/app/routes/actions/getPreview.$url.ts:10:18)
[1]     at callRouteLoader (/Users/scott/Tools/jsonhero-web/node_modules/@remix-run/server-runtime/esm/data.js:69:14)
[1]     at handleDataRequest (/Users/scott/Tools/jsonhero-web/node_modules/@remix-run/server-runtime/esm/server.js:125:18)
[1]     at requestHandler (/Users/scott/Tools/jsonhero-web/node_modules/@remix-run/server-runtime/esm/server.js:41:20)
[1]     at handleEvent (/Users/scott/Tools/jsonhero-web/node_modules/@remix-run/cloudflare-workers/esm/worker.js:98:18)
[1]     at EventTarget.[kDispatchFetch] (/Users/scott/Tools/jsonhero-web/node_modules/@miniflare/core/src/standards/event.ts:359:13)
[1]     at Server.<anonymous> (/Users/scott/Tools/jsonhero-web/node_modules/@miniflare/http-server/src/index.ts:168:20)
[1] GET /actions/getPreview/https%3A%2F%2Fwww.theonion.com%2F?_data=routes%2Factions%2FgetPreview.%24url 500 Internal Server Error (557.21ms)

(Why is it trying to load a page on theonion.com?)

My environment:
macOS 12.3.1, MacBook Air (M1, 2020)
Node v16.13.2
Firefox 100.0b9

JSON hero does not allow you to open large JSON files

Currently, as of 4/29/22, if you attempt to open a large JSON file (around 22MB), the site does not allow you to open it. It simply acts as if you selected no file!

Usecase : Using JSON hero to browse log files & other automatically generated datastructures.

vscode plugin?

HI! really love the jsonhero seems awesome. but what I really dream of is having it inside VScode.
is this possible?

No message if JSON is malformed

I used https://jsonhero.io to take a look at a dirty JSON, and it seems that the JSON contained a malformed field.
Until I cleaned that field I wasn't able to put it in the input to get it read.
However, no matter how many times I tried, it didn't said anything related to an error in the page, as if it wasn't working.

It happened to me in both Safari and Chrome.

A similar behaviour happens in #42 that no answer is given.

Reviewed the issues in the repo and found nothing (besides the other issue referenced) related to this.

Thank you :)

Bug: crash when url isn't JSON (e.g. is HTML login page)

When I open jsonhero with the following json

{"url":"http://www.google.com/calendar/event?action=TEMPLATE&dates=20220707T103000Z%2F20220707T120000Z&text=bug&location=Nh%C3%A0%20h%C3%A0ng%20Tr%E1%BA%A7u%20Cau%202%2C%20%C4%90%C6%B0%E1%BB%9Dng%20L%C3%AA%20L%E1%BB%A3i%2C%20H%E1%BA%A3i%20C%E1%BA%A3ng%2C%20Th%C3%A0nh%20ph%E1%BB%91%20Qui%20Nh%C6%A1n%2C%20B%C3%ACnh%20%C4%90%E1%BB%8Bnh%2C%20Vi%E1%BB%87t%20Nam"}

I got this error
image

Bug: Crash when change to dark mode / dark theme

Envirorment:

Hardware

Apple MacBook Pro with M1 Pro chip.

Software

MacOS 12.4

npm test

> test
> jest

 PASS  tests/formatStarCount.test.ts
 PASS  tests/search.test.ts
 PASS  tests/stableJson.test.ts
 PASS  tests/relatedValues.test.ts
  โ— Console

    console.log
      [
        { value: '1609937654', paths: [ '$.data.0.modifiedAt' ] },
        { value: 'null', paths: [ '$.data.1.modifiedAt' ] },
        { value: 'undefined', paths: [ '$.data.2.modifiedAt' ] }
      ]

      at Object.<anonymous> (tests/relatedValues.test.ts:174:13)

 PASS  tests/jsonColumnView.test.ts

Test Suites: 5 passed, 5 total
Tests:       14 passed, 14 total
Snapshots:   11 passed, 11 total
Time:        2.858 s
Ran all test suites.

npm --version

8.11.0

node -v

v18.3.0

Description

When I deployed this project on my own computer and try to switch from the light theme to the dark theme, then there will an error returned.

image

And here is the error log.

[1] TypeError: Value of "this" must be of type SubtleCrypto
[1]     at new NodeError (node:internal/errors:377:5)
[1]     at Proxy.importKey (node:internal/crypto/webcrypto:517:30)
[1]     at sign22 (/Users/user/Documents/gits/github/jsonhero-web/node_modules/@remix-run/cloudflare-workers/esm/cookieSigning.js:13:33)
[1]     at encodeCookieValue (/Users/user/Documents/gits/github/jsonhero-web/node_modules/@remix-run/server-runtime/esm/cookies.js:71:21)
[1]     at Object.serialize (/Users/user/Documents/gits/github/jsonhero-web/node_modules/@remix-run/server-runtime/esm/cookies.js:50:56)
[1]     at Object.commitSession (/Users/user/Documents/gits/github/jsonhero-web/node_modules/@remix-run/server-runtime/esm/sessions/cookieStorage.js:36:21)
[1]     at Object.commit (/Users/user/Documents/gits/github/jsonhero-web/app/theme.server.ts:30:32)
[1]     at action5 (/Users/user/Documents/gits/github/jsonhero-web/build/route:/Users/user/Documents/gits/github/jsonhero-web/app/routes/actions/setTheme.ts:31:51)
[1]     at processTicksAndRejections (node:internal/process/task_queues:95:5)
[1]     at callRouteAction (/Users/user/Documents/gits/github/jsonhero-web/node_modules/@remix-run/server-runtime/esm/data.js:32:14) {
[1]   code: 'ERR_INVALID_THIS'
[1] }
[1] POST /actions/setTheme?_data=routes%2Factions%2FsetTheme 500 Internal Server Error (598.38ms, waitUntil: 598.39ms)

Add a button to copy the path of a json field

At the top there is the breadcrumb shown anyways so adding a copy functionality sounds quite easy. I started to use JSON Hero at the start of this week and it is an awesome tool for huge JSON files with a lot of structure while developing. Second time I really need to get a path fairly deep nested and type it by hand.

e.g.: {
"someField": "a",
"someObj"": {
"someArray": [7,8,9]
}
}

When I now navigate to the 2nd element of the "someArray" it would be nice to copy that path for example like: "someObj.someArray[2]"

I would be open to implement it myself and contribute. if i find time this week. Thx for the great work and being OSS.

Add ability to make documents read-only

Currently whoever has access to a jsonhero.io url can edit the title. We should support adding a readonly=true flag to the /new endpoint to make it so the title cannot be editable. This would allow sharing of jsonhero.io urls publicly more safe as the title would not be able to be edited maliciously.

Progressive Web App integration

It would be nice if this site could be contained as a PWA so that it can have its own window. I have an iPad and I recently discovered how pwa's are supported full screen if you add a safari site to the Home Screen

Bug: Previewing an image URL that has no extension, and does not allow HEAD requests, results in a missing preview

For example, this URL does not currently have a preview:

https://picsum.photos/64/64?random:

Broken Preview

The getUriPreview function tries to do a HEAD request on this URL to determine if it's content is an image, but that results in a 405 Method Not Allowed response.

If you do request this URL with a GET request you get a 302 Found response with a location of https://i.picsum.photos/id/29/64/64.jpg?hmac=XAo2bhXlNLP-fdYM8H7kGqAWkIi0E8hywUNIYyZrokc.

Doing a HEAD request on that URL results in a 200 OK with a Content-Type of image/jpeg

[Chore] Investigate developing with node.js 18

It looks like this error reported to us could be caused by node.js 18:

[1] [mf:wrn] Cache operations will have no impact if you deploy to a workers.dev subdomain!
[1] TypeError: Value of "this" must be of type Crypto
[1]     at new NodeError (node:internal/errors:372:5)
[1]     at getRandomValues (node:internal/crypto/webcrypto:732:11)
[1]     at Proxy.<anonymous> (/Users/.../Desktop/JS/jsonhero-web/node_modules/@miniflare/core/src/standards/helpers.ts:35:16)
[1]     at /Users/.../Desktop/JS/jsonhero-web/app/jsonDoc.server.ts:115:14
[1]     at /Users/.../Desktop/JS/jsonhero-web/node_modules/nanoid/index.js:26:19
[1]     at createId (/Users/.../Desktop/JS/jsonhero-web/app/jsonDoc.server.ts:119:10)
[1]     at createFromRawJson (/Users/.../Desktop/JS/jsonhero-web/app/jsonDoc.server.ts:67:17)
[1]     at createFromUrlOrRawJson (/Users/.../Desktop/JS/jsonhero-web/app/jsonDoc.server.ts:36:12)
[1]     at action2 (/Users/.../Desktop/JS/jsonhero-web/build/route:/Users/.../Desktop/JS/jsonhero-web/app/routes/actions/createFromUrl.ts:26:21)
[1]     at processTicksAndRejections (node:internal/process/task_queues:95:5) {
[1]   code: 'ERR_INVALID_THIS'
[1] }
[1] POST /actions/createFromUrl?_data=routes%2Factions%2FcreateFromUrl 500 Internal Server Error (1157.81ms)

The Search shortcut doesn't work on Microsoft Edge

Solution

  • Stop Edge from bringing up the search. This is what other products like Slack do.

event.preventDefault() is already there so it might be that we need to use key down instead of key up. Requires investigation

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.