Skip to content

Commit

Permalink
[optimize] enable Async Render mode of DOM Renderer 2.6 (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
TechQuery authored Nov 20, 2024
1 parent 05cbd58 commit 8d1df6e
Show file tree
Hide file tree
Showing 7 changed files with 204 additions and 143 deletions.
36 changes: 36 additions & 0 deletions ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,42 @@ const AsyncTag = lazy(() => import('./AsyncTag'));
new DOMRenderer().render(<AsyncTag />);
```

### Async rendering (experimental)

#### DOM tree

```tsx
import { DOMRenderer } from 'dom-renderer';

new DOMRenderer().render(
<a>
<b>Async rendering</b>
</a>,
document.body,
'async'
);
```

#### Class component

```tsx
import { component } from 'web-cell';

@component({
tagName: 'async-renderer',
renderMode: 'async'
})
export class AsyncRenderer extends HTMLElement {
render() {
return (
<a>
<b>Async rendering</b>
</a>
);
}
}
```

### Animate CSS component

```tsx
Expand Down
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "web-cell",
"version": "3.0.2",
"version": "3.0.3",
"description": "Web Components engine based on VDOM, JSX, MobX & TypeScript",
"keywords": [
"web",
Expand All @@ -27,7 +27,7 @@
"types": "dist/index.d.ts",
"dependencies": {
"@swc/helpers": "^0.5.15",
"dom-renderer": "^2.5.1",
"dom-renderer": "^2.6.0",
"mobx": ">=6.11",
"regenerator-runtime": "^0.14.1",
"web-utility": "^4.4.2"
Expand All @@ -38,8 +38,8 @@
"jsdom": ">=23.1"
},
"devDependencies": {
"@eslint/compat": "^1.2.2",
"@eslint/js": "^9.14.0",
"@eslint/compat": "^1.2.3",
"@eslint/js": "^9.15.0",
"@parcel/config-default": "~2.13.0",
"@parcel/packager-ts": "~2.13.0",
"@parcel/transformer-typescript-tsc": "~2.13.0",
Expand All @@ -49,12 +49,12 @@
"@types/node": "^20.17.6",
"core-js": "^3.39.0",
"element-internals-polyfill": "^1.3.12",
"eslint": "^9.14.0",
"eslint": "^9.15.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-react": "^7.37.2",
"eslint-plugin-simple-import-sort": "^12.1.1",
"globals": "^15.12.0",
"husky": "^9.1.6",
"husky": "^9.1.7",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"jsdom": "^25.0.1",
Expand All @@ -68,9 +68,9 @@
"ts-jest": "^29.2.5",
"ts-node": "^10.9.2",
"typedoc": "^0.26.11",
"typedoc-plugin-mdn-links": "^3.3.7",
"typedoc-plugin-mdn-links": "^3.3.8",
"typescript": "~5.6.3",
"typescript-eslint": "^8.14.0"
"typescript-eslint": "^8.15.0"
},
"scripts": {
"prepare": "husky",
Expand Down
Loading

1 comment on commit 8d1df6e

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deploy preview for web-cell ready!

✅ Preview
https://web-cell-f6gdq8ls4-techquerys-projects.vercel.app

Built with commit 8d1df6e.
This pull request is being automatically deployed with vercel-action

Please sign in to comment.