- About: On 12-Jan-2025, the author presents "boreDOM", a new JS framework created out of boredom. Its main motivation is to have a simple DOM manipulation framework that can fit the scenario of having HTML in.html files, CSS in.css files, and JS in.js files, reusing existing HTML nodes with a small JS footprint.
- The idea: Use
<template>
elements with adata-component
attribute to register custom element tags. The framework reads these attributes and stamps the template content as needed. - The logic: A matching.js file can be set with a
<script>
tag. This file is imported dynamically and exports functions for component connection and rendering. It also supports helper attributes likeon
for handling custom events. - A simple counter: Slots are supported through the
.slots
attribute. A simple counter example shows how to handle events to increase or decrease the counter value and set the slot value. - Some particularities: It brings features like references to elements through
data-ref
attributes, shadow-dom support, passingaria-*
androle=*
attributes, creating components in JS, batching renders, being typed with JSDoc, and a comprehensive test suit. - Conclusion: The author is happy if the framework is useful to others. There is also a ranty webpage for more information. A caveat is that component JS code being imported dynamically makes it hard to use bundlers or non-standard tech before laying out UI components.
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。