📅 You're Invited: Meet the Socket team at RSAC (April 28 – May 1).RSVP
Socket
Sign inDemoInstall
Socket

babel-plugin-hydroxide-compiler

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

babel-plugin-hydroxide-compiler

Compiler for Hydroxide Framework

1.0.3
unpublished
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 07 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