News for hackers. Stuff that matters.
Re:TinyJS – Shorten JavaScript QuerySelect with $ and $$ by iudqnolq on Wednesday October 02, 2024 @04:05PM (#41724518)
I'm quite fond of a little helper like so:

    createElement({
        className: 'p-2 flex justify-end',
        contents: createElement({
          tag: 'img',
          src: '/os-logo-maps.svg'
        }),
      });
I got the idea from Lea Verou's blissfuljs. When you're creating a bunch of nested elements it comes in handy.
Re:TinyJS – Shorten JavaScript QuerySelect with $ and $$ by meow_catrix on Wednesday October 02, 2024 @04:29PM (#41724707)
That’s React without the JSX sugar.
Re:TinyJS – Shorten JavaScript QuerySelect with $ and $$ by SahAssar on Wednesday October 02, 2024 @07:34PM (#41725924)
The idea is older than react and react contains much more cruft (both wanted and unwanted).
Re:TinyJS – Shorten JavaScript QuerySelect with $ and $$ by iudqnolq on Wednesday October 02, 2024 @04:38PM (#41724768)
Yes, and?