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

Explore alternatives to JSON.parse #143

Closed
WULCAN opened this issue Dec 7, 2024 · 2 comments
Closed

Explore alternatives to JSON.parse #143

WULCAN opened this issue Dec 7, 2024 · 2 comments
Assignees
Labels
🦐 small webapp Related to the Lyra web app

Comments

@WULCAN
Copy link
Collaborator

WULCAN commented Dec 7, 2024

Description

Store#loadFromDisk uses JSON.parse to reload unpublished translations from disk after restart. JSON.parse is a blocking API so this might block the main thread for a long time.

Explore if we can replace this blocking API.

Estimated size (S, M, L)

I think this issue is Small because only the research is in scope. We will spawn a new issue for any implementation.

Open questions

This could potentially never get prioritized, as it only affects one request after restart.

@WULCAN WULCAN added webapp Related to the Lyra web app 🦐 small labels Dec 7, 2024
@WULCAN WULCAN mentioned this issue Dec 7, 2024
@xela1601 xela1601 self-assigned this Feb 1, 2025
@xela1601
Copy link
Collaborator

xela1601 commented Feb 1, 2025

To avoid blocking the main thread with JSON.parse, we can use a streaming JSON parser like stream-json.
This allows us to process the JSON data in chunks, which can help prevent blocking the main thread.

@xela1601
Copy link
Collaborator

xela1601 commented Feb 1, 2025

created #155 to implement this :)

@xela1601 xela1601 closed this as completed Feb 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🦐 small webapp Related to the Lyra web app
Projects
None yet
Development

No branches or pull requests

2 participants