#js

266 bookmarks tagged with #js · RSS Feed · ← All Tags

argyleink/prop-for-that: what JS knows, now CSS knows

https://github.com/argyleink/prop-for-that
Sliders, pointer position, element visibility, viewport size, battery, network, sensors — JavaScript can read all of it; CSS can't. prop-for-that writes that runtime state into --live-* and --const-* custom properties — batched and diffed down to one setProperty per frame — so your CSS can compose and react to it with plain calc() and var().

The Web Platform is a Triumph of Object-Oriented Programming | That HTML Blog

https://thathtml.blog/2025/12/the-dom-is-a-triumph-of-object-oriented-programming/
It’s not just that web APIs often take advantage of OOP. They would not exist without OOP! Virtually every web API you have ever used is designed specifically within the OOP paradigm. And every entity in the lifecycle of a web page is based on objects. These objects are instances of classes and in a great many cases these classes are subclasses of other classes. This means that key functionality is spread across a class hierarchy. That isn’t a bug, it’s a feature! And this means that it’s absurd to think that to write a web app you need to reach for a “framework”. The Web Platform is a framework.

Your URL Is Your State

https://alfy.blog/2025/10/31/your-url-is-your-state.html
This got me thinking: how often do we, as frontend engineers, overlook the URL as a state management tool? We reach for all sorts of abstractions to manage state such as global stores, contexts, and caches while ignoring one of the web’s most elegant and oldest features: the humble URL.

Building the Hundred-Year Web Service with htmx - Alexander Petros - YouTube

https://www.youtube.com/watch?v=lASLZ9TgXyc
In the fast-moving JS ecosystem, keeping your software current can be a huge drain on resources. But what if there was way to write software that had minimal maintenance burden today and didn't inspire dread in the junior developers of tomorrow? Built into the web platform are all the capabilities necessary to create useful, networked services that last for decades—we just have to build in ways that takes advantage of them.

Web Performance Calendar » Signals: the nitty-gritty

https://calendar.perfplanet.com/2022/signals-the-nitty-gritty/
Mostly revealed to the Web by Solid.js, shortly after embraced by Preact, but also blended into usignal, or implemented by many others, this pattern convinced tons of developers that hooks might not be the best solution to reactivity out there, but while the concept might look and feel super simple and natural to deal with, the complexity behind spans from 30LOC to pretty convoluted code bases.

The Pixel Canvas Shimmer Effect

https://ryanmulligan.dev/blog/pixel-canvas/
I recently stumbled on a super cool, well-executed hover effect from the clerk.com website where a bloom of tiny pixels light up, their glow staggering from the center to the edges of its container. With some available free time over this Thanksgiving break, I hacked together my own version of a pixel canvas background shimmer. It quickly evolved into a pixel-canvas Web Component that can be enjoyed in the demo below. The component script and demo code have also been pushed up to a GitHub repo.

Where web components shine - daverupert.com

https://daverupert.com/2024/10/super-web-components-sunshine/
In this job we need to think a lot about the tools we choose and why, so I cataloged all the places where web components (for me) feel like “the right tool for the job”. Your list may be different and I’d love to read it. And because I don’t want this to be 100% propaganda, I’ll also cover some of the not-so-great parts of web components as well.

Invoker Commands (Explainer) | Open UI

https://open-ui.org/components/invokers.explainer/
Adding commandfor and command attributes to <button> and elements would allow authors to assign behaviour to buttons in a more accessible and declarative way, while reducing bugs and simplifying the amount of JavaScript pages are required to ship for interactivity. Buttons with command will - when clicked, touched, or enacted via keypress - dispatch a CommandEvent on the element referenced by commandfor, with some default behaviours.

Popover API - Web APIs | MDN

https://developer.mozilla.org/en-US/docs/Web/API/Popover_API
The Popover API provides developers with a standard, consistent, flexible mechanism for displaying popover content on top of other page content. Popover content can be controlled either declaratively using HTML attributes, or via JavaScript.

Paul O’Shannessy - Do We Need Node?

http://zpao.com/posts/do-we-need-node/
So what do I want? I want a world where the core JS engine is swappable. Maybe I’m deploying on an architecture not supported by V8 (Node on SPARC came up while working on SpiderNode). Maybe my employer only wants to use the JVM. Or maybe Microsoft can get some performance wins by using Chakra for Windows Azure. Back to modules, I don’t want to get rid of npm. Or maybe I do and I want something that only supports ES6+ modules.

Paul O’Shannessy - Do We Need Node?

http://zpao.com/posts/do-we-need-node
So what do I want? I want a world where the core JS engine is swappable. Maybe I’m deploying on an architecture not supported by V8 (Node on SPARC came up while working on SpiderNode). Maybe my employer only wants to use the JVM. Or maybe Microsoft can get some performance wins by using Chakra for Windows Azure. Back to modules, I don’t want to get rid of npm. Or maybe I do and I want something that only supports ES6+ modules.

Case Study: Auto-Resizing HTML5 Games - HTML5 Rocks

http://www.html5rocks.com/en/tutorials/casestudies/gopherwoord-studios-resizing-html5-games/
In the summer of 2010, we created Sand Trap, a game that we entered in a competition on HTML5 games for mobile phones. But most mobile phones either displayed only part of the game or made the game too small—making it completely unplayable. So we took it upon ourselves to make the game fluidly adjust to match any resolution. After a bit of re-programming and using ideas outlined in this article, we had a game that scaled across any modern browser, whether it ran in a desktop or a mobile device.

Case Study: Auto-Resizing HTML5 Games - HTML5 Rocks

http://www.html5rocks.com/en/tutorials/casestudies/gopherwoord-studios-resizing-html5-games
In the summer of 2010, we created Sand Trap, a game that we entered in a competition on HTML5 games for mobile phones. But most mobile phones either displayed only part of the game or made the game too small—making it completely unplayable. So we took it upon ourselves to make the game fluidly adjust to match any resolution. After a bit of re-programming and using ideas outlined in this article, we had a game that scaled across any modern browser, whether it ran in a desktop or a mobile device.

Client-side Messaging Essentials

http://freshbrewedcode.com/jimcowart/2013/02/07/client-side-messaging-essentials/
"Most people throw around the term “pub/sub” to describe any kind of eventing/messaging – but I think this term fails to adequately communicate the abstraction. Yes, ultimately, something is subscribing to what something else is publishing. But the level at which publishers and subscribers are encapsulated has the power to make a good pattern turn to the dark side. So, what’s the difference?"

Client-side Messaging Essentials

http://freshbrewedcode.com/jimcowart/2013/02/07/client-side-messaging-essentials
"Most people throw around the term “pub/sub” to describe any kind of eventing/messaging – but I think this term fails to adequately communicate the abstraction. Yes, ultimately, something is subscribing to what something else is publishing. But the level at which publishers and subscribers are encapsulated has the power to make a good pattern turn to the dark side. So, what’s the difference?"

baudehlo/Haraka · GitHub

https://github.com/baudehlo/Haraka
Haraka is an SMTP server which uses a plugin architecture to implement most of its functionality. It uses a highly scalable event model to be able to cope with thousands of concurrent connections. Plugins are written in Javascript using Node.js, and as such perform extremely quickly. The core Haraka framework is capable of processing thousands of messages per second on the right hardware.

Mechanics of Flite - Underappreciated NPM Commands Developers Should Know About

http://mechanics.flite.com/blog/2012/12/11/underappreciated-npm-commands/
npm, the package manager that comes bundled with node.js, is generally described as “awesome”. While it was originally a separate project, npm has been bundled with node.js for the past few releases and the number of npm packages available in the npm registry has exploded.

Mechanics of Flite - Underappreciated NPM Commands Developers Should Know About

http://mechanics.flite.com/blog/2012/12/11/underappreciated-npm-commands
npm, the package manager that comes bundled with node.js, is generally described as “awesome”. While it was originally a separate project, npm has been bundled with node.js for the past few releases and the number of npm packages available in the npm registry has exploded.

marijnh/Presence

