Friday Issue Nr.109

2024-04-26

back

What a time to live! CSS can detect JS, and Node, PNPM, and Astro have new versions. Interesting idea about Masonry for CSS and a good post about HTML vs DOM attributes.

JavaScript News

JSR is not another package manager

Post from Ryan Dahl (Creator of Node.js and Deno)

https://deno.com/blog/jsr-is-not-another-package-manager

Find that copy-pasted code

Also, IDE (at least Webstorm) automatically shows copy-pasted code.

https://github.com/kucherenko/jscpd

Detect JavaScript support in CSS

Remember those days when you added the CSS class “no-js” in the body tag, and once JS was loaded, it would remove “no-js” so you could use other styles? Well, now you don’t need to do that.

1
@media (scripting: enabled) {
2
  .my-element {
3
    /* enhanced styles if JS is available */
4
  }
5
}

https://ryanmulligan.dev/blog/detect-js-support-in-css/

Node.js 22

https://openjsf.org/blog/nodejs-22-available

PNPM v9.0.0

https://github.com/pnpm/pnpm/releases/tag/v9.0.0

Interesting facts about latency numbers

https://vercel.com/blog/latency-numbers-every-web-developer-should-know

Astro 4.7

https://astro.build/blog/astro-470/

CSS News

CSS Shape

Collection of Shapes made with CSS.

https://css-shape.com/

CSS Masonry

We have Display: block, inline, flexbox, and grid. Maybe there is a way to add something like Waterfall or Masonry. Jen Simmons wrote amazing post about this.

https://webkit.org/blog/15269/help-us-invent-masonry-layouts-for-css-grid-level-3/

HTML attributes vs DOM properties

Here is example from the article:

1
<div foo="bar"></div>
2
<script>
3
  const div = document.querySelector('div[foo=bar]');
4

5
  console.log(div.getAttribute('foo')); // 'bar'
6
  console.log(div.foo); // undefined
7

8
  div.foo = 'hello world';
9

10
  console.log(div.getAttribute('foo')); // 'bar'
11
  console.log(div.foo); // 'hello world'
12
</script>

https://jakearchibald.com/2024/attributes-vs-properties/

Mixed News

The Front-end Handbook 2024

https://frontendmasters.com/guides/front-end-handbook/2024/

Hardest Problem in Computer Science: Centering Things

If you like UI/UX you will love this post too.

https://tonsky.me/blog/centering/

Comment on Mastodon

Andris Švarcs

Somehow, I've survived over 15 years as a web developer without losing my interest in the craft. Quite the opposite, with so many great improvements in the Web standards, what was nearly impossible now is easy to make.

My career has been a wild ride through small agencies and big corporations, building everything from finance apps to health dashboards.

I'm that annoying person who needs to understand products beyond just slinging code. I ask questions like 'Why is this feature important?' and 'How will this improve the customer journey?' – you know, the kind of questions that make project managers reach for the pint aspirin. This curiosity has led me down the rabbit holes of design, accessibility, and SEO. Because apparently, making websites pretty, usable, and findable wasn't challenging enough on its own.

P.S. If this bio sounds too polished, blame my evil AI twin. I'm still working on teaching it sarcasm.

Copyright © since 2021, Andris Švarcs. All rights reserved.

Lets connect

bluesky

youtube

linkedin