![PyPI Now Supports iOS and Android Wheels for Mobile Python Development](https://cdn.sanity.io/images/cgdhsj6q/production/96416c872705517a6a65ad9646ce3e7caef623a0-1024x1024.webp?w=400&fit=max&auto=format)
Security News
PyPI Now Supports iOS and Android Wheels for Mobile Python Development
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
bs-webworkers
Advanced tools
This repository contains bindings for the Web Workers API.
Read more about these here, but keep in mind these bindings have been improved since this article was written.
The main script creates a new Web Worker from the worker.re
script and posts a message to it. The Web Worker replies back to that message. The main thread listens to that and prints out the message it received from the Web Worker.
main.re
let worker = WebWorkers.create_webworker("worker.bs.js");
let msg = {"text": "Hello world"};
WebWorkers.postMessage(worker, msg);
let msgBackHandler = (e: WebWorkers.MessageEvent.t) => {
Js.log("I am the main thread and I have received a message back from the worker:");
Js.log(WebWorkers.MessageEvent.data(e))
};
WebWorkers.onMessage(worker, msgBackHandler);
worker.re
WebWorkers.setWorkerOnMessage(
WebWorkers.self,
(e: WebWorkers.MessageEvent.t) => {
Js.log("I am the Web Worker and I have received a message:");
Js.log(WebWorkers.MessageEvent.data(e));
WebWorkers.postMessageFromWorker("my result")
}
);
npm install --save bs-webworkers
bsconfig.json
:{
"bs-dependencies": [
"bs-webworkers"
]
}
Look in the example/
directory for an example of how to use the bindings.
npm install
npm run build
npm install
npm run test
npm install
npm run example
The full Web Workers API is still not yet implemented (e.g. Shared Workers, Service Worker, WorkerNavigator, WorkerLocation, etc.). PRs are welcome!
FAQs
Bucklescript bindings for Web Workers
We found that bs-webworkers demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.