3
Functional Web Components (mastodon.social)
submitted 2 weeks ago* (last edited 2 weeks ago) by xoron@mastodon.social to c/programming@programming.dev
top 9 comments
sorted by: hot top controversial new old
[-] refalo@programming.dev 1 points 2 weeks ago* (last edited 2 weeks ago)

I can see how there might be usecases for stuff like this in big enterprise developments that change their design often and/or have lots of different departments of people working on the site, but in all the webdev I have ever done myself in my almost 30 years of work in it, I have never had any need for more than hand-written html, css and javascript. That and simple template systems like django/jinja have worked quite well for me and always perform far better than these big frameworks.

[-] wake_up@lemmy.world 1 points 2 weeks ago

Hey there! Just checked out Dim and gotta say, awesome job! It's super cool to see functional web components in action, and your todo list app is both sleek and practical. Love how you laid out the project on GitHub too, really easy to follow.

I'm curious, what inspired you to create Dim in the first place? Also, any tips for someone new to web components? Keep up the great work, looking forward to following your updates!

[-] xoron@mastodon.social 1 points 2 weeks ago

@wake_up

as for tips for somone new to webcomponents, i think its good to take a look at resources online. i dont know enough to suggest any.

i found that after trying it myself, creating something with vanilla webcomponents was a bit of a pain (and the code looks ugly). so its only natural to lean towards something like Lit or Vue for larger projects.

personally, webcomponents seem cumbersome and thats why i wanted to see if Dim was possible. its an attempt to reduce the complexity.

[-] xoron@mastodon.social 1 points 2 weeks ago* (last edited 2 weeks ago)

@wake_up

thanks! im glad you like it :)

> what inspired you to create Dim in the first place?

working with Lit felt a bit like a step backwards when coming from React. the React syntax just seems more elegant to me so i wanted to see if i could do it with webcomponents.

im aiming to see if i can get something that looks and behaves like React, but works natively in a browser without the need to build or transpile. i think in theory it could work.

[-] umt@lemmynsfw.com 1 points 2 weeks ago
[-] TehPers@beehaw.org 2 points 2 weeks ago

The previous article in the series has a couple paragraphs at the start to introduce the idea and why:

Modern JavaScript frameworks like React JS and Vue JS have popularized the functional programming paradigm and declarative approaches to web app development. While these frameworks have made creating dynamic web applications more accessible, it's worth exploring the potential of web components in this landscape.

To me it seems more like an exploration and PoC for the purposes of learning than a real alternative to any particular frontend library, but that's just my interpretation. The subject is interesting anyway, even if I won't do this myself in a real world project at work.

[-] xoron@mastodon.social 2 points 2 weeks ago

@TehPers @umt

> PoC for the purposes of learning

yeah thats right.

i want to see if creating some kind of thin-transparent-wrapper like this, could make it so i dont have to update it as a dependencies. consider that we recently got react 19. this will be followed by a scramble by many to use the latest and most stable version.

i cant guarantee any stability in my current progress, but in theory, by relying on the underlying web component from the browser, it becomes future-proof.

[-] xoron@mastodon.social 2 points 2 weeks ago

@umt

Elm is good.

For this project I specifically wanted to use web components, but in the style of React.

There is no practical use case for this "UI framework". It's a personal learning process.

[-] umt@lemmynsfw.com 1 points 2 weeks ago

Cool. Learning is good.

this post was submitted on 29 Sep 2024
3 points (80.0% liked)

Programming

17213 readers
155 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



founded 1 year ago
MODERATORS