Enhanced JavaScript module from this repository #433
Replies: 4 comments 2 replies
-
OpenCV is a mature C++ library which exposes bindings to JavaScript and has JavaScript tests (https://docs.opencv.org/3.4/d4/da1/tutorial_js_setup.html) which we could potentially draw references/examples from. They also appear to be using WebAssembly SIMD and threads. They allow automated testing variations of: i. Manually in browser |
Beta Was this translation helpful? Give feedback.
-
There appears to be a headless mechanism to test JavaScript via Firefox of which an example can be found in mozilla/firefox-translations#106. An incremental approach could be doing (1) manually in the browser and deploying to some health status Github page. This will prepare the test primitives and then we can look at the tests running headless. |
Beta Was this translation helpful? Give feedback.
-
@jelmervdl has successfully managed to run the WASM module via node.js in https://gist.github.com/jelmervdl/a4c8b6b92ad88a885e1cbd51c6ad4902. This opens up possibilities for headless testing. |
Beta Was this translation helpful? Give feedback.
-
I still like to make (3) the embedded version a la Google Translate SDK someday. It would also include (yet another copy of) a model index and a GUI… We could skip over the language detection bit and ask whoever embeds the script in their website to at least tell what language the website needs to be translated from. Presumably they know. And I don't know what to do about Safari. No support for SIMD… but also it does already have support for translating websites embedded. But so does Chrome. And Firefox, with the extension. So who exactly is (3) for? |
Beta Was this translation helpful? Give feedback.
-
The current JavaScript "example" for the test page is perhaps not the best provision from here. There are a few common functions that can be abstracted here, potentially tested headless and seen by multiple eyes. Therefore, a better solution is a JavaScript library or module, ideally with an API consistent with the C++ from which it is derived.
The following are ideas of a few downstream applications of a JavaScript library that can do translation and is batteries included:
alignment:true
andresponseOptions.HTML
correct here, but transfer to firefox-translations led to inconsistent config).There are parts of this library already existing in sources across a few repositories. At the moment the extra work and duplication is convenient for faster development cycles. But at some point in the future, we should look at consolidating commonly used functionalities here co-located with the bindings and continuously tested. The JavaScript module can be part of the releases from this repository.
This thread is meant to investigate and discuss ideas, weigh the pros and cons of the approach.
Beta Was this translation helpful? Give feedback.
All reactions