vrugtehagel / yozo

A custom element library for simple, robust and readable components
https://yozo.ooo
5 stars 0 forks source link
library no-build tiny web-components yozo

YOZO

Website: yozo.ooo \ Website repository: vrugtehagel/yozo.ooo

This is the main repository for Yozo, the tiniest no-build developer-first Web Components library.

[!IMPORTANT] The website documents all of Yozo's features in detail. This README instead describes the codebase, for those looking to fork it and/or contribute.

Getting started

To do any development on Yozo, first make sure you have Deno installed. Then, there are three tasks available:

About the codebase

I know this codebase is not the most readable; it is intricate (robust, but fragile) and designed to be small when compressed. Oddly enough, sometimes, more code results in a smaller bundle size. That's why there are comments sprinkled all over the place, to try and help any brave souls trying to understand what's really happening.

Some practical notes:

Tests

Tests are run using deno task test (or, if you prefer, deno test --allow-read).

Tests are written in a bit of an unconventional way, because we want to be able to run them in the browser. Essentially, we've got one test per file, all under test/, in the same structure as the documentation pages. Inside tests, there's a global function assert available that just throws when it receives a falsey argument (which then fails the test). We also have browser-only tests here, which Deno can't run, but they are included in test suites on the website regardless (where they are run). They may include .yz files; all these tests are to be uploaded to the documentation site, so the tests can register them like normal. They do need to follow their respective test's filename; this is done so the documentation site can see whether a test has a component or not by simply scanning the file system rather than having to analyse the test's code.

How things go around here

There's the main branch, where the latest version of Yozo lives. There's also canary, where changes to Yozo are gathered until they are released as a new version and pushed to main. In the mean time, other changes (like adding tests) may be merged into main without going through canary. As for versioning and releasing, currently there are no plans to use GitHub's "releases" feature, in favor of yozo.ooo/download/.