npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

reona

v0.1.0-alpha.1

Published

react 인터페이스 기반 UI 라이브러리

Readme

reona

react 기반 인터페이스 UI 라이브러리

전체 구성도

architecture

사용법

상태 변이

import { html, state, rootRender } from 'reona';

export default function App() {
  const data = state({
    count: 0,
  });

  const onClick = () => {
    data.count += 1;
  }

  return html`
    <div id="app">
      <button type="button" @click=${onClick}>click</button>
      <div>
        <span>${data.count}</span>
      </div>
    </div>
  `;
}

rootRender(document.getElementById('root')!, App);

라이프 사이클 mount, unmount, updated

import { mount } from 'reona';

export default function App() {
  const data = state({
    count: 0,
  });

  mount(() => {
    console.log('mount');
    return () => {
      console.log('cleanup');
    }
  });

  updated(data, () => {
    console.log('data가 변경될 때 실행');
  });

  return html`
    <div id="app">
    </div>
  `;
}

rootRender(document.getElementById('root')!, App);

props 관찰

import { watchProps, createComponent } from 'reona';

export default function App() {
  const data = state({
    count: 0,
  });

  const onClick = () => {
    data.count += 1;
  };

  return html`
    <div id="app">
      <button type="button" @click=${onClick}>트리거</button>
      ${createComponent(Son, {
        props: {
          value: data.count * 2,
        },
      })}
    </div>
  `;
}

function Son({ value }) {
  watchProps((prev) => {
    console.log(prev); // 0
  });

  return html`
    <div>
      ${value}
    </div>
  `;
  

rootRender(document.getElementById('root')!, App);

전역 스토어

import { createStore, store } from 'reona';

const countStore = createStore({
  count: 10000,
});

function Store() {
  return html`
    <div id="app">
      ${createComponent(Child1)}
      ${createComponent(Child2)}
    </div>`;
}

function Child1() {
  const storeData = store(countStore);
  const trigger = () => {
    storeData.count += 1;
  };

  return html`
    <div>
      <button type="button" @click=${trigger}>trigger</button>
      <div id="store1">${storeData.count}</div>
    </div>
  `;
}

function Child2() {
  const storeData = store(countStore);
  return html` <div id="store2">${storeData.count}</div> `;
}

rootRender(document.getElementById('root')!, Store);

캐싱기능

function App() {
  const data = state({ count: 1 });

  const doubled = memo(data, () => data.count * 2);

  const noop = () => {
    data.count += 1;
  };

  return html`
    <div id="app">
      <button type="button" @click=${noop}>noop</button>
      <div data-testid="result">${doubled}</div>
    </div>`;
}

rotRender(document.getElementById('root')!, App);

ref

function RefElement() {
  const headingElement = ref<HTMLHeadElement | null>(null);

  mounted(() => {
    console.log(headingElement.current); // headingElement
  });

  return html`
    <div id="app">
      <h1 $$ref="${setRef(headingElement)}">hh</h1>
    </div>
  `;
}

rootRender(document.getElementById('root')!, RefElement);

라우트

import { 
  rootRender,
  createRouter,
  RouteProvider,
  Link,
  html,
  useParams,
  useQueryString 
} from 'reona';

function Home() {
  return html`
    <div id="app">
      <div>home</div>
      ${Link(html`<div>about</div>`, { href: '/about' })}
      ${Link(html`<div>post</div>`, { href: '/post' })}
    </div>
  `;
}

function About() {
  return html`
    <div id="app">
      <div>about</div>
      ${Link(html`<div>post</div>`, { href: '/post' })}
      ${Link(html`<div>home</div>`, { href: '/' })}
    </div>
  `;
}

function Post() {
  return html`
    <div id="app">
      <div>post</div>
      ${Link(html`<div>home</div>`, { href: '/' })}
      ${Link(html`<div>about</div>`, { href: '/about' })}
    </div>
  `;
}

function Article() {
  const params = useParams();
  const qs = useQueryString();

  return html`
    <article>
      article ${params.postId}
    </article>
  `;
}

const router = createRouter([
  {
    path: '/',
    component: Home,
  },
  {
    path: '/about',
    component: About,
  },
  {
    path: '/post',
    component: Post,
    children: [{
      path: '/:postId',
      component: Article,
      beforeEnter: (to, from) => {
        to; from;
        return true;
      },
    }],
  },
]);

rootRender(document.getElementById('root')!, RouteProvider(router));