Skip to content

Commit

Permalink
[add] VNode unRef() callback
Browse files Browse the repository at this point in the history
[optimize] reuse similar Deleting DOM nodes instead of Creating ones
[fix] Empty & Text children updating
[migrate] replace David-DM.org with Libraries.io for Dependency badge
  • Loading branch information
TechQuery committed Aug 4, 2023
1 parent ea506db commit 325e808
Show file tree
Hide file tree
Showing 8 changed files with 130 additions and 67 deletions.
31 changes: 20 additions & 11 deletions ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@

A light-weight DOM Renderer supports [Web components][1] standard & [TypeScript][2] language.

[![CI & CD](https://github.com/EasyWebApp/DOM-Renderer/actions/workflows/main.yml/badge.svg)][3]

[![Open in GitPod](https://img.shields.io/badge/GitPod-dev--now-blue?logo=gitpod)][4]
[![NPM Dependency](https://img.shields.io/librariesio/github/EasyWebApp/DOM-Renderer.svg)][3]
[![CI & CD](https://github.com/EasyWebApp/DOM-Renderer/actions/workflows/main.yml/badge.svg)][4]

[![NPM](https://nodei.co/npm/dom-renderer.png?downloads=true&downloadRank=true&stars=true)][5]

[![Open in GitPod](https://img.shields.io/badge/GitPod-dev--now-blue?logo=gitpod)][6]

## Usage

### JavaScript
Expand Down Expand Up @@ -38,7 +39,7 @@ console.log(newVNode);

### TypeScript

[![Edit DOM Renderer example](https://codesandbox.io/static/img/play-codesandbox.svg)][6]
[![Edit DOM Renderer example](https://codesandbox.io/static/img/play-codesandbox.svg)][7]

#### `tsconfig.json`

Expand All @@ -65,21 +66,29 @@ const newVNode = new DOMRenderer().render(
console.log(newVNode);
```

## Framework

### Web components

[![Edit MobX Web components](https://codesandbox.io/static/img/play-codesandbox.svg)][8]

## Original

### Inspiration

[![SnabbDOM](https://github.com/snabbdom.png)][7]
[![SnabbDOM](https://github.com/snabbdom.png)][9]

### Prototype

[![Edit DOM Renderer](https://codesandbox.io/static/img/play-codesandbox.svg)][8]
[![Edit DOM Renderer](https://codesandbox.io/static/img/play-codesandbox.svg)][10]

[1]: https://www.webcomponents.org/
[2]: https://www.typescriptlang.org/
[3]: https://github.com/EasyWebApp/DOM-Renderer/actions/workflows/main.yml
[4]: https://gitpod.io/#https://github.com/EasyWebApp/DOM-Renderer
[3]: https://libraries.io/npm/dom-renderer
[4]: https://github.com/EasyWebApp/DOM-Renderer/actions/workflows/main.yml
[5]: https://nodei.co/npm/dom-renderer/
[6]: https://codesandbox.io/s/dom-renderer-example-pmcsvs?autoresize=1&expanddevtools=1&fontsize=14&hidenavigation=1&module=%2Fsrc%2Findex.tsx&theme=dark
[7]: https://github.com/snabbdom/snabbdom
[8]: https://codesandbox.io/s/dom-renderer-pglxkx?autoresize=1&expanddevtools=1&fontsize=14&hidenavigation=1&module=%2Fsrc%2Findex.ts&theme=dark
[6]: https://gitpod.io/#https://github.com/EasyWebApp/DOM-Renderer
[7]: https://codesandbox.io/s/dom-renderer-example-pmcsvs?autoresize=1&expanddevtools=1&fontsize=14&hidenavigation=1&module=%2Fsrc%2Findex.tsx&theme=dark
[8]: https://codesandbox.io/s/mobx-web-components-pvn9rf?autoresize=1&fontsize=14&hidenavigation=1&module=%2Fsrc%2FWebComponent.ts&moduleview=1&theme=dark
[9]: https://github.com/snabbdom/snabbdom
[10]: https://codesandbox.io/s/dom-renderer-pglxkx?autoresize=1&expanddevtools=1&fontsize=14&hidenavigation=1&module=%2Fsrc%2Findex.ts&theme=dark
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dom-renderer",
"version": "2.0.0-rc.5",
"version": "2.0.0",
"license": "LGPL-3.0-or-later",
"author": "shiy2008@gmail.com",
"description": "A light-weight DOM Renderer supports Web components standard & TypeScript language",
Expand Down Expand Up @@ -29,7 +29,7 @@
},
"devDependencies": {
"@types/jest": "^29.5.3",
"@types/node": "^18.17.1",
"@types/node": "^18.17.2",
"husky": "^8.0.3",
"jest": "^29.6.2",
"jest-environment-jsdom": "^29.6.2",
Expand Down
64 changes: 32 additions & 32 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 325e808

Please sign in to comment.