Show HN → Parallel DOM: Upgrade your DOM to be multithreaded
Parallel DOM accelerates web apps by parallelizing heavy DOM tasks. It integrates easily, runs React components concurrently, and ensures security through sandboxed iframes. Users can self-host or deploy with Vercel.
Read original articleParallel DOM is a tool designed to speed up web applications by parallelizing heavy DOM operations. It offers a simple API for easy integration into existing code, ensuring secure execution within a sandboxed iframe wrapper. By dedicating a CPU process to JavaScript and DOM manipulation, Parallel DOM enables running React components in parallel. Users can self-host Parallel DOM or deploy it with Vercel, with detailed instructions provided for setup. The tool addresses concerns about security, explaining how it utilizes sandboxed iframes and in-browser script injection to protect against vulnerabilities. Unlike Web Workers, which lack access to the DOM, Parallel DOM focuses on optimizing DOM manipulation tasks. While the tool is available for use on the provided domain, users have the option to host it themselves, leveraging its open-source nature and documentation. Parallel DOM emphasizes its compatibility with various static hosting providers, making it a client-side solution without the need for a backend server.
Related
Understanding React Compiler
React's core architecture simplifies app development but can lead to performance issues. The React team introduced React Compiler to automate performance tuning by rewriting code using AST, memoization, and hook storage for optimization.
Understanding React Compiler
React's core architecture simplifies development but can lead to performance issues. The React team introduced the React Compiler to automate performance tuning by rewriting code. Transpilers like Babel convert JSX for efficiency. Compilers, transpilers, and optimizers analyze and produce equivalent code. React Compiler enhances functionality using Abstract Syntax Trees, memoization, and hook storage for optimized performance.
New Web Development: Or, why Copilots and chatbots are bad for modern web dev
The analysis critiques Copilots, chatbots, and React for web development, citing slow sites, complex code, and high costs. It advocates for a shift to browser APIs, CSS, and HTML for better performance and lower expenses. Transition challenges include finding developers skilled in vanilla JavaScript. Organizations are urged to prioritize simplicity, efficiency, and core web technology training.
Show HN: A JavaScript UI library for imperative JSX
The @matry/dom npm package introduces a web framework for imperative JSX, aiming to enhance UI engineering by offering a more imperative approach compared to React. It provides control over rendering and flexibility in UI design. Developers are cautioned against using it in production before version 1.0.0.
Execute JavaScript in a WebAssembly QuickJS Sandbox
QuickJS is a secure JavaScript execution tool in a WebAssembly sandbox. It includes security features, file system access, custom node modules, a fetch client, and a test runner. Find detailed documentation and examples in the repository. Users can seek further assistance for inquiries.
That’s a clever hack where it works. For what it’s worth, it doesn’t seem to work on mobile Safari, at least judging by both examples slowing down at roughly the same rate. In which case, the “parallel” example is very slightly slower, presumably due to marginal overhead of the cross-frame mechanism.
What kind of DOM computations are so intensive they need to be parallel?
Most intensive computations are done in JS, which is not related to the DOM and can be ran in Web Workers if you need parallel execution.
- small well contained math operation that could be put in a worker
- instead of putting that in a worker, startup a whole parallel page and shuttle messages via ipc for the heaviest part of the process, redoing a lot of the work twice
why are the solutions always backward?This should make self-hosting a bit easier. You can also find the GitHub repository for the (pretty simple) Dockerfile on GitHub[1].
[0] https://hub.docker.com/repository/docker/uninspiredstudioops...
[1] https://github.com/UninspiredStudio/parallel-dom-docker
Edit: Formatting
It looks like you have the ability to run an isolated portion of the dom on another thread and you can communicate with it with this library? Am I close?
I think more examples could help. Could you have 2-3 real time analytics viz/charts running in 2-3 different threads? Is this mostly for desktop or does mobile benefit also?
Feels like the web world is desperately in need of competent threading capabilities. Can I (practically) use Rust or Go in the browser via wasm already!?
Pdom seems to be a way to do that to yourself, if you can't trust that your content won't cause performance degradations and you absolutely want the context outside that content to stay responsive. I'd only use it, and really any frame, for components where the size is known ahead of time, though; asking a frame to resize itself to fit its contents, when its contents may themselves be resizing to the size of the frame, is a recipe for disaster. Which brings me around to why I try to avoid frames for anything user-facing when at all possible.
Related
Understanding React Compiler
React's core architecture simplifies app development but can lead to performance issues. The React team introduced React Compiler to automate performance tuning by rewriting code using AST, memoization, and hook storage for optimization.
Understanding React Compiler
React's core architecture simplifies development but can lead to performance issues. The React team introduced the React Compiler to automate performance tuning by rewriting code. Transpilers like Babel convert JSX for efficiency. Compilers, transpilers, and optimizers analyze and produce equivalent code. React Compiler enhances functionality using Abstract Syntax Trees, memoization, and hook storage for optimized performance.
New Web Development: Or, why Copilots and chatbots are bad for modern web dev
The analysis critiques Copilots, chatbots, and React for web development, citing slow sites, complex code, and high costs. It advocates for a shift to browser APIs, CSS, and HTML for better performance and lower expenses. Transition challenges include finding developers skilled in vanilla JavaScript. Organizations are urged to prioritize simplicity, efficiency, and core web technology training.
Show HN: A JavaScript UI library for imperative JSX
The @matry/dom npm package introduces a web framework for imperative JSX, aiming to enhance UI engineering by offering a more imperative approach compared to React. It provides control over rendering and flexibility in UI design. Developers are cautioned against using it in production before version 1.0.0.
Execute JavaScript in a WebAssembly QuickJS Sandbox
QuickJS is a secure JavaScript execution tool in a WebAssembly sandbox. It includes security features, file system access, custom node modules, a fetch client, and a test runner. Find detailed documentation and examples in the repository. Users can seek further assistance for inquiries.