https://github.com/marijnh/Presence
Presence is an IRC logger and client that is optimized for my specific use of IRC — scan logs for a few specific channels, respond to direct messages and mentions, and only occasionally participate in discussion. It probably won't work for you if you're a heavy IRC user.

Arctext.js - Curving Text with CSS3 and jQuery | Codrops

http://tympanus.net/codrops/2012/01/24/arctext-js-curving-text-with-css3-and-jquery
While CSS3 allows us to rotate letters, it is quite complicated to arrange each letter along a curved path. Arctext.js is a jQuery plugin that let's you do exactly that. Based on Lettering.js, it calculates the right rotation of each letter and distributes the letters equally across the imaginary arc of the given radius.

2011: A Badass JavaScript Year In Review - Badass JavaScript

http://badassjs.com/post/15082876071/2011-a-badass-javascript-year-in-review?72f783a8=
2011 has been a great year for JavaScript. Web browsers have given us great new tools to use and we have taken web applications to new heights, competing with native applications and bringing sexy back to the web with countless impressive demos. A week or so ago, we put out a survey to all of you asking what you thought the most badass JavaScript demo of 2011 was. Of course, this would be a boring post if we just said what the outcome was, so we’re going to list the top JavaScript accomplishments of 2011 here, from demos to libraries and applications themselves. And to all of you in the JS community, Happy New Year and keep up the good work in 2012!

Generating XML With node.js - WezM.net

http://www.wezm.net/technical/2011/01/generating-xml-with-node-js
For a node.js project I’m working on I wanted to generate a Sphinx xmlpipe2 data stream. The options for generating XML with node.js seemed a bit limited. The main contender appeared to be libmljs but it segfaulted whenever I tried to use it. So with previous experience using Tim Bray’s Genx C library I decided to write bindings for node. The result is node-genx, which is available via npm.

Weekend coding: Add a character counter as the background of a textarea with JavaScript | CodeUtopia

http://codeutopia.net/blog/2009/08/01/weekend-coding-add-a-character-counter-as-the-background-of-a-textarea-with-javascript
"Have you ever filled a textarea on a page, which had a limit to how many characters you could type into it? ... How to effectively communicate how many characters you can type into a box, and have it look good. ... Add the number counter as the background of the textarea!"

Using JavaScript in PHP with PECL and SpiderMonkey

http://devzone.zend.com/article/4704-Using-JavaScript-in-PHP-with-PECL-and-SpiderMonkey
"SpiderMonkey support in PHP comes through PECL's ext/spidermonkey extension, which is maintained by Christophe Robin, and provides an object-oriented API for accessing the SpiderMonkey library. Although this extension is currently in beta, it still allows you to do some fairly interesting things, including registering and using variables, functions and classes from PHP in JavaScript."

Amazon.com: Concise Guide to Dojo: Leslie M. Orchard: Books

http://www.amazon.com/Concise-Guide-Dojo-Leslie-Orchard/dp/0470452021/ref=sr_1_1?ie=UTF8&qid=1222352476&s=books&sr=8-1
"Packed with useful information and lots' of insightful examples The Concise Guide to Dojo, taken from the forthcoming Professional JavaScript Frameworks book, provides experienced web developers a quick path to understanding and utilizing Dojo: a JavaScript based meta-framework for creating highly dynamic, visually appealing web sites. Logically organized, this guide quickly introduces the reader to Dojo and then quickly moves on to cover topics ranging from Manipulating DOM object, Event Handling, Utilizing AJAX, and working with additional Dojo add-on such as Dijit and DojoX."

Foo Hack » YUI’s “Module Pattern” vs. Prototype’s Class Function

http://foohack.com/2007/08/yui-crockford-module-pattern-vs-prototypes-class-function
Interesting perspective, with which I agree somewhat. Though, there's certainly something to be said for building a domain-specific language of convenience for DOM manipulation. "The more time someone spends building applications with a library like Prototype, the further they get from Javascript, and the more dependent they become on the library. By contrast, time spent using YUI tends to breed developers who are experts in Javascript, and that skill is far more useful than being an expert in a particular library."

Nihilogic: Sandbag text wrapping with Canvas

http://blog.nihilogic.dk/2008/09/sandbag-text-wrapping-with-canvas.html
"With CSS you can make text wrap around an image using the float property and for most purposes this is quite adequate. However, it doesn't take into account the actual image and treats it as one big block, even if you'd prefer the text to wrap around the actual content in the picture, magazine style.Since we now have pixel access (in cool browsers, anyway) via the Canvas element, this technique can now be implemented dynamically with a bit of JavaScript."

rephrase § E4X

http://rephrase.net/days/07/06/e4x
"E4X, short for “ECMASCript for XML”, is an extension to ECMAScript (i.e. JavaScript, JScript, ActionScript…) with new syntax and built-in objects for more convenient handling of XML fragments. It seems to be used most frequently with ActionScript 3 (Flash), but is also available in recent Mozilla/Firefox releases."

webdev.stephband.info

http://webdev.stephband.info/parallax.html
"Parallax turns a selected element into a 'window', or viewport, and all its children into absolutely positioned layers that can be seen through the viewport. These layers move in response to the mouse, and, depending on their dimensions (and options for layer initialisation), they move by different amounts, in a parallaxy kind of way."

jQuery PHP library

http://jquery.hohli.com
"jQuery-PHP is a PHP library that allows to tie jQerry with PHP most natural way. You don't need to think in terms of transmission, parsing and other boring staff. Now you have a bridge that brings DOM right onto your server :) and you can ealisy manipulate it in jQuerry-style way." This seems like one of the worst ideas - maybe it's just me, but "shortcuts" and other encapsulations of client-side JS within server-side code-generation in PHP / Ruby / Python / Perl / etc seems like one of the worst forms of magical obfuscation there is in webdev. Of course, I also feel the same way about most psuedo-ORM SQL / database abstractions.

Wait till I come! » Blog Archive » Planning JavaScript and Ajax for larger teams, equine invigorating imagery, one voice for libraries and a lot of good speakers - this was @mediaAjax 2007

http://www.wait-till-i.com/2007/11/21/planning-javascript-and-ajax-for-larger-teams-equine-invigorating-imagery-one-voice-for-libraries-and-a-lot-of-good-speakers-this-was-mediaajax-2007
"I didn’t cover many technical issues but instead tried to convince some people to recognize that the way you use JavaScript in your team is the most important part of development."

JsonLibrary - TrimPath - Trac

http://trimpath.com/project/wiki/JsonLibrary
"Note, we have an improved implementation of JSON stringify that builds up a string array instead of doing inline string concatenation. The version below should use less memory than the original JSON implementation."

JSMIN, The JavaScript Minifier

http://www.crockford.com/javascript/jsmin.html
"JSMin is a filter which removes comments and unnecessary whitespace from JavaScript files. It typically reduces filesize by half, resulting in faster downloads. It also encourages a more expressive programming style because it eliminates the download cos

Jack Slocum's Blog - DomHelper - Create Elements using DOM, HTML fragments and Templates

http://www.jackslocum.com/yui/2006/10/06/domhelper-create-elements-using-dom-html-fragments-or-templates
"The DomHelper class in the 0.32.2 release provides a layer of abstraction from DOM and transparently supports creating elements via DOM or using HTML fragments. It also has the ability to create HTML fragment templates from your DOM building code."

YUI: DragDrop Nested targets

http://blog.davglass.com/files/yui/dd2
"Basically, all I am doing is setting a var (lastTarget) onDragOver to the element that we are over. Then in the onDragDrop function, I am checking to see if the id that is returned matches the id that is stored in lastTarget. If it is, display the text i

Tabtastic

http://phrogz.net/JS/Tabtastic/index.html
"This library is a simple way to implement tabs on your page using CSS, a little JS, and semantic markup which degrades gracefully on browsers with CSS unavailable or disabled."

.: jsolait.net :.

http://jsolait.net
"The goal is to ease JavaScript development by building a library of reusable modules and components and enhancing JavaScript with simpler Class and Module handling mechanisms."

DOMForm

http://wwwsearch.sourceforge.net/DOMForm
"DOMForm is a Python module for web scraping and web testing. It knows how to evaluate embedded JavaScript code in response to appropriate events."