🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

babel-plugin-test-hx

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-test-hx

Compiler for Hydroxide Framework

1.2.2
latest
npm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

babel-plugin-hydroxide

Compiler for Hydroxide Framework

It compiles JSX into efficient Template Hydrations

Example

Input

import { reactive } from 'hydroxide'

function Counter() {
  const count = reactive(0)
  const increment = () => count.set(count() + 1)
  return <button on-click={increment}>count is {count()}</button>
}

Output

import { reactive } from 'hydroxide'
import { delegateEvents, insert, template } from 'hydroxide-dom'

const _tmpl = /* #__PURE__ */ template('<button>count is <!></button>')

function Counter() {
  const count = reactive(0)
  const increment = () => count.set(count() + 1)

  return /* #__PURE__ */ (() => {
    const _root = _tmpl.cloneNode(true)
    const _node = _root.firstChild.nextSibling
    _root.$$click = increment
    insert(_node, count)
    return _root
  })()
}

delegateEvents(['click'])

Keywords

JSX-compiler

FAQs

Package last updated on 22 Jul 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts