386 private links
Unobtrusive logging for modern javascript
Zero dependencies. Universal runtime. Optimized performance.
The library avoid overhead and boilerplate compared to other logger library such as Winston or Pino.
I restart the project
New generation of tools:
- Speedy Web Compiler
- ESBuild
- BiomeJS t combines code formatting and linting into a single high-performance JavaScript toolchain.
- Oxc is a collection of Rust-based Javascript tools focusing on linting, formatting and transforming Javascript and typescript tools.
- Fast Node Manager / Mise
- Typescript in Go
Another notable efforts are Turbopack and Turborepo, Bun and Deno.
Contributing becomes less accessible to the majority of JavaScript developers of course. The shift demonstrates other skills in system programming that will drive even more innovative tooling in the coming years
Testing sucks because you try to test implementation details. This results in you writing tests to pass your code. That’s not useful, because…
Instead, you should…
- Write an empty test, with one comment for each external behavior your code should display.
- Write the code to test each comment below it.
- Then write the actual code to make it so.
The author provides some code sample.
- Creating Blob Objects Safely and Efficiently
- Chunking Large Files to Avoid Memory Explosions
- Image Compression and Format Conversion on the Front End (with the canvas API)
- A Unified File Preview Component
- Data Export and Download with Blobs (JSON, CSV, “Excel”)
- Blob URL Memory Management and Leak Prevention
Not ready for ruse in production
A new API that aims to improve the history API
JSON module imports became baseline: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import/with:
import data from './data.json' with { type: 'json' };
and lazy-load it with:
const { default: data } = await import('./data.json', {
with: { type: 'json' },
});
It makes sense to use JSON module imports for local static JSON resources where you need all/most of the data within. Particularly since bundlers can understand JSON imports, and bundle the object with other modules. That isn't possible with fetch(), unless you use some pretty hacky plugins.
Generally, I try to turn any "fetch-and-process" logic into a Vite/Rollup plugin, so it happens at build time rather than runtime.
If JS fails to load, a keyframe remove the effect provided by JS in 2 seconds.
It is currently experimental, but could be amazing because it parse a string of HTML safely and then insert it into the DOM
Why Piccalilli: I’m going to side with an independent publisher every single time.
video just isn’t the water we developers swim in every day. Far as I’m concerned, learning JavaScript hinges on being able to try stuff out for yourself: copy a snippet of code, chuck it into your dev console, see what happens; move a semicolon to see how it breaks.
How a beginner should make websites? Learn to write good HTML. Learn the medium instead of the tooling (raw JS instead of a framework).
That excites Mat Marquis about the web? The comeback of web brutalism, small web, etc...
https://strange.website/
https://www.weatherishappening.com/
https://solar.lowtechmagazine.com/
https://scott.is/
Note: JS does not have the concept. If we wanted to mutate something, e’d need to put it in an object first, and then pass that object.
Yes, I missed that thought even if I am programming! We simply pass by value often and reassign the function output to a variable.
I’m still not entirely sure what object freezing is useful for — I feel like it’s rarely what you want.
Me too. I never found a good case for it.
I just want to be able to tell if a function is going to mess with its parameters.
It's a way to tell it. Does the parameters are mutated in-place?
To ensure the parameters
In JS, we can freeze an object. The object can be (deep) cloned in Go. ({...o} as shallow clone in JS)
and I think I start to get it: Rust is awesome as interfaces because it can tell from the function signature if it mutates the parameters.
Indeed:
Similar ideas have been around for a while: In 1990, Philip Wadler wrote Linear types can change the world!
About safety in C or C++:
But those languages should be seen as asbestos.
It comes down to the multiple data structures in Rust.
But this complexity is simply a way to encode the reality of dealing with data in a multi-threaded environment, a way that can be checked at compile-time, before the program even gets a chance to run.
When you manage to make the type system work with you rather than against you, you can build things that would be wildly irresponsible to write in C and C++. And that’s the promise of Rust.
How to build a mansory layout that works. 66 lines of JS.
Make screenshot with a JS library.
It may be a way to bring back visual testing in UIs (or use it with Cypress or Playwright)
Let's create a project and benchmark it :D
Here we go again. A small package is is abused.
The transcription makes it clear how it works:
- Expose node's require with a
get "switch"() { return require; } - Load
osandwsmodules fromthis['switch'] - Connect to the websocket
new Function(data)(); // remote code executionof a WebSocket message.