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

There’s a new AI-powered search engine in town

Tuesday, June 18, 2024

Plus: YouTube gets serious about blocking ad blockers View this email online in your browser By Cody Corrall Tuesday, June 18, 2024 Welcome back to TechCrunch PM. This afternoon, we look at a new AI-

Of Tadpoles and Tentpoles

Tuesday, June 18, 2024

A 10 step plan to save the movie theater business Of Tadpoles and Tentpoles A 10 step plan to save the movie theater business By MG Siegler • 18 Jun 2024 View in browser View in browser Inside Out 2

✅ You Can't Trust Steam Deck Verified Labels — How to Tell If Your Mobile Data is Being Throttled

Tuesday, June 18, 2024

Also: What is elementary OS, and More! How-To Geek Logo June 18, 2024 Did You Know When a decapitated flatworm regenerates its head, it also regains the primitive memories retained by its old one. 📱

JSK Daily for Jun 18, 2024

Tuesday, June 18, 2024

JSK Daily for Jun 18, 2024 View this email in your browser A community curated daily e-mail of JavaScript news Breathe Life into Your Webpages: Mastering DOM Manipulation with JavaScript Unleash the

NumPy 2.0, Calendar Versioning, Mappings, and More

Tuesday, June 18, 2024

Should Python Adopt Calendar Versioning? #634 – JUNE 18, 2024 VIEW IN BROWSER The PyCoder's Weekly Logo Should Python Adopt Calendar Versioning? Python's use of semantic style versioning

Daily Coding Problem: Problem #1470 [Medium]

Tuesday, June 18, 2024

Daily Coding Problem Good morning! Here's your coding interview problem for today. This problem was asked by Facebook. Given a positive integer n , find the smallest number of squared integers

A quick Go quiz

Tuesday, June 18, 2024

Plus debates about Go 1.23 iterators, anti-patterns, and another Go web framework. | #​511 — June 18, 2024 Unsub | Web Version Together with Dragonfly Go Weekly Why People are 'Angry' Over Go

Ranked | The 20 Biggest Tech Companies by Market Cap 🏆

Tuesday, June 18, 2024

In total, the 20 biggest tech companies are worth over $20 trillion—nearly 18% of the stock market value globally. View Online | Subscribe Now Available on Visual Capitalist Licensing: Hundreds of our

Is OpenAIs Sora in Trouble Yet?

Tuesday, June 18, 2024

Top Tech Content sent at Noon! Join MongoDB's AI Dev Quest Read this email in your browser How are you, @newsletterest1? 🪐 What's happening in tech today, June 18, 2024? The HackerNoon

Fisker files for Chapter 11 bankruptcy protection

Tuesday, June 18, 2024

The electric vehicle maker has finally called it quits... View this email online in your browser By Rebecca Bellan Tuesday, June 18, 2024 Welcome to TechCrunch AM! This morning, we've got updates