
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
react-worker-dom
Advanced tools
A React Custom renderer using Web Workers. All the Virtual DOM reconcilliations happen in a WebWorker thread. Only node updates are sent over to the UI thread, result in a much more responsive UI.
An existing React application can leverage WebWorkers using this library with minimal change. Look at the usage section for details.
This is the React 15.x experimental version, see master branch if you're running React 0.14.
The demo is hosted at http://web-perf.github.io/react-worker-dom/. To run a local version of the demo,
npm install
to install all dependencies.npm run demo
http://localhost:8080/test/dbmonster/
to view the demo app, or http://localhost:8080/test/todo
for the todo app.npm install --save react-worker-dom
A typical React application would looks something like the following.
// File: main.jsx
import React from 'react';
import reactDOM from 'react-dom';
reactDOM.render(<Component/>, document.getElementById('container'));
To use this renderer, we would need to split the above file into 2 parts, one that is on the page, and another that starts as a web worker.
// File: main.js - included using a script tag in index.html
import React from 'react';
import ReactDOM from 'react-worker-dom/page'; // Instead of using react-dom
ReactDOM.render(new Worker('worker.js'), document.getElementById('container'));
The worker.js
file is the one that now holds the actual Component.
// File: worker.jsx - loaded in index.html using new Worker('worker.jsx') in the file script above;
import React from 'react';
import ReactWorkerDOM from 'react-worker-dom/worker';
ReactWorkerDOM.render(<Component/>);
Look at test\dbmonster
and test\todoapp
directory for the examples.
To manually look at frame rates, load the dbmonster demo pages in Chrome, and view the frame meter in devtools.
To automatically collect frame rates and compare it with the normal version
npm run demo
to start the server and host the web pagesnpm run perf chrome worker
to test frame rates for various rows in chrome in a Web Worker. Instead of chrome
, you could use android
, and instead of worker
, you could use normal
to test the other combinations._dbmonster.json
file, for each row count.Here are the things that need to be done next.
FAQs
ReactJS renderer using Web Workers
The npm package react-worker-dom receives a total of 8 weekly downloads. As such, react-worker-dom popularity was classified as not popular.
We found that react-worker-dom demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.