inautilo, to react
@inautilo@mastodon.social avatar

#Development #Explainers
HTML attributes vs. DOM properties · What fewer and fewer developers seem to know https://ilo.im/15ynz8


#Framework #React #Preact #Lit #VueJS #WebDev #Frontend #DOM #HTML #JavaScript

developit, to random
@developit@mastodon.social avatar

I have occasionally been asked why Preact's string renderer doesn't do scheduling and defaults to synchronous. Here's your reason (it's so fast that doing so is generally net-negative for both response time and throughput, making it undesirable by any metric)
#preact

nickautomatic, to react
@nickautomatic@mastodon.social avatar

Has anyone here got opinions about Preact vs React?

Specifically, I'm weighing up migrating a large-ish codebase to Preact instead of upgrading React, and I'd be interested to hear from anyone who a) has done this, b) has decided not to do this, c) can think of solid reasons to stick with React.

I can't see much benefit to choosing React over Preact, but is there anything I'm overlooking?

#preact #react #javascript

schizanon, to webdev
@schizanon@mastodon.social avatar

I built this POC to demonstrate how I'd use CustomEvents to implement Signals. Please criticize my approach and tell me why I need a native browser API for this.

https://card-calc.surge.sh/

#webDev #javaScript #signals #observable #frontend #customEvents #events #svelte #preact #rxjs

alexelcu, to react
@alexelcu@social.alexn.org avatar

#Preact, the light alternative to #React, doesn't require a build process, as it's using:

‣ tagged templates, instead of JSX;
‣ JavaScript modules.

This is the future of #JavaScript:
https://preactjs.com/guide/v10/getting-started#no-build-tools-route

#noBuildTools #op

MerriNet, to react
@MerriNet@mastodon.social avatar

Oh yeah, I'm doing it this week: I'm refactoring #Preact signals to a highly complex #React component.

The starting point is a component that currently takes in 26 props, and some of those props can be very complex.

And yes, that is somewhat poor original design considerations combined with 5 years of feature development on top of it. I already refactored lots of the internals 3 years ago for better functionality and performance.

prophyt, to webdev

Dear Dev Mastodon, I'm torn between Solid.js and Svelte for a small SPA project. I've done a lot of React dev so Solid seems familiar but I quite like the apparent simplicity of Svelte. Any opinions, advice, gotchas I should be aware of?

#WebDev #Dev #SolidJS #Svelte #SvelteJS

cdoremus,

@prophyt If you know , you might want to try , a lightweight, low-drama version of react. Jason Miller (@developit) - the creator of Preact -- is also active on Mastodon.

cassidoo, to random
@cassidoo@notacult.social avatar

I'm a lil annoyed at React these days

https://blog.cassidoo.co/post/annoyed-at-react/

jasonprogrammer,
@jasonprogrammer@mastodon.social avatar

@sangster @developit @cassidoo I love #Preact. It's tiny and easy to embed into anything. I'm currently building an MPA with #esbuild & #TypeScript and each page can be as simple or complex as I need it to be.

angelmunoz, to javascript

Is there an html tagged template library to render html on the server? I'm currently exploring @ lit-labs/ssr but I'd like to be aware of alternatives
Note: I don't need hydrate or client stuff, just a plain html string to string/stream/etc templating library

develwithoutacause,
@develwithoutacause@techhub.social avatar

@angelmunoz Maybe #htm? I think you can use that on the server like regular #Preact.

https://github.com/developit/htm

developit, to webdev
@developit@mastodon.social avatar
minioctt, (edited ) to web Italian

[⤴️ https://octospacc.altervista.org/2024/01/02/863]

Non so perché, avevo voglia di provare , allora l’ho provato, ma dopo un po’ ho iniziato a rendermi conto che stava uscendo lo spaghetto… ho continuato fin quando non sono usciti addirittura bug di cui non avevo la minima idea, e allora . Meglio fare come ho sempre fatto. 😩️

Nel le tecnologie sono così buone, non c’è bisogno di usare strani (tutti nati quando le tecnologie web non erano così buone, infatti) per … che non nego siano bellini, ma nella pratica non so perché non mi ci trovo, la mia mente sa riconoscere i pregi della non-imperativa, ma poi nella pratica se mi cimento fo il macello… 😶‍🌫️️

Commit Git "Redid app in vanilla JS, still not fully working, just saving code", c. +362 -189Redid app in vanilla JS. It’s so good.https://octospacc.altervista.org/2024/01/02/866/

nickautomatic, to react
@nickautomatic@mastodon.social avatar

Has anyone here switched a codebase from React to Preact?

I found switching the libraries themselves straightforward, but updating the test suite from React Testing Library to Preact Testing Library has me stumped - tests failing for reasons that are mysterious to me. At this point I'm keen to find anyone else who's attempted the same thing to compare notes...

#Preact #React #TestingLibrary

nickautomatic,
@nickautomatic@mastodon.social avatar

Specifically, the thing I'm stumped by is to do with the need to waitFor certain test assertions following the switch from React to #Preact.

If I wrap them in waitFor they pass but in some cases if I then await the waitFor (as I'm meant to, because it's an async function) they fail again.

develwithoutacause, to random
@develwithoutacause@techhub.social avatar

Playing a bit with #Preact / #JSX today and am feeling the pain of not having host elements. I've realized that because a "component" is really just a #VDOM template, there is no implicit contract around what it actually rendered.

As an arbitrary example, what if I want to set a style on a <Foo /> component? What selector should I use for that style? I have no idea what <Foo /> will actually generate, or even how many top-level elements it will output. The Foo component must expose some kind of className or other API to provide this behavior, it's not implicit at all.

Maybe this is good because it provides stronger encapsulation. But it can also lead to bugs. If I render <Header /> a header CSS selector is probably right. But what if <Header /> actually renders:

<div>
<header>...</header>
</div>

Then a header selector isn't actually the top-level element and my style could easily be wrong.

Just some idle thoughts about the lack of host elements.

vanilla, to webdev
@vanilla@social.spicyweb.dev avatar

Chris Coyier @chriscoyier presents some examples of using #JSX without React and talks about other flavors of JSX like @astro and even #Preact SSR:

https://thathtml.blog/2023/08/vanilla-jsx/

#WebDev #HTML

vanilla, to webdev
@vanilla@social.spicyweb.dev avatar

“React Is Not Modern Web Development”

@jaredwhite’s personal thoughts on a great entry by @collinsworth into the growing body of work which details why greenfield #WebDev projects are better served by other frameworks…or none at all.

https://thathtml.blog/2023/08/react-is-not-modern/

#React #JavaScript #frameworks #Preact #Svelte #Vue #SolidJS #LitElement

mai_lapyst, to webdev
@mai_lapyst@soc.saiyajin.space avatar

The most tiresome thing in is picking the techstack. So many choices to make: plain or a more restricive language like , which ofc is often depending on the overall frontend framework to use: , , , ?

Or do one completly deviate from the classical way and use rather a techstack via , such as with ?

So many questions to answer and that still is only the js side of things, you then have to think about your css framework (if you want to use something like ), your font choices, and ofc if and what styling library you actually use ontop of our frontend framework; e.g. , , .io and so on.... which also often depends on your framework of choice!

ConstelLeav, to react

I just learned Signals in Preact recently. It's so convenient to use that I'm thrilled to try it immediately. It greatly reduces the mental burden when writing code in React/Preact and usually has better performance.

manlycoffee, to CSS
@manlycoffee@techhub.social avatar

Why don't some people like CSS-in-JS?

Is it because code written in CSS-in-JS don't allow you to take advantage of the "cascading" nature of CSS?

Is it because you can't take advantage of selectors?

Is it because there might be some compilation steps required when employing CSS-in-JS? And if compilation isn't used, there might be some render-time slowdown?

?

  • All
  • Subscribed
  • Moderated
  • Favorites
  • JUstTest
  • everett
  • DreamBathrooms
  • Durango
  • InstantRegret
  • ngwrru68w68
  • magazineikmin
  • mdbf
  • thenastyranch
  • Youngstown
  • slotface
  • cubers
  • kavyap
  • khanakhh
  • megavids
  • cisconetworking
  • tacticalgear
  • osvaldo12
  • ethstaker
  • modclub
  • rosin
  • tester
  • anitta
  • normalnudes
  • GTA5RPClips
  • Leos
  • provamag3
  • lostlight
  • All magazines