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

Add native viewing support for jsonl/ndjson #14460

Merged
merged 1 commit into from
Jul 17, 2023
Merged

Add native viewing support for jsonl/ndjson #14460

merged 1 commit into from
Jul 17, 2023

Conversation

timkpaine
Copy link
Member

@timkpaine timkpaine commented Apr 28, 2023

References

jsonlines / ndjson have traction (some examples lazily collected from the web, shopify, duckdb).

Since the differences are very trivial wrt existing json support, it isn't really worth it to defer this functionality to e.g. a community extension.

Code changes

Register jsonl and ndjson file types, and corresponding mime types. NOTE: standardization is trailing utilization, so it is messier than one would prefer.
ndjson/ndjson-spec#35
wardi/jsonlines#22

Then tweak the JSON extension to convert jsonl to json when the mime type is that of jsonl.

User-facing changes

.jsonl and .ndjson files will now appear as json files and open in the default json opener.

tmp

Backwards-incompatible changes

None. May effect existing mime render extensions for jsonl and ndjson, if these exist.

@jupyterlab-probot
Copy link

Thanks for making a pull request to jupyterlab!
To try out this branch on binder, follow this link: Binder

@timkpaine timkpaine changed the title add native support for jsonl/ndjson as its just a minor modification to existing json functionality add native viewing support for jsonl/ndjson Apr 28, 2023
@fcollonval fcollonval added this to the 4.0.0 milestone May 2, 2023
@fcollonval
Copy link
Member

Thanks @timkpaine I targeted this to 4.0.0 to discuss on Wednesday weekly call to see if we accept this as late addition (we have release RC so no promise). Otherwise it will need to move on 4.1.0.

@@ -23,6 +23,12 @@ const CSS_CLASS = 'jp-RenderedJSON';
* The MIME type for JSON.
*/
export const MIME_TYPE = 'application/json';
// NOTE: not standardized yet
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we delay merging this PR until 4.1, is there a chance these would be standardized by then, or is it not worth waiting for it?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not worth waiting, i doubt this will be standardized soon

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, I am working on helping to standardize application/jsonl MIME_TYPE, but I have no experience in doing so, so I confirm it will take me a bit of time to write the RFC and submit it, so it's not worth waiting.

@fcollonval
Copy link
Member

The consensus at the dev meeting was too push this to 4.1.0

@fcollonval fcollonval modified the milestones: 4.0.0, 4.1.0 May 4, 2023
@jtpio jtpio mentioned this pull request May 30, 2023
14 tasks
@fcollonval
Copy link
Member

I'll rebase this PR on main as we branch out 4.0.x to be able to merge 4.1 feat in main.

Copy link
Member

@fcollonval fcollonval left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @timkpaine

@fcollonval fcollonval merged commit 4f71095 into jupyterlab:main Jul 17, 2023
77 of 79 checks passed
@krassowski krassowski changed the title add native viewing support for jsonl/ndjson Add native viewing support for jsonl/ndjson Dec 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants