this post was submitted on 27 Dec 2024
31 points (89.7% liked)

Programming

17695 readers
257 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 [email protected]



founded 2 years ago
MODERATORS
31
Functional Webcomponents (positive-intentions.com)
submitted 1 day ago* (last edited 1 day ago) by [email protected] to c/[email protected]
 

I'm creating a JavaScript UI framework for my own projects. It's a learning journey and I'd like to share my progress.

I've written some blog posts about my progress so far:

  1. Functional Web Components - https://positive-intentions.com/blog/dim-functional-webcomponents
  2. Functional Todo App - https://positive-intentions.com/blog/dim-todo-list
  3. Async State Management - https://positive-intentions.com/blog/async-state-management
  4. Bottom-up Browser Storage - https://positive-intentions.com/blog/bottom-up-storage

Note: The UI framework is far from finished. I want to share progress to see if there are any outstanding issues I'm overlooking.

top 6 comments
sorted by: hot top controversial new old
[–] [email protected] 6 points 1 day ago* (last edited 1 day ago) (3 children)

Ugh, please no. Please don't paint UI-elements via JS, if you're not forced to. It makes for a poor experience for most users, not to mention accessibility.

[–] [email protected] 1 points 4 hours ago

What are you considering as "paint[ing] UI-elements" in this context? I don't see anything I would describe as "painting" in the code snippets ay those links.

[–] [email protected] 10 points 1 day ago (1 children)

I spent a lot of time early in my career working on some UI component libraries that I ultimately deemed a failure. However, I learned a lot from that. I’ve found that as I’ve settled into a more senior dev role, it’s become harder for me to experiment.

What I’m trying to say is that best case, you come up with something cool, and worst case, you learn from your mistakes and apply what you learned to the next project!

[–] [email protected] 3 points 1 day ago (1 children)

Yeah, sure. But in case of a framework, people without that experience start using it wrong.

[–] lemmeBe 2 points 1 day ago

Yep. You should already know all the available tools at your disposal before embarking on creating something new. Then you'll also know best practices and if it makes sense creating something new and how to approach it.

[–] [email protected] 3 points 1 day ago

Thanks for input. I think it could still work without js-painting given that it's using the customElement.define().

I'm aiming for something that looks and behaves like react, but without the overhead of the react tooling for transpiling.