ts-toolkit icon indicating copy to clipboard operation
ts-toolkit copied to clipboard

Questions on Production Readiness and EPUB Handling

Open SamiKamal opened this issue 8 months ago • 4 comments

Hey there, amazing work on this project! I just had a couple of quick questions:

  1. Is this project ready for production use?
  2. Do I need to use the Readium Web Publication Manifest, or can I render a .epub file directly without implementing the full manifest?

Thanks in advance!

SamiKamal avatar Jun 12 '25 19:06 SamiKamal

Hello. Thanks for the kind words.

Is this project ready for production use?

the project has been used in production by companies for quite a while, and we are using it in Thorium Web ourselves.

Some caveats:

  • it does not support RTL nor vertical-writing yet
  • fixed-layout support has to be improved as well

Do I need to use the Readium Web Publication Manifest, or can I render a .epub file directly without implementing the full manifest?

Yes, you need a manifest and a positions list at the moment. It was developed alongside the Go-toolkit and designed with this assumption both are provided.

We are aware there are requests for direct EPUB support and may provide something in a distant future but that would probably be handled through Thorium Web development.

JayPanoz avatar Jun 13 '25 08:06 JayPanoz

Thanks for replying!

I don't mind implementing the manifest, but how easy would it be to integrate it with my Node.js server? I don't want to use the go-toolkit, as that would add unnecessary complexity to my project.

Context around my project

It’s an iOS book reading app (for now), but I plan to extend it to Android, Web, and Desktop. So I’d rather not go with Readium Mobile .. I want something that lets me reuse the codebase. Ideally, I'm looking for a minimal starting point that’s easy to evolve over time.

SamiKamal avatar Jun 13 '25 22:06 SamiKamal

So as long as you’re serving the manifest, the positions list, and the resources of the EPUB files from your server, Navigator does not care what is serving these files.

Types in Shared models can be used for parsing if you are using TypeScript, serialise and deserialise as well for fetching and syncing.

In Thorium Web, we use Navigator through a React custom hook for example so your app will typically have a component fetching the manifest to create a Publication. But that’s mostly all it cares about. The rest is entirely up to you.

JayPanoz avatar Jun 14 '25 15:06 JayPanoz

@SamiKamal Some advice since you'd like to use Node.JS and not the go-toolkit: Generating the positions list is pretty easy for you to implement in any language, it's just a matter of knowing the size (bytes) of files in the e-book and performing some simple math. The Go implementation is here: https://github.com/readium/go-toolkit/blob/develop/pkg/parser/epub/positions_service.go If the book is fixed-layout (or comics) then it's even easier, as one position = one page. The reason why it's not simple for us to do away with on the ts-toolkit is because we would have to know the size of every file in the e-book on a remote server. This data is not part of what's currently included in a webpub manifest, so we would need to make a request to the server for every resource otherwise which would be very slow and inefficient. The manifest itself is very simple to generate from an EPUB, and there are implementations such as this one that already implement this.

chocolatkey avatar Jun 14 '25 23:06 chocolatkey