Giter Site home page Giter Site logo

aszenasi / uix Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pitch-io/uix

0.0 0.0 0.0 6.36 MB

Idiomatic ClojureScript interface to modern React.js

Home Page: https://github.com/pitch-io/uix#docs

License: Eclipse Public License 2.0

Shell 0.83% JavaScript 1.17% Clojure 98.00%

uix's Introduction

Idiomatic ClojureScript interface to modern React.js

"Oh god, I just started learning reagent. Don’t tell me I’ll have to switch" /r/clojure

API compatibility: React v18.2.0

UIx v1 is in roman01la/uix repo

Discuss at #uix on Clojurians Slack

CircleCI Clojars Project Clojars Project

Installation

{:deps {com.pitch/uix.core {:mvn/version "0.8.1"}
        com.pitch/uix.dom {:mvn/version "0.8.1"}}}

Usage

(ns my.app
  (:require [uix.core :refer [defui $]]
            [uix.dom]))

(defui button [{:keys [on-click children]}]
  ($ :button.btn {:on-click on-click}
    children))

(defui app []
  (let [[state set-state!] (uix.core/use-state 0)]
    ($ :<>
      ($ button {:on-click #(set-state! dec)} "-")
      ($ :span state)
      ($ button {:on-click #(set-state! inc)} "+"))))

(defonce root
  (uix.dom/create-root (js/document.getElementById "root")))

(uix.dom/render-root ($ app) root)

Docs

Testing

scripts/test

Note: to ensure you're using the right Node.js version, you can use nvm and run nvm use once in the directory. Otherwise the Node.js version you use is in the .nvmrc file. See nvm repo for more documentation.

Publishing

  1. Update version in core/release.edn, dom/release.edn and in README.md
  2. Update docs if needed
  3. Update CHANGELOG.md
  4. Publish both core and dom packages to Clojars
cd core && CLOJARS_PASSWORD={YOUR_CLOJARS_TOKEN} clj -A:release --skip-tag
cd dom && CLOJARS_PASSWORD={YOUR_CLOJARS_TOKEN} clj -A:release --skip-tag

Who's using UIx2?

Thanks to

  • UIx v1 for initial set of ideas and learnings
  • Helix for even more ideas
  • Pitch for sponsoring and dogfooding the work

uix's People

Contributors

abcdw avatar adamrenklint avatar andrejcesen avatar brandonstubbs avatar caleb avatar chrisetheridge avatar codeasone avatar crofty avatar dani-mp avatar darwin avatar den1k avatar djebbz avatar g7s avatar galdolber avatar jimmyhmiller avatar mhuebert avatar mirocosic avatar mkarp avatar nwjsmith avatar olimsaidov avatar robert-stuttaford avatar roman01la avatar skazhy avatar smahood avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.