Web Tools #566 - Viewport API, JS Libraries, Build Tools, Uncats

Web Tools Weekly
WEB VERSION
Tools for Web Developers

Issue #566 • May 23, 2024

Advertisement

Support Web Tools Weekly via GitHub Sponsors
It's getting harder and harder to find viable advertising options for a small- to medium-sized newsletter like this one. If approximately 2,000 of my subscribers contributed $1 per month, it would be enough to keep things afloat without the need to seek out new commercial sponsors.

You can contribute to Web Tools Weekly by sponsoring me on GitHub with a one-time donation or a monthly sponsorship.

Sponsor Web Tools Weekly on GitHub

If I could fund the newsletter primarily on contributions from readers, then I wouldn't have to ever seek out advertising and I could remove advertising from the newsletter completely.

All three newsletters I produce are basically a one-man operation, so my expenses can be covered with about 10% of the audience contributing at least $1 per month.

Sponsor Web Tools Weekly on GitHub →

An interesting and somewhat new API that you might want to become familiar with is the Visual Viewport API. It's been around long enough that it's now considered "Widely Available" according to MDN's browser data. So it's safe to use and looks to be quite practical for dealing with layouts on different devices and zoom levels.

The Visual Viewport is defined as:

"...the visual portion of a screen excluding on-screen keyboards, areas outside of a pinch-zoom area, or any other on-screen artifact that doesn't scale with the dimensions of a page."

This improves on the concept of the general viewport (referred to as the Layout Viewport), which would include the things mentioned in that definition, basically amounting to everything currently visible on the page.

The primary interface you'll work with when using the Visual Viewport API is the VisualViewport object. This object has the properties offsetLeft, offsetTop, pageLeft, pageTop, width, height, and scale. These return various values that you can work with. The API also has two events: resize and scroll.

The MDN article for the VisualViewport object includes a couple of live demos you can try out. But take note that if you're going to test the 'zooming', you'll have to use a mobile devices that is able to pinch-zoom. As far as I can tell, just zooming on a desktop device doesn't trigger a change in the 'scale' property that's queried in the scripts on the demos. Here's one of the example code snippets, so you can get an idea how it works:

const bottomBar = document.getElementById("bottombar");
const viewport = window.visualViewport;

function resizeHandler() {
  bottomBar.style.display = viewport.scale > 1.3 ? "none" : "block";
}

window.visualViewport.addEventListener("resize", resizeHandler);

The primary action in the above code is the ternary expression that switches the display of the bottom bar depending on the value of the VisualViewport.scale property (abbreviated as viewport.scale due to the use of the variable).

This interface can come in handy to hide unnecessary 'aside' content like sidebars, ads, stickied elements, and so on, depending on the zoom level. Definitely an API you'll want to utilize if you're working on layouts that need to be optimized for mobile viewing.


Now on to this week's tools!
 

JavaScript Libraries & Frameworks

DBOS Transact — A transactional TypeScript framework that's reliable, simple, and easy to debug, for developing database-backed applications with built-in once-and-only-once code execution.

Ollama.js — A JavaScript library that provides the easiest way to integrate your JavaScript project with Ollama, the popular native app to get up and running with large language models locally.

compromise — A JavaScript library for doing natural-language processing that "tries its best" to turn text into data by making limited and sensible decisions.

Support This Newsletter — This newsletter is a one-man operation and finding viable sponsors is getting more difficult in the current market. You can support the newsletter with a one-time donation via PayPal.    SPONSORED 

Mana Potion — A toolkit for JavaScript game development and interactive experiences that contains a collection of low-level utilities and helpers commonly needed when building games.

Tini — A small, fast, and interoperable framework for building Single Page Apps, Progressive Web Apps, or Desktop or Mobile Apps.

Tini

Sampo-UI — A framework for building user interfaces for semantic portals.

PanvasJS — A JavaScript framework based on the HTML canvas element that's a barebones game engine for making 2D video games practically from scratch with basic tools.

goja — Not a JavaScript library but an implementation of ECMAScript 5.1 in pure Go, with emphasis on standards compliance and performance.

Labyrinthos.js — A JavaScript procedural generator for mazes, terrains, and biomes, designed for game developers and professional hobbyists.

Build Tools, Bundlers, etc.

Earthly — A simple Go-based build framework with fast, repeatable builds and an instantly familiar syntax – like Dockerfile and Makefile had a baby.

TS Docs — An online tool that lets you browse type documentation for npm packages, just enter the name of a package to view the docs.

tshy — A hybrid (CommonJS/ESM) TypeScript node package builder that lets you write modules that just work in ESM and CommonJS, in easy mode.

Parcel REPL — A REPL or online playground for working with and learning to use Parcel, the popular zero-config build tool.

Parcel REPL

Kuto — A Node.js package that reduces your JavaScript download size by re-using code you've already shipped.

Anytime Mailbox — Business starters, are you in need of a business address separate from your home? Anytime Mailbox provides a seamless solution, securing a private, professional address with added benefits like mail forwarding and scanning for ultimate convenience.     SPONSORED 

Dioma — An elegant dependency injection container for vanilla JavaScript and TypeScript, with no decorators, no annotations, and no dependencies.

JSR — An open-source package registry for modern JavaScript and TypeScript, to publish TypeScript source, while the registry handles generating API docs, .d.ts files, and transpiling your code for cross-runtime compatibility.

TanStack Config — A seamless and intuitive configuration management system that simplifies the process of building and publishing high-quality JavaScript packages.

typescript-eslint Playground — An online tool for working with typescript-eslint, the popular monorepo for tooling that enables ESLint and Prettier to support TypeScript.
Advertisement

The Morning Paper for Hacker News Readers
Want a byte-sized version of Hacker News that takes just a few minutes to read? 

Try TLDR's free daily newsletter.

TLDR covers the most interesting tech, startup, and programming stories in under 5 minutes.

TLDR

No sports. No politics. No weather.

TLDR is read by 1,250,000 software engineers, founders, and tech workers.

Subscribe for Free →


 

The Uncateg­orizables

Latitude — An open-source framework for embedded analytics to create API endpoints on top of your db or warehouse using just SQL, and embed interactive visualizations natively in your favorite frontend framework or through an iframe.

Zenlogin — A service that enables AI-powered email notifications for every unusual login attempt on your website. Free plan includes 500 requests and 50 suspicious login emails per month.

SubQuery — An open-source, flexible, fast and universal data indexing framework for web3, to help developers create decentralized products.

Anytime Mailbox — Business starters, are you in need of a business address separate from your home? Anytime Mailbox provides a seamless solution, securing a private, professional address with added benefits like mail forwarding and scanning for ultimate convenience.     SPONSORED 

@docker/Windows — Run the Windows OS inside a Docker container, with more than a dozen versions of Windows available to choose from.

Placemark — A web-based tool for creating, editing, and visualizing map data, in a variety of formats including GeoJSON, KML, Shapefiles, CSV, and more.

dive — A Go-based tool for exploring a Docker image, layer contents, and discovering ways to shrink the size of your Docker/OCI image.

Wasmer — A blazing fast and secure WebAssembly runtime that enables incredibly lightweight containers to run anywhere, including desktop, the cloud, edge, and your browser.

Wasmer

Casbin — An authorization library written in Go that supports access control models for Node.js, JavaScript, Ruby, Python, C/C++, Golang, Java, and more.

Dewhale — Formerly called vx, a GitHub-powered AI, as an alternative to Vercel's v0, the tool to generate UIs from a text prompt.

Commercial Apps & Classifieds

These are commercial apps, affiliate links, PPC ads, and paid classifieds. Buy a Classified here.
ServBay – Install your PHP/Node.js web development environment in minutes, with no dependencies.
TLDR – A byte-sized version of Hacker News that takes just a few minutes to read.   AD 
Lightning – Code together, proto­type, deploy, and host AI apps from the browser with zero setup.
App Backend – A backend solution for simple projects to integrate table data with external systems.
Techpresso – Join 100,000+ free daily readers for the latest AI and tech news, tools, and insights.    AD 
Anycode – A service that provides an autonomous AI to fix vulnera­bilities, legacy code, and more.
Feather – A no-code platform to write content on Notion and publish to your SEO-friendly blog.

An X Post for Thought

What's more difficult, picking a new coffee maker, or picking a JavaScript library?
 
An X Post for Thought
 

Send Me Your Tools!

Made something? Reply to this email or send links via Direct Message on X @LouisLazaris (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...

If you want to practice your typing speed, try QWERTYTILES, a somewhat unnerving and challenging way to learn to type faster. They just keep falling!

Thanks to everyone for subscribing and reading!

Keep tooling,
Louis
@LouisLazaris
PayPal.me/WebToolsWeekly

Older messages

Web Tools #565 - Chris Coyier, CSS Tools, AI, JS Utilities

Friday, May 17, 2024

WEB VERSION Issue #565 • May 16, 2024 Advertisement Support Web Tools Weekly via GitHub Sponsors It's getting harder and harder to find viable advertising options for a small- to medium-sized

Web Tools #564 - JS Utilities, React Tools, Uncats

Thursday, May 9, 2024

WEB VERSION Issue #564 • May 9, 2024 Advertisement Support Web Tools Weekly via GitHub Sponsors It's getting harder and harder to find viable advertising options for a small- to medium-sized

Web Tools #563 - Frameworks, JSON/DB Tools, Vue, Nuxt.js

Thursday, May 2, 2024

WEB VERSION Issue #563 • May 2, 2024 Advertisement The Complete JavaScript Course 2024: From Zero to Expert This is an up-to-date JavaScript course covering modern techniques and features that will

Web Tools #562 - Voilà Review, CSS Tools, Media, React Native

Thursday, April 25, 2024

WEB VERSION Issue #562 • April 25, 2024 The following is a paid product review for Voilà, an AI assistant for the browser that enables you to improve your writing, coding, brainstorming, and research

Web Tools #561 - Popover Modals, React Tools, Git/CLI, Uncats

Thursday, April 18, 2024

WEB VERSION Issue #561 • April 18, 2024 Advertisement $47 Million in Artwork Sales Equals Profits for These Everyday Investors — Masterworks is taking on the billionaires at their own game, buying up

You Might Also Like

📳 Galaxy Z Flip 6 Review — How to Watch the 2024 Summer Olympics for Free

Friday, July 26, 2024

Also: Fixing Spotify's Repeating Ads, and More! How-To Geek Logo July 26, 2024 Did You Know The rectangular area of a flag found in the upper left corner (top hoist corner) of the flag, such as the

Your monthly update has arrived

Friday, July 26, 2024

What's new in Google Play and Android July 2024 The Collections surface engages users with content Introducing Collections, a new on-device surface for your content Collections present users with

iOS Dev Weekly - Issue 671

Friday, July 26, 2024

There are two types of apps on the visionOS App Store. Will you create an app that makes people reach for the headset? 🥽 View on the Web Archives ISSUE 671 July 26th 2024 Comment In the last two weeks

Ranked | The 10 Busiest Ports in the World, by Cargo Traffic 🚢

Friday, July 26, 2024

As critical nodes for trade and commercial activity, we show the top 10 busiest ports in the world by cargo volume. View Online | Subscribe Presented by: Is Your Portfolio Powering the Future? >>

Let the Games Begin

Friday, July 26, 2024

Week of July 22, 2024 Let the Games Begin Week of July 22, 2024 By MG Siegler • 26 Jul 2024 View in browser View in browser Mark Zuckerberg loves two things above all else right now: llamas and

Daily Coding Problem: Problem #1508 [Hard]

Friday, July 26, 2024

Daily Coding Problem Good morning! Here's your coding interview problem for today. This problem was asked by Uber. Given an array of integers, return a new array such that each element at index i

OpenAI announces SearchGPT - Weekly News Roundup - Issue #477

Friday, July 26, 2024

Plus: Will billionaires live forever; a police robot dog jamming wireless networks; Alphabet to invest $5B into Waymo; warnings about “model collapse”; a new partnership for AI security; and more! ͏ ͏

Using Data as a Product Manager

Friday, July 26, 2024

If you had your choice between a little data or a lot of data on which to guide decisions, which would you pick? ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌

Last Mile of Blockchains: RPC and Node-as-a-Service

Friday, July 26, 2024

Top Tech Content sent at Noon! Find the hottest jobs from top tech companies Read this email in your browser How are you, @newsletterest1? 🪐 What's happening in tech today, July 26, 2024? The

⚙️ Generative AI is making workers less productive

Friday, July 26, 2024

Plus: Runway trained video generator on thousands of YouTube videos ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