Web Tools #491 - el.before()/after(), JS Utils, Testing, React Native

Web Tools Weekly
WEB VERSION
Tools for Web Developers

Issue #491 • December 15, 2022

Advertisement
What’s the Biggest Development Trend for 2023
Did you know that web developers are gradually settling for a smaller number of frameworks as they stop experimenting with a wide range of tools? Take part in the most complete survey Developer Nation has ever created, share your thoughts and win amazing prizes!

Start Here
Developer Nation Survey

There are lots of different ways to inject content into the DOM with JavaScript. Some of such methods have been around what feels like forever – since the days of IE5. Over the years though, the DOM spec has added other more practical methods that are designed for specific use cases. Or in some instances, methods have been added for simplicity.

Take for example the Element.before() and Element.after() methods. These two methods have been supported in all modern browsers for some time now but aren't exactly 'legacy' methods like some of the others we use to inject content.

Each of these methods allows you add a comma-separated set of nodes or string objects at the desired location. If you're using Element.before(), then the content will be inserted before the specified element (that is inside its parent, as an immediate sibling). If you're using Element.after(), the content will be added after the element.

Here's some code to demonstrate:

let par = document.createElement('p'),
    span = document.createElement('span');

parent.lastElementChild.after(par, 'example', span);

The above assumes a parent element and is purely to demonstrate. This wouldn't be a very practical example. As you can see, I'm able to pass in multiple parameters and they can either be element references or strings of text. The above code, however, would produce a strange and likely broken HTML experience.

For a more practical example, try out this CodePen demo. You can use the buttons on the page to inject the content at the specified locations defined in the JavaScript.

Some things to note about these two methods:

  • The number of comma-separated elements and/or strings you can pass in as arguments is unlimited
  • If you insert strings, each one you insert is included as a separate text node, even if they're adjacent
  • The methods don't return any data or objects
  • If in some rare case the node cannot be inserted, you'll get something called a HierarchyRequestError (i.e. a type of DOMException)
Although these two methods seem to be lesser-known, they are probably more useful than some other more obscure methods available for DOM manipulation. 

Now on to this week's tools!

 

JavaScript Utilities

What’s the Biggest Development Trend for 2023?
Did you know that web developers are gradually settling for a smaller number of frameworks as they stop experimenting with a wide range of tools? Take part in the most complete survey Developer Nation has ever created, share your thoughts and win amazing prizes!     SPONSORED  

idle-task
A wrapper around requestIdleCallback() to improve your website performance by executing JavaScript during a browser's idle periods.

Maska
An input mask for form inputs, to force an input format depending on the type of field, for vanilla JavaScript and Vue.

undefined
A Node.js utility to convert a file of JSON responses into TypeScript types.

watching-you
A JavaScript library for building animations that watch anything in the DOM. The demo example is a pair of eyes following the mouse around the page.

BlockNote
A Notion-style block-based extensible text editor built on top of ProseMirror and Tiptap.

Snow.js
Add a script to any web page to add an animated snow effect to the page's background.

Snow.js

CSV To Markdown Table
An older project that's a simple JavaScript-based CSV to Markdown table converter.

Legend-State
A super-fast and powerful state manager for JavaScript apps that's easy to use. It works as a vanilla JavaScript tool but it's built for React apps as well.

BookmarkFS
A 'dumb' project that exploits what seems to be a flaw in Chrome's bookmark sync service that allows you to store files for free.

Blocky Editor
A block-based editor that's small and fast enough to be embedded in Notion-like apps, doesn't depend on any heavy editor framework, and handles complex text-editing details for you.

📢 On the Release Radar:

Testing and Debugging Tools

Powerful Video Editor SDK for Web
With client-side processing, full customization and powerful editing tools Video Editor SDK lets you effortlessly add video editing to your web app. All with just a few lines of code.   SPONSORED  

Free Website Speed Test
From DebugBear, includes higher-quality data than PageSpeed Insights and a detailed request waterfall for debugging.

