Skip to content

Commit eaef7c2

Browse files
committed
update readme
1 parent 5528f2b commit eaef7c2

File tree

5 files changed

+214
-19
lines changed

5 files changed

+214
-19
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
Pre‑render your UI once, flip a `data-*` attribute to update — that's it.
66

7-
<a href="https://bundlephobia.com/package/@austinserb/react-zero-ui@1.0.19" target="_blank" rel="noopener noreferrer"><img src="https://badgen.net/bundlephobia/minzip/@austinserb/react-zero-ui@1.0.19" alt="npm version" /> </a><a href="https://www.npmjs.com/package/@austinserb/react-zero-ui" target="_blank" rel="noopener noreferrer"><img src="https://img.shields.io/npm/v/@react-zero-ui/core" alt="npm version" /></a> <a href="https://opensource.org/licenses/MIT" target="_blank" rel="noopener noreferrer"><img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="License: MIT" /></a> ![CI](https://github.com/react-zero-ui/core/actions/workflows/ci.yml/badge.svg?branch=main)
7+
<a href="https://bundlephobia.com/package/@react-zero-ui/[email protected]" target="_blank" rel="noopener noreferrer"><img src="https://badgen.net/bundlephobia/minzip/@react-zero-ui/[email protected]" alt="npm version" /> </a><a href="https://www.npmjs.com/package/@austinserb/react-zero-ui" target="_blank" rel="noopener noreferrer"><img src="https://img.shields.io/npm/v/@react-zero-ui/core" alt="npm version" /></a> <a href="https://opensource.org/licenses/MIT" target="_blank" rel="noopener noreferrer"><img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="License: MIT" /></a> ![CI](https://github.com/react-zero-ui/core/actions/workflows/ci.yml/badge.svg?branch=main)
88

99
---
1010

@@ -20,10 +20,10 @@ Pre‑render your UI once, flip a `data-*` attribute to update — that's it.
2020

2121
## 🚀 Live Demo
2222

23-
| Example | Link | What it shows | Link to Code |
24-
| --------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
25-
| Interactive menu with render tracker | <a href="https://zero-ui.dev/" target="_blank" rel="noopener noreferrer"><strong>Main Demo↗</strong></a> | Compare Zero‑UI vs. React side‑by‑side while toggling a menu. | <a href="https://github.com/react-zero-ui/core/tree/main/examples/demo" target="_blank" rel="noopener noreferrer">Github</a> |
26-
| React benchmark (10 000 nested nodes) | <a href="https://zero-ui.dev/react" target="_blank" rel="noopener noreferrer"><strong>React 10k↗</strong></a> | How long the traditional React render path takes. | <a href="https://github.com/react-zero-ui/core/tree/main/examples/demo/src/app/react" target="_blank" rel="noopener noreferrer">Github</a> |
23+
| Example | Link | What it shows | Link to Code |
24+
| --- | --- | --- | --- |
25+
| Interactive menu with render tracker | <a href="https://zero-ui.dev/" target="_blank" rel="noopener noreferrer"><strong>Main Demo↗</strong></a> | Compare Zero‑UI vs. React side‑by‑side while toggling a menu. | <a href="https://github.com/react-zero-ui/core/tree/main/examples/demo" target="_blank" rel="noopener noreferrer">Github</a> |
26+
| React benchmark (10 000 nested nodes) | <a href="https://zero-ui.dev/react" target="_blank" rel="noopener noreferrer"><strong>React 10k↗</strong></a> | How long the traditional React render path takes. | <a href="https://github.com/react-zero-ui/core/tree/main/examples/demo/src/app/react" target="_blank" rel="noopener noreferrer">Github</a> |
2727
| Zero‑UI benchmark (10 000 nested nodes) | <a href="https://zero-ui.dev/zero-ui" target="_blank" rel="noopener noreferrer"><strong style="text-align: nowrap;">Zero‑UI 10k↗</strong></a> | Identical DOM, but powered by Zero‑UI's `data-*` switch. | <a href="https://github.com/react-zero-ui/core/tree/main/examples/demo/src/app/zero-ui" target="_blank" rel="noopener noreferrer">Github</a> |
2828

2929
---

packages/core/__tests__/fixtures/next/app/ChildWithoutSetter.tsx

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
1-
export function ChildComponent() {
1+
export function ChildWithoutSetter() {
22
return (
3-
<div
4-
className="child-closed:bg-gray-100 child-open:bg-gray-900 child-open:text-white"
5-
data-testid="child-container">
3+
<div className="border-2 border-blue-500">
64
<div
7-
className="border-2 border-blue-500"
8-
data-testid="child-toggle">
9-
No Setter Child
10-
</div>
11-
<div className="child-closed:bg-gray-100 child-open:bg-gray-900 flex">
12-
Child: <span className="child-open:block child-closed:hidden">Open</span> <span className="child-closed:block child-open:hidden">Closed</span>
5+
className="scope-on:bg-blue-900 scope-off:bg-blue-100 scope-on:text-white bg-red-500"
6+
data-testid="child-scope-container">
7+
<div className="scope-off:bg-blue-100 scope-on:bg-blue-900 ">
8+
Child Scope: <span className="scope-off:block scope-on:hidden">False</span>
9+
<span className="scope-on:block scope-off:hidden">True</span>
10+
</div>
1311
</div>
1412
</div>
1513
);

packages/core/__tests__/fixtures/next/app/page.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { useUI } from '@react-zero-ui/core';
33
import UseEffectComponent from './UseEffectComponent';
44
import FAQ from './FAQ';
55
import { ChildComponent } from './ChildComponent';
6+
import { ChildWithoutSetter } from './ChildWithoutSetter';
67

78
export default function Page() {
89
const [, setTheme] = useUI<'light' | 'dark'>('theme', 'light');
@@ -152,6 +153,7 @@ export default function Page() {
152153
data-testid="scope-toggle">
153154
Toggle Scope
154155
</button>
156+
<ChildWithoutSetter />
155157
<div className="scope-on:bg-blue-900 scope-off:bg-blue-100 ">
156158
Scope: <span className="scope-off:block scope-on:hidden">False</span>
157159
<span className="scope-on:block scope-off:hidden">True</span>

packages/core/src/config.cts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
export const CONFIG = {
22
SUPPORTED_EXTENSIONS: { TYPESCRIPT: ['.ts', '.tsx'], JAVASCRIPT: ['.js', '.jsx'] },
33
HOOK_NAME: 'useUI',
4+
LOCAL_HOOK_NAME: 'useScopedUI',
45
IMPORT_NAME: '@react-zero-ui/core',
56
MIN_HOOK_ARGUMENTS: 2,
67
MAX_HOOK_ARGUMENTS: 2,

pnpm-lock.yaml

Lines changed: 198 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)