IMPORTANT DISCLAIMER: This is my own project. I am using AI. Its important to get that out of the way… because its the key reason for why YOU SHOULD NOT USE IT. Im not trying to promote “yet another secure messaging app”, this is an example to see what is possible with a related UI framework im working on ( https://github.com/positive-intentions/dim ). Its unreviewed, unaudited and far from finished. This framework is intended for myself on my own projects. It is provided open-source for transparency, testing and demo purposes only. There will be breaking changes.

The key details that set this approach apart:

  • No minification or transpilation
  • No React, NPM or bundler
  • Works from index.html

The architecture is also a bit unique. Module federation has been around for a while but still fairly under-used. Im aiming for something that could be described as like a vanilla JS “decentralized microfrontend architecture”, where in this approach, i can abstract complexity into seperate repositories to manage reusble functionality like in the boilerplate example:

To avoid vibecoded cryptography, the aim here is to avoid handling encryption where appropriate. Browsers that support webrtc, will have their own mechanisms for managing encryption (as required by the spec). The keys will not be accessible from app-level JS code. For security best-practice, users should use an OS, browser and network they trust.

To make something complicated at scale, i would need to have an approach for testing out changes in a way thats more isolated/focused. The npm ecosystem is useful because you can have things like storybook, unit-testing and browser automation tools. So i wanted to see what is possible with the pure javascript approach and created runTests.html. Like the main app, the code is just plain javascript and so it can be imported and tested with production statics. The testing functionality here is especially far from finished. This is an important feature to do it properly because it would be doing a lot of heavy lifting as the project improves.

P.S. The disclaimer above is always worth repeating. Im aiming for a post like this to be like “building in public”. If interesting to anyone, i hope its inviting to take a look. It’s hard to determine if / when its a good time to share, so best to get it out there sooner for any outstanding issues i may have overlooked.

  • duckduckduck@programming.dev
    link
    fedilink
    arrow-up
    1
    ·
    7 hours ago

    I mean if that’s what works for you then that’s what works for you. I’m sure it’s great.

    Have you used React vs HTML+templating vs plain HTML lately? I’ve done my time in the full-stack mines, so I know React can really flow, especially with some nice convention-heavy frameworking.

    However, based on more recent personal experience, I respectfully disagree that it’s always worth it to use React (or even any javascript/typescript) over just handbombing your own lighter weight solution. If we’re talking a SaaS trying to scale for a venture exit, sure, but that’s not every use case.

    • CookieOfFortune@lemmy.world
      link
      fedilink
      arrow-up
      2
      ·
      6 hours ago

      What was your recent personal experience?

      And my argument isn’t that you need to use React, it’s just that:

      1. HTML is gets limited quite quickly. But sure if you’re just displaying static information it’s probably fine.
      2. Once you try to escape the limitations of HTML, React is one of the better options (considering also historical solutions).

      I’m not one to discourage self exploration but there’s a reason the production pipeline is what it is.

      • duckduckduck@programming.dev
        link
        fedilink
        arrow-up
        1
        ·
        3 hours ago

        … there’s a reason the production pipeline is what it is.

        Yeah if you’re thinking about “production” we’re talking way past each other. I’m specifically talking about applications outside of the scale that the world of work targets. For what most people are building, React is bloat.

        My experience is based on programming for work, contrasted with hobby web dev, and how much more fun and direct the latter is. Most people don’t need to “escape the limitations of HTML” they just assume they do.

        Have you tried to serving plain HTML files lately? There’s something magical about it.