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

0.26 Beta: Add json5 to defaults in option declaration for highlightLanguages . #2593

Closed
typhonrt opened this issue Jun 15, 2024 · 3 comments
Milestone

Comments

@typhonrt
Copy link

typhonrt commented Jun 15, 2024

json5 was previously supported or enabled by default in TypeDoc 0.25.x.

With the TypeDoc 0.26 beta the new highlightLanguages option default does not include json5. I'd say a good candidate to add to the default as it is widely used and makes it easy to add comments to example JSON blocks.

I have tested that simply adding "json5" to the highlightLanguages provides default support.

Info on JSON5. The NPM package has 70+MM weekly downloads, so is popular. This is compared to jsonc which is included in the default which has ~80k weekly downloads

@typhonrt typhonrt added the bug Functionality does not match expectation label Jun 15, 2024
@typhonrt typhonrt changed the title Add json5 to defaults in option declaration for highlightLanguages . 0.26 Beta: Add json5 to defaults in option declaration for highlightLanguages . Jun 15, 2024
@Gerrit0
Copy link
Collaborator

Gerrit0 commented Jun 16, 2024

It's absurd to me that json5 gets that many downloads... that parser has awful non-linear performance!

I consider TypeScript to be the canonical jsonc parser, with 51 million weekly downloads, but jsonc-parser used by VSCode has a nice 17 million as well.

That said, it seems reasonable to load the json5 grammar by default, it's only an extra 3.87kb and one extra file, for something that's widely used.

@Gerrit0 Gerrit0 added enhancement Improved functionality and removed bug Functionality does not match expectation labels Jun 16, 2024
Gerrit0 added a commit that referenced this issue Jun 16, 2024
@typhonrt
Copy link
Author

That makes more sense re jsonc-parser as the main NPM package. And I agree JSON5 is not the best per se. I had several repos using it in markdown comment blocks though just to add comments in the blocks for documentation. Easy enough not to trip folks up upgrading TypeDoc.

@Gerrit0 Gerrit0 mentioned this issue Jun 16, 2024
7 tasks
@Gerrit0 Gerrit0 added this to the v0.26.0 milestone Jun 16, 2024
@Gerrit0
Copy link
Collaborator

Gerrit0 commented Jun 16, 2024

Added in v0.26.0-beta.4

@Gerrit0 Gerrit0 closed this as completed Jun 16, 2024
@Gerrit0 Gerrit0 removed the enhancement Improved functionality label Feb 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants