Skip to content
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

Formatter fails on large file #234

Open
EnnFour opened this issue Jan 3, 2023 · 7 comments
Open

Formatter fails on large file #234

EnnFour opened this issue Jan 3, 2023 · 7 comments

Comments

@EnnFour
Copy link

EnnFour commented Jan 3, 2023

Looks like this fails when looking at the NBA schedule. It's ~120k lines, so maybe I've run into a size limitation? https://data.nba.com/data/10s/v2015/json/mobile_teams/nba/2016/league/00_full_schedule.json

@callumlocke
Copy link
Owner

Yes it currently has a hardcoded limit of 3,000,000 bytes (3 Mb). I added this years ago because I was worried about performance problems on huge JSON documents.

But I'm working on an update that will let you change this in the Options UI. (I might also increase the default limit, as computers are faster now.)

Until then, if you have an urgent need, you could edit it and install from source: just clone the repo, edit this line, and then follow the readme instructions to build & install from source.

@callumlocke
Copy link
Owner

btw it looks like that URL is just a little over the limit: 3360961 bytes (just checked with $('body>pre').textContent.length in devtools)

@CheckeredFlag
Copy link

I'd love to see this configurable too. I just hit a limit of 3.4MB.

@sglessard
Copy link

sglessard commented Sep 27, 2023

I've edited content.entry.ts to increase the rawLength condition. The built extension converts the json when > 3000000 bytes but for some reason it does not load the CSS. Tags/classes are present in source code but no style is displayed.

<style id="jfStyleEl">[object Object]

@media (prefers-color-scheme: dark) {
[object Object]
}</style>

@DarrenSem
Copy link

Yes it currently has a hardcoded limit of 3,000,000 bytes (3 Mb). I added this years ago because I was worried about performance problems on huge JSON documents.
...
Until then, if you have an urgent need, you could edit it and install from source: just clone the repo, edit this line, and then follow the readme instructions to build & install from source.

@callumlocke Thanks for this extension. I noticed that line 63 that you linked to above, it sets a few properties including note: but I can't see anywhere in the repo where that value is ever used (or the other 2 properties tbh).
It doesn't even console.log {note}, which I was expecting to find at the very least... instead it seems like it will silently fail, so the user will not see any popup warning explanation or any change to the extension icon etc. 😟

const resultPromise = (async (): Promise<{
  formatted: boolean
  note: string
  rawLength: number | null
}> => {
...
return {
      formatted: false,
      note: `Too long`,
      rawLength,
}

@arikanorh
Copy link

Are we going to have this feature anytime soon? I love this extension but my jsons are too big

@gavalierm
Copy link

+1

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

No branches or pull requests

7 participants