Tech Watch RSS Feed
All the articles I've selected.
Swapy
Published: at 08:57 AMSwapy is a framework-agnostic tool that enables drag-and-swap functionality in web layouts with minimal code. It allows developers to easily convert any layout into a drag-and-drop interface by specifying slots and items using simple HTML attributes. Swapy supports various frameworks like React, Vue, and Svelte, and provides options for customization, including animation styles and event listeners to track swaps. Installation is straightforward via package managers or CDN.
Good Refactoring vs Bad Refactoring
Published: at 03:11 PM(Steve Sewell)This is an article about good versus bad refactoring. It discusses what refactoring is and the importance of doing it well. The article also details several common pitfalls to avoid, such as changing coding styles too much or adding unnecessary abstractions. Finally, it offers tips for successful refactoring, including being incremental, understanding the code deeply, and using testing tools.
Why I Don't Like Enums
Published: at 02:32 PM(Matt Pocock)The article explains why the author dislikes using TypeScript Enums, citing their inflexibility and poor compatibility with modern JavaScript features like objects and literal unions. Enums can introduce confusion and make code less predictable. Instead, the author recommends using alternatives like objects or union types, which offer better clarity, maintainability, and alignment with JavaScript's evolution.
Generate a PDF in React
Published: at 02:23 PM(Colby Fayock)The article on Space Jelly provides a guide on generating PDFs from HTML using JavaScript. It covers three main methods: html2pdf.js for client-side PDF generation from HTML, React PDF for creating PDFs in a React environment with a component-based API, and Puppeteer for automating browser actions to create PDFs. Each method has its pros and cons, with React PDF being highlighted as a versatile option for embedded text and ease of setup.