MLab Speed Test
A library to test your download and upload speed using Measurement Lab's speed test tool.

xv
A fast zero-config test runner that's simple, works with TypeScript, and only exports test functions without hiding console.logs, raw errors, etc.

LocatorJS
A Chrome extension that lets you click on any component in the browser to open its code in your IDE. Also available as a library for React, Vue, Svelte, Preact, and Solid.

Jam
Chrome extension for bug reports that lets you capture your screen plus developer logs in one click. Has a decent free plan for solo developers.

Stroo
An open-source web app to publish and share software structures, as a helpful visual addition to documentation.

Stroo

hypertest
A Go-based test runner for the command line that lets you run tests in the background while coding, and get immediate live feedback.

WorkerBox
A secure sandbox to execute untrusted user JavaScript in a web browser without any risk to your own domain/site/page.

Eleven
A CLI to create code sandboxes with automatic HTTPS and long running processes in your cloud provider account.

SadServers
A SaaS where users can test their Linux troubleshooting skills on real Linux servers in a "Capture the Flag" fashion.

📢 On the Release Radar:

React Native and Mobile Tools

Powerful Video Editor SDK for Web
With client-side processing, full customization and powerful editing tools Video Editor SDK lets you effortlessly add video editing to your web app. All with just a few lines of code.   SPONSORED  

STF
A web application for debugging smartphones, smartwatches, and other gadgets remotely from the comfort of your browser.

react-native-share
A simple React Native library that adds the ability to share files and messages with other apps.

react-native-context-menu-view
Use native context menu functionality from React Native, for iOS 13 and above and Android.

React Native Elements
A React Native UI toolkit with customizable components for building cross-platform applications.

Quick SQLite
Fast SQLite for React Native that embeds the latest version of SQLite and provides a low-level JSI-backed API to execute SQL queries.

OsmiCSX
A utility framework for React Native for rapidly building custom user interfaces, similar to Tailwind CSS.

OsmiCSX

React Native Drag Text Editor
A 60FPS dynamic text editor powered with Reanimated for no-code, photo editor cases.

Expo Router Preview
A preview of the new router for React Native apps, currently in beta and not recommended for production use, but the repo can be used for early bugs and feedback.

redash
A toolkit for implementing React Native Reanimated and GestureHandler.

pixels-catcher
A JavaScript/TypeScript library for testing React Native UI components and screens.

Interactable
An old project looking for maintainers that's an experimental implementation of a declarative API for handling fluid user interactions with views at 60 FPS in React Native (e.g. swipeable cards, drawers, etc).
 

Commercial Apps and Classifieds

These are commercial apps, affiliate links, PPC ads, and paid classifieds. Submit yours!
VRTs – A WordPress Plugin to test for visual changes and notifies you upon alerts automatically.
TinyUX – Android app to quickly create low-fi wireframes from anywhere at anytime.
Noom – A science-based approach to weight loss, used successfully by millions.    AD
The Juice – Career-enhancing resources from top brands and thought leaders in one place.  AD
Visualping – Service to monitor websites changes and get automated alerts.
Coherence – A dev platform that integrates development, testing, and production in one dashboard.
Interval – A code-first platform to build internal tools, prototypes, and more.

A Tweet for Thought

Jack Forge explains why all tech workers need all three operating systems.
 
A Tweet for Thought
 

Send Me Your Tools!

Made something? Send links via Direct Message on Twitter @WebToolsWeekly (details here). No tutorials or articles, please. If you have any suggestions for improvement or corrections, feel free to reply to this email.
 

Before I Go...

This is pretty amazing: Harvard CS50 – Full Computer Science University Course is a 25-hour YouTube video that offers "an introduction to the intellectual enterprises of computer science and the art of programming", from Harvard University.

Thanks to everyone for subscribing and reading!

Keep tooling,
Louis
@WebToolsWeekly
PayPal.me/WebToolsWeekly

Older messages

Web Tools #490 - Math.random(), CSS Tools, Git/CLI, Uncats

Thursday, December 8, 2022

Web Tools Weekly WEB VERSION Issue #490 • December 8, 2022 Advertisement Use Full Power of MySQL with All-in-one IDE dbForge Studio for MySQL is a full-fledged IDE for database development, management

Web Tools #489 - Array.values(), Media Tools, React, Git/CLI

Thursday, December 1, 2022

Web Tools Weekly WEB VERSION Issue #489 • December 1, 2022 Advertisement The Future Of Tech, Delivered Today. Join over 450K people by reading Emerging Tech Brew, the 3-times-a-week email delivering

Web Tools #488 - copyWithin(), JS Utilities, Databases, Uncats

Thursday, November 24, 2022

Web Tools Weekly WEB VERSION Issue #488 • November 24, 2022 Advertisement Hey Devs, Meet TelemetryHub! TelemetryHub is an observability tool that collects all your complex telemetry data into a single

Web Tools #487 - Autocomplete, CSS Tools, Build Tools, Uncats

Thursday, November 17, 2022

Web Tools Weekly WEB VERSION Issue #487 • November 17, 2022 Advertisement Turn Heads on Video with mmhmm Put yourself on screen with your slides. Move around for emphasis. Works with Zoom, Meet, and

Web Tools #486 - Future CSS, Frameworks, Media, React

Thursday, November 10, 2022

Web Tools Weekly WEB VERSION Issue #486 • November 10, 2022 Advertisement Get Early Access to TelemetryHub! TelemetryHub is an observability tool that collects all your complex telemetry data into a

You Might Also Like

Import AI 399: 1,000 samples to make a reasoning model; DeepSeek proliferation; Apple's self-driving car simulator

Friday, February 14, 2025

What came before the golem? ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏

Defining Your Paranoia Level: Navigating Change Without the Overkill

Friday, February 14, 2025

We've all been there: trying to learn something new, only to find our old habits holding us back. We discussed today how our gut feelings about solving problems can sometimes be our own worst enemy

5 ways AI can help with taxes 🪄

Friday, February 14, 2025

Remotely control an iPhone; 💸 50+ early Presidents' Day deals -- ZDNET ZDNET Tech Today - US February 10, 2025 5 ways AI can help you with your taxes (and what not to use it for) 5 ways AI can help

Recurring Automations + Secret Updates

Friday, February 14, 2025

Smarter automations, better templates, and hidden updates to explore 👀 ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏

The First Provable AI-Proof Game: Introducing Butterfly Wings 4

Friday, February 14, 2025

Top Tech Content sent at Noon! Boost Your Article on HackerNoon for $159.99! Read this email in your browser How are you, @newsletterest1? undefined The Market Today #01 Instagram (Meta) 714.52 -0.32%

GCP Newsletter #437

Friday, February 14, 2025

Welcome to issue #437 February 10th, 2025 News BigQuery Cloud Marketplace Official Blog Partners BigQuery datasets now available on Google Cloud Marketplace - Google Cloud Marketplace now offers

Charted | The 1%'s Share of U.S. Wealth Over Time (1989-2024) 💰

Friday, February 14, 2025

Discover how the share of US wealth held by the top 1% has evolved from 1989 to 2024 in this infographic. View Online | Subscribe | Download Our App Download our app to see thousands of new charts from

The Great Social Media Diaspora & Tapestry is here

Friday, February 14, 2025

Apple introduces new app called 'Apple Invites', The Iconfactory launches Tapestry, beyond the traditional portfolio, and more in this week's issue of Creativerly. Creativerly The Great

Daily Coding Problem: Problem #1689 [Medium]

Friday, February 14, 2025

Daily Coding Problem Good morning! Here's your coding interview problem for today. This problem was asked by Google. Given a linked list, sort it in O(n log n) time and constant space. For example,

📧 Stop Conflating CQRS and MediatR

Friday, February 14, 2025

​ Stop Conflating CQRS and MediatR Read on: m​y website / Read time: 4 minutes The .NET Weekly is brought to you by: Step right up to the Generative AI Use Cases Repository! See how MongoDB powers your