Create JS Context for PDF worker#1224
Conversation
67f8733 to
c63ba05
Compare
73ac616 to
0dcc951
Compare
0dcc951 to
fe041f8
Compare
|
@mvasilak great, thanks! I'll try it soon. I'll need to setup Xcode… |
fe041f8 to
47f29ee
Compare
|
I now have an Xcode environment set up and can build the app, but I’m not sure what exactly I should be testing. Is this already expected to work, or does it currently just load the worker.js code via the shim? What I really need is a test in the pdf-worker repo that runs the worker in a JSContext environment. I briefly tried to vibe code some Swift code that loads the shim and executes worker.js. At first glance, it evaluates without errors, although I haven’t yet tried loading an actual PDF file. |
|
@mrtcode it is expected to work. In app you can test it with retrieve metadata, or if you enable the speech feature, which (for the time being) uses the PDF worker to extract text to read. Furthermore, there are tests that do test PDF worker metadata and text extraction. If you have more tests of your own, you could vibe convert them to the iOS test harness. All in all, just taking a look at the JS shim file and commenting on that if needed, should suffice, as this is the vibe coded layer that glues the PDF worker to the JSContext environment. |
Great job then! So there are many changes coming to pdf-worker (document-worker), such as model inference, and I’ll set up JSContext tests in its repo to make sure everything continues to work. |
47f29ee to
c873471
Compare
|
@michalrentka ready for another quick look, updated to properly use the latest pdf-worker, with some extra tests. |
Update PDF worker shim
fdc5d80 to
abcc9b2
Compare
|
Note that I also added JSContext tests to the new pdf-worker (which will be renamed to document-worker) https://github.com/zotero/pdf-worker/tree/document-worker/test/jscontext |
Creates a JS Context to load the PDF worker in, that will run solely in a background queue.