ReactJS-like Framework with Web Components (dim.positive-intentions.com)
from xoron@programming.dev to programming@programming.dev on 04 Jun 11:57
https://programming.dev/post/31603302

Introducing Dim – a new framework that brings React-like functional JSX-syntax with JS. Check it out here:

🔗 Project: github.com/positive-intentions/dim

🔗 Website: dim.positive-intentions.com

My journey with web components started with Lit, and while I appreciated its native browser support (less tooling!), coming from ReactJS, the class components felt like a step backward. The functional approach in React significantly improved my developer experience and debugging flow.

So, I set out to build a thin, functional wrapper around Lit, and Dim is the result! It’s a proof-of-concept right now, with “main” hooks similar to React, plus some custom ones like useStore for encryption-at-rest. (Note: state management for encryption-at-rest is still unstable and currently uses a hardcoded password while I explore passwordless options like WebAuthn/Passkeys).

You can dive deeper into the documentation and see how it works here:

📚 Dim Docs: positive-intentions.com/docs/category/dim

This project is still in its early stages and very unstable, so expect breaking changes. I’ve already received valuable feedback on some functions regarding security, and I’m actively investigating those. I’m genuinely open to all feedback as I continue to develop it!

#programming

threaded - newest

TCB13@lemmy.world on 04 Jun 14:09 next collapse

📦 Zero Dependencies - Pure JavaScript, no build step required

This is really the best part. However the example does run a npm run build…

I would be great to have something that can be imported in a script tag like jquery and not something that requires npm and compilarion.

xoron@programming.dev on 04 Jun 14:20 collapse

thanks. thats what id like to aim for and i dont think its far off. the build script there is mainly for the storybook statics (as seen in the link provided for “website”).

couple things i hope to do soon, remove lit as a dependency - i use this right now because its useful for template rendering and lifecycle methods. webcomponents have a an ugly approach to this which Lit makes easier, and so i pushed it back, but its still on the todo.

after that i should be able to have a more vanilla web dx.

TCB13@lemmy.world on 04 Jun 20:13 collapse

The problem with compiled JS is that it doesn’t last long. Any piece of software written in the popular frameworks will probably not compile in 5 years because xyz dependency. There might be ways around it, but all annoying and not good. Some type of software really needs more assurances that “might compile in 5 years” because some people can’t afford to upgrade to the latest framework down the path due to size or simply lack of time.

Solemarc@lemmy.world on 05 Jun 13:00 collapse

A new JS framework! Time to reset the clock!

In all seriousness though, congrats, you’re already a lot further than most people ever get. I approve of this trend to reduce bundle size as much as possible that we’ve been moving towards.