Skip to content

Exporter: migrate to rapidjson#13204

Merged
pazos merged 1 commit into
koreader:masterfrom
pazos:exporter_json
Feb 11, 2025
Merged

Exporter: migrate to rapidjson#13204
pazos merged 1 commit into
koreader:masterfrom
pazos:exporter_json

Conversation

@pazos

@pazos pazos commented Feb 3, 2025

Copy link
Copy Markdown
Member

Untested

Fixes #12911
Fixes #12820
Fixes #12213
Fixes #9406


This change is Reviewable

@Frenzie Frenzie added the Plugin label Feb 3, 2025
@Frenzie Frenzie added this to the 2025.02 milestone Feb 3, 2025
@pazos

pazos commented Feb 4, 2025

Copy link
Copy Markdown
Member Author

I won't be able to test this myself as I never got an error with the highlights I manage on the emulator.

I got a confirmation that it no longer crashes w/ rapidjson in #12911 (comment)

While I'm not a fan of merging unsupported changes I doubt there's any better alternative here. At best everything works. If I introduced a bug on some target we can fix that later.

@Frenzie

Frenzie commented Feb 4, 2025

Copy link
Copy Markdown
Member

Alright, let's merge it so it can be tested a bit more then?

@pazos pazos merged commit eea6c54 into koreader:master Feb 11, 2025
@Frenzie

Frenzie commented Feb 11, 2025

Copy link
Copy Markdown
Member

Btw, should the other users also migrate combined with dropping the other JSON or is the situation fine as is? I find it a tad confusing but I haven't followed all of the JSON adventures in detail.

frontend/apps/cloudstorage/dropboxapi.lua
2:local JSON = require("json")

frontend/apps/reader/modules/readerdictionary.lua
11:local JSON = require("json")

plugins/wallabag.koplugin/main.lua
24:local JSON = require("json")

plugins/httpinspector.koplugin/main.lua
393:    local JSON = require("json")

frontend/ui/wikipedia.lua
1:local JSON = require("json")

frontend/ui/translator.lua
16:local JSON = require("json")

@pazos

pazos commented Feb 11, 2025

Copy link
Copy Markdown
Member Author

Btw, should the other users also migrate combined with dropping the other JSON or is the situation fine as is?

I think it is fine as long as it doesn't crash :D

iirc rapidjson might require some encoding for outliers (ie: rapidjson.null) while the json module handles that on its own.

On the particular case of the exporters it seems to fail encoding tables with many arbitrary strings that we don't control (user highlights). But again, I never being able to reproduce the issue.

@Frenzie

Frenzie commented Feb 11, 2025

Copy link
Copy Markdown
Member

Alright. 👍

0xstillb pushed a commit to 0xstillb/koreader-thai that referenced this pull request May 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

2 participants