Advertisement · 728 × 90

Posts by Daniele

How to use Web Components, and why you'd want to
How to use Web Components, and why you'd want to YouTube video by Kevin Powell

Oh look @michaelwarren.dev with @kevinpowell.co on one of my favorite topics — web components!

youtu.be/qUhtlnL48yA?...

5 months ago 37 8 0 0
Preview
Tooltip Components Should Not Exist A look at why tooltip components are often the wrong abstraction in design systems, leading to accessibility issues, misuse, and inconsistent user experiences.

📚 I haven’t written much at all about the “front of the front-end” on my blog, but since I’m now working on the design engineering team @sentry.io and also maintained the design-system at adverity for some time, I have opinions there as well 😬:

5 months ago 60 7 11 2

Whoa. This would be incredible for frameworks like Astro. Enough to make me reconsider my dream of removing streaming support.

4 months ago 7 1 2 0

Finally.

5 months ago 0 0 0 0
Preview
Announcing Vitest 4.0 Vitest 4.0 is released with Browser Mode being marked stable, Visual Regression testing support, and Playwright Trace support. The Vitest team will focus on performance improvement in the upcoming…

✅Announcing Vitest 4.0 ✅

Our latest Vitest update brings Browser Mode to stable, allowing you to test your UI in real browsers like Chrome.

Also new:

- Visual Regression Testing to catch unintended UI changes
- Playwright Trace support for easier debugging

voidzero.dev/posts/announ...

5 months ago 92 9 1 0
Preview
Devfest Pescara 2025 Join us in Pescara, IT for our conference. Featuring distinguished speakers, workshops, and lots of fun in between. See you there!

Quest’anno é stata una gioia realizzare grafica e sito di devfest.gdgpescara.it !!!

#devfest #pescara #gdg

6 months ago 0 0 0 0
// -- old way
export function useMyContext() {
    const context = useContext(MyContext);
    if (context === undefined) {
        throw new Error(
            'useMyContext must be used within a MyContext Provider'
        );
    }
    return context;
}

// -- new way
export function useMyContext() {
    //          ^^^ Ehi, naming is misleading here, it's not an actual hook!
    const context = use(MyContext);
    if (context === undefined) {
        throw new Error(
            'useMyContext must be used within a MyContext Provider'
        );
    }
    return context;
}

// -- old way export function useMyContext() { const context = useContext(MyContext); if (context === undefined) { throw new Error( 'useMyContext must be used within a MyContext Provider' ); } return context; } // -- new way export function useMyContext() { // ^^^ Ehi, naming is misleading here, it's not an actual hook! const context = use(MyContext); if (context === undefined) { throw new Error( 'useMyContext must be used within a MyContext Provider' ); } return context; }

Question for React devs: With the new use API, which isn't a hook, how are you naming your context-consuming functions?

The classic useMyContext pattern feels odd if the function is just a wrapper for use(MyContext). Does it still count as a hook, or are you using a new naming scheme?

#ReactDev

7 months ago 0 0 0 0

Io mi immagino che drop hanno avuto siti come quello di Aranzulla.

Fintanto che parliamo di siti di news dove è naturale che la diffusione parta dalle piazze (i social) è ok, ma quelli che vivevano di traffico passivo ora si ritrovano tutto su un riassuntino di qualsiasi AI e questo è un guaio

7 months ago 0 0 0 0
Preview
Ricky 🦋 on X: "@samselikoff @ryanflorence @BrooksLybrand @vitormarkisdev Here's an example of what I mean, this is a more realistic cart where changing the cart information (quantity) transitions to a new cart total. The item total and cart total each update async. Take a second to think of what should happen if you increase the quantity. https://t.co/YXhWNuaawB" / X @samselikoff @ryanflorence @BrooksLybrand @vitormarkisdev Here's an example of what I mean, this is a more realistic cart where changing the cart information (quantity) transitions to a new cart total. The item total and cart total each update async. Take a second to think of what should happen if you increase the quantity. https://t.co/YXhWNuaawB

I heard some complaints about React batching transitions (mostly on twitter), so I jumped over to the bad place and explained why batching transitions by default is good actually:

x.com/rickhanlonii...

7 months ago 21 2 4 1

Chissà quanto ci vorrà prima che arrivino anche da noi visto che i nostri fondali si stanno tropicalizzando. Qualche giorno fa ho visto un vermocane (coste di Palermo)

7 months ago 3 0 0 0
Advertisement

it seems an old stuff, isn't? (main is far behind)

10 months ago 1 0 1 0
Preview
Chi controlla le informazioni, controlla il potere Dalle multinazionali al remote working, come le reti di comunicazione determinano chi emerge — e chi resta invisibile

danieleirsuti.dev/blog/chi-con...

10 months ago 1 0 0 0
Preview
La mossa 37: il cammino verso l’irrilevanza La Mossa 37 non è solo un trionfo dell'AI: è l’inesorabile cammino verso l’irrilevanza dell’essere umano

Alla fine ho scritto un post sull'IA anch'io

danieleirsuti.dev/blog/la-moss...

11 months ago 1 0 0 0
Preview
Come ho smesso di sentirmi inadatto (grazie a una community) Ho sempre lottato con la sindrome dell’impostore, ma una community di programmatori mi ha mostrato che il vero valore è nel confronto e nella crescita

danieleirsuti.dev/blog/come-ho...

1 year ago 0 0 0 0
Preview
Vitest Next generation testing framework powered by Vite

Soft assertions. main.vitest.dev/api/expect.h...

1 year ago 16 1 3 0

This doesn't feel right to me because it's overriding the entire Location class and "window.open" at a global level. 🤔

Is this a bad practice? Any insights from test experts?

1 year ago 0 0 0 0
const mockAssign = vi.fn();
const mockOpen = vi.fn();

beforeEach(() => {
    Object.defineProperty(window, 'location', {
        configurable: true,
        value: {
            ...window.location,
            assign: mockAssign,
        },
    });

    Object.defineProperty(window, 'open', {
        ...window.open,
        configurable: true,
        writable: true,
        value: mockOpen,
    });
});

afterEach(() => {
    vi.restoreAllMocks();
});

const mockAssign = vi.fn(); const mockOpen = vi.fn(); beforeEach(() => { Object.defineProperty(window, 'location', { configurable: true, value: { ...window.location, assign: mockAssign, }, }); Object.defineProperty(window, 'open', { ...window.open, configurable: true, writable: true, value: mockOpen, }); }); afterEach(() => { vi.restoreAllMocks(); });

Today, I came across this small piece of code for mocking, but I'm not sure if it's a good approach.
The environment is #JSDOM, and the testing tool is #Vitest.

The purpose of this test is to mock "window.location.assign" and "window.open"

Test experts, help.

1 year ago 0 0 1 0
Advertisement

feel you. I tried to upgrade to version 4 in my Astro blog a few days ago, and it worked beautifully in dev but not in prod and all CSS modules disappears for some reason

1 year ago 2 0 0 0
Preview
La demonizzazione di JavaScript JavaScript è una barzelletta di linguaggio, dovresti impararne uno vero per poterti definire programmatore

Sviluppare applicazioni web frontend è difficile, stare al passo con le novità è stressante e JavaScript è sempre il problema.
C'è del vero: dovremmo rivedere il modo in cui lo utilizziamo oggi.

danieleirsuti.dev/blog/la-demo...

1 year ago 2 0 0 0

Maybe because most influent JS people are tech bros who likes Musk and his enlightened vision of the world.

I don't miss that place, less contents but more quality than noise

1 year ago 0 0 0 0

Nowadays it’s hard to imagine an endpoint without openapi spec but sadly it happens… very often.

Anyway, this is readable, I like it!

1 year ago 0 0 0 0

These people don’t look beyond their own garden.

Sometimes I think about how we (as collectivity) ended up like this

1 year ago 0 0 0 0
`vite build` produces incorrectly flattened nested CSS · Issue #18974 · vitejs/vite Describe the bug When using modern CSS with nesting, a production build will generate invalid CSS. Given the following CSS: .foo { :where(& > .bar) { color: red; } } In a production build, this is ...

oof github.com/vitejs/vite/...

1 year ago 0 0 0 0

I'm sure is related to css modules but I'm lost 🤷‍♂️

1 year ago 1 0 0 0
Preview
Daniele Irsuti, frontend developer Specializzato in applicazioni React, React Native, JS vanilla

Just updated my website to #astro 5.2.3 and #tailwind 4.0.3 and my css blew up 🤔
Locally it works but in production... well, not good. No clues what's happening.

live: danieleirsuti.dev
old build: danieleirsutidev-jqrie8cj8-daniele-irsutis-projects.vercel.app

1 year ago 0 0 2 0
Blame Canada - South Park: Bigger Longer & Uncut (3/9) Movie CLIP (1999) HD
Blame Canada - South Park: Bigger Longer & Uncut (3/9) Movie CLIP (1999) HD YouTube video by Movieclips

America RN: youtu.be/bOR38552MJA?...

1 year ago 0 0 0 0

it's time to shine.

now in cubital characters: D E P R E C A T E D 👀

1 year ago 2 0 0 0
Advertisement

We can’t be friends with nazis I guess 🤷‍♂️

Sorry, I couldn’t resist

1 year ago 4 0 0 0

Dear frontend users: Stop using the "custom" prefix when you have no ideas on how to name things, like:

Custom component;
customClass;
custom date;

Stop it.
Thank you.

1 year ago 0 0 0 0
Post image

ah this works

1 year ago 4 1 2 0