Thoughts About My OSS

Photo by Sonja Langford on Unsplash

Update

As Independent Libraries Author

Are my libraries too small?

  • it’s easier to test and fully cover smaller libraries, and make these super reliable for the single purpose they’ve been created for
  • it’s easier to maintain smaller libraries that, if the previous point worked well, don’t actually need much maintenance in the long term
  • it’s easier to orchestrate multiple micro-libraries together, to produce this or that pattern in the best possible way … so
npx modulestrap --help

Is a community missing?

  • they asked me to create a @cgjs org to help developers contributing to this (at this time old and deprecated) project and, since I’ve done that, not a single contribution happened. It took a lot of time to put together all the modules in a monorepo structure, be sure everything would work, anyone could contribute and … crickets.
  • the @ungap org has 1 maintainer: me. Some of its polyfills is being used in @babel/core but this “should be an org” concept failed again.
  • they asked me to put a hyperhtml tag in Stack Overflow and yet they kept filing issues asking for help instead of using Stack Overflow, so that knowledge, issues, or solutions, were confined in the project’s repository, instead of becoming something to talk about in there.
  • they complained about hyperHTML lack of documentation, and it’s been literally one of the first link on top of the README. Mostly nobody read it, even if linked also in other similar libraries of mine, but I’ve got the “where’s the doc” complain. Don’t get me wrong, the documentation is nearly as good as the other libraries documentation you can find out there, but it’s surely better than the one I’ve provided for other projects, but then again, I was 100% focused on my Open Source projects at that time, while today I don’t have much time in general, and yet I document as I can in each README and, guess what, … most devs don’t read that neither.
  • I’ve ultimately tried to create boards around my libraries, but beside being a forum not super exciting 2020 “new community” format, not much is happening … should I twitter more with real examples? Should I post stuff in there and be a community by myself? I don’t know … but whatever different thing I should do would require time.
  • create a dedicated account for this or that project
  • create a decent site with docs and examples
  • talk about the library or the pattern you’re trying to promote
  • tweet, share, repeat

… and who should use my libraries, anyway?

Different Patterns

If you like React

import {Component, render, html, useState} from 'uland';

const Counter = Component((initialState) => {
const [count, setCount] = useState(initialState);
return html`
<button onclick=${() => setCount(count + 1)}>
Count: ${count}
</button>`;
});

// basic example, show two independent counters
render(document.body, () => html`
<div>
A bounce of counters.<hr>
${Counter(0)} ${Counter(1)}
</div>
`);

If you like React SSR

  • a static template literal based approach to create layouts only
  • a whole DOM world in the SSR, to do with components anything DOM could do, before creating layouts

If you like Vue.js or Svelte

<template is="uce-template">
<style scoped>
span { color: green }
</style>

<the-green>
The <span>{{thing}}</span> is green
</the-green>

<script type="module">
export default {
setup() {
return {thing: 'world'}
}
}
</script>
</template>

If you like Hooks/Vue.js reactive

  • µhooks-fx to propagate once changes as done in µland
  • µhooks-nofx to actually do nothing except returning initial values, as done in µland-ssr
  • µhooks-dom to automatically attach effects to returned nodes, also used in µland
// create reactive elements
const body = reactiveElement(
document.body,
{test: ''},
() => console.log('body.test', body.test)
);

body.test; // ""
body.test = 'value'; // body.test "value"

If you like Custom Elements

import {define} from 'uce';define('my-counter', {
init() {
this.count = 0;
this.dec = () => { this.count--; this.render(); };
this.inc = () => { this.count++; this.render(); };
this.render();
},
render() {
this.html`
<button onclick="${this.dec}">-</button>
<span>${this.count}</span>
<button onclick="${this.inc}">+</button>
`;
}
});

If you like “vanilla”

import {render, html, svg} from 'uhtml';
// const {render, html, svg} = require('uhtml');

render(document.body, html`<h1>Hello 👋 µhtml</h1>`);

If you like tool-less development

npx ucdn --help# debug pages and modules
# each refresh ensures no cache
npx ucdn --debug
import {render, html} from 'uhtml';

If you like tool-based solutions

Personal Conclusion

  • way too many new Web developers don’t learn HTML, CSS, and JS basics; they just start with something else they feel instantly productive with, or a must know tech to enter the market. I can’t blame them, but I also don’t understand how these developers believe they can succeed in the long term, but I wish they will, as being a developer is a constant learning experience, and it’s never too late to pick up the basics 👍
  • developers don’t care nearly enough about not using tools … and I guess I am old school here, but it’s really hard for me to imagine needing 500MB development dependencies to start a small to medium/big project
  • the market apparently doesn’t care much about people knowing the stack they work on, as long as they use “buzz-thingy” to show an “Hello World”. I come from different times, where you couldn’t find a job if you didn’t know the basics, but I’m nobody to change this trend and I’ll just acknowledge it.
  • if it’s not used, or promoted, by “Big Co” it’s not worth it. Here there’s literally nothing I can do about, except mentioning that some “Big Co” use one of my modules behind the scene, either as dependency or utility.
  • the “need for community” is half a myth: without marketing behind, nobody really cares about a community. They prefer copy/paste Stack Overflow solutions to crawl and they’ll rarely contribute to make the community around the topic, library, or project, better.
  • without time to dedicate to a variety of full-stack oriented projects, it’s hard to gain momentum and maybe start seeing a community around such projects … and time, for personal OSS projects, is never enough.
  • I won’t stop pushing forward the Web I dream about; I’ll keep experimenting my tool-less ideas, but I’ll also try to share more real-world / live examples, hoping this will help developers to better understand use cases they can solve through one of my dozen projects.

--

--

--

Web, Mobile, IoT, and all JS things since 00's. Formerly JS engineer at @nokia, @facebook, @twitter.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Writing CSV Files from other Files — For Data Science purpose.

Setup Git on WP Engine

OOP: Why use objects?

Using Coroutines in Unity

How to Pass the Machine Design and Materials PE Exam

Github Copilot, the AI we don’t want

Blue/Green Deployment of API Using AWS Lambda and API Gateway

BandChain GuanYu Testnet #4: Laozi Testnet #1 Launch & How to Join as a Validator

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Andrea Giammarchi

Andrea Giammarchi

Web, Mobile, IoT, and all JS things since 00's. Formerly JS engineer at @nokia, @facebook, @twitter.

More from Medium

An Example of Generalization

Cut a few braids: new NPM package

PDKit: Project as Code

How to pass a class to a function in TypeScript