nowfound

Dev tools · September 4, 2024

AB

A better way of writing HTML via JavaScript?

Although I've been using React for at least 5 years now, I don't quite like frameworks. For personal projects I sometimes use web component but they can be over kill depending on what you are trying to achieve. I do like JSX though. I think it's quite neat to be able to write HTML inside of JavaScript code. With that in mind, I've been trying to come up with a way to better create HTML dynamically. Something along the lines of: const req = await fetch('api.com/posts') const data = await req.json() for (const d of data) createPost(d) For that, I end up writing this piece of code const…

A better way of writing HTML via JavaScript? launched on September 4, 2024 with 7 votes, #1,891 of 5,281 launches that month and more than 75% of that year's launches.

What it does

In the maker’s words, at launch

Although I've been using React for at least 5 years now, I don't quite like frameworks. For personal projects I sometimes use web component but they can be over kill depending on what you are trying to achieve. I do like JSX though. I think it's quite neat to be able to write HTML inside of JavaScript code. With that…

Does a similar job

all alternatives →
  • HTML to React2024 · ▲572

    Turn a design from any website into your own

  • UG
    Use Go's HTML/template to write React-like code2024 · ▲106

    Hi all, I'm currently working on my hobby project, and one of the fun constraints I put in was to build using as less dependencies as possible. I chose Go as it has a really good standard library, and all went well for building backend. But for frontend, I was wondering whether I should break the constraint and go for React. I tried options like Web Components, but I really didn't like the ergonomics and I didn't want to use jQuery either. Out of curiosity, I was exploring Go's html/template package to see if I can write UIs in a React-like manner. I found most of the online docs using…

  • HTML to JSX2023 · htmltojsx.vercel.app · ▲104

    Convert your HTML to JSX instantly

  • Convert any website into a React component2024 · chromewebstore.google.com · ▲326

    Hey HN, we built a Chrome Extension (https://www.magicpatterns.com/extension) that converts a snippet of any website to an isolated React component. Demo video: https://youtu.be/hutUYDkyE_A How it works: 1) Iterate through each node in the selected DOM tree, 2) For each element, find any matching CSS selectors / inline styles, 3) Use window.getComputedStyle to get the deterministic values, 4) Construct JSX It was pretty hard producing the minimal code necessary while maintaining the same visual look. To do this, we implemented things like abstracting out…

  • IM
    I made React with a faster Virtual DOM2022 · ▲109

    Hi! I made a React compatibility library for a Virtual DOM library (https://github.com/aidenybai/million). The idea is to have much faster rendering (a compiler optimizes virtual DOM beforehand) while ensuring the same developer experience React provides. This is very, VERY early stage, so be prepared for weird bugs / plugin incompatibility / etc. If you have any suggestions, I'd be more than happy if you replied in a comment with it! You can spin up the demo here >> https://stackblitz.com/github/aidenybai/million-react-compat

  • Quarkly2020 · quarkly.io · ▲184

    Design tool to create sites & web apps on React

More dev tools this month

the category →
  • /dev/null▲486

    a social network for devs

    Dev tools · 3d ago · dev-null.sh

  • open-source IDE for thoughtful software design. Contribute to devdotfast/whiteboard development by creating an account on GitHub.

    Dev tools · 28d ago · github.com

  • Contribute to reladraw/reladraw development by creating an account on GitHub.

    Dev tools · 26d ago · github.com

  • OpenBot▲362

    Grok Bot alternative: free, local, open-source, multiplayer

    Dev tools · 23d ago · openbot.run

  • Talanoa▲346

    Hi HN, I’m a fullstack developer, and honestly, I’ve lost count of how many side projects I’ve worked on over the years. But one idea kept coming back to me: a different kind of email client. It first came to me in 2014: “What if we could handle emails more like conversations?” Every year, I’d revisit this concept in my “Build Notes.” Ten years later, no one had built exactly what I had in mind — so I finally decided to do it myself. That’s how Talanoa was born. I wanted something focused on people, not timelines. I was tired of marking messages as unread just to remember to reply later, or…

    Dev tools · 21d ago · talanoa.email

  • CoreSpeed▲332

    One MCP for everything your agents need: apps, memory, tools

    Dev tools · 28d ago · corespeed.io

Source: Show HN post ↗ · launch text quoted in part

Launched alongside, September 2024

the whole month →
  • Wispr Flow▲2,732

    Speak naturally, write perfectly & 3x faster in every app

    AI · 2024 · wisprflow.ai

  • Pathway▲1,335

    Get user insights 10x faster

    Work · 2024 · wynde.io

  • Personalized AI daily planning that suits your life

    AI · 2024 · beforesunset.ai

  • Osmos▲1,194

    Match with like-minded professionals for 1:1 conversations

    Growth · 2024

  • Carrot Care▲1,168

    Understand & optimise your bloodwork

    Life & fun · 2024 · carrotcare.health

  • Polar▲1,167

    An open source monetization platform for developers

    Dev tools · 2024 · polar.sh