GithubHelp home page GithubHelp logo

suprematic / krell Goto Github PK

View Code? Open in Web Editor NEW

This project forked from vouch-opensource/krell

0.0 1.0 0.0 536 KB

Simple ClojureScript React Native Tooling

License: Eclipse Public License 1.0

Clojure 69.57% JavaScript 30.43%

krell's Introduction

krell

Stand alone, low configuration ClojureScript tooling for React Native. All features are provided as a simple set of defaults over the standard ClojureScript compiler.

Why Krell?

There are two other relatively mature ClojureScript tools for React Native, re-natal and shadow-cljs. re-natal is oldest and likely most widely used. Unfortunately, re-natal is Leiningen-centric and has some historical design decisions that lead to a stateful CLI API. Still, it is a direct inspiration for Krell, and re-natal solved many tricky edge-cases early on. shadow-cljs also offers react-native integration, but provides that as part of a full featured package rather than an a la carte tool.

Krell fills the gap by providing a stand alone tool with few dependencies. It does only one thing - extend the standard ClojureScript compiler to make developing React Native simpler (and easier).

It does not attempt to paper over the React Native CLI workflow at all. Krell just provides minimal sensible defaults for development and production and allows you to switch between these defaults via the familiar ClojureScript :optimizations settings.

With little configuration beyond typical ClojureScript web config, you get a React Native REPL-based workflow. Because Krell uses the ClojureScript compiler to index node_modules, you can idiomatically require anything you've installed via yarn or npm just like any ClojureScript library.

If you specify a higher optimization setting like :simple or :advanced, Krell generates a single file output without the REPL dependencies.

Requirements

  • Node >= 10.16.0
  • Latest release of ClojureScript
  • Java SDK 8+

Using React Native >= 0.60 is highly recommended as autolinking simplifies usage greatly. If you must use an older version of React Native refer to the documentation for the REPL support dependencies: react-native-tcp-socket.

Install REPL Dependencies

Install the REPL support dependencies:

clj -m cljs.main --install-deps

Switch into the ios directory of your project and run pod install.

On Android you should modify your AsyncStorage settings in android/gradle.properties. This is only necessary for REPL driven development:

AsyncStorage_db_size_in_MB=256

REPL

First build your project:

clj -m krell.main -v -co build.edn -c

Start a REPL:

clj -m krell.main -co build.edn -r

You can of course combine these steps just as with plain cljs.main:

clj -m krell.main -co build.edn -c -r

Assets & Arbitrary Node Library Requires

Krell supports arbitrary js/require of assets and Node.js dependencies. The asset support is intended to align with React Native's own documentation - you must use static relative paths. The additional support for Node.js dependencies is useful when transitioning away from re-natal to Krell.

It's important to note that adding a new asset or new Node library currently requires restarting the REPL.

Other than that there are no other limitations. The handling of js/require is implemented as an analyzer pass so if you want to create macros to generate asset requires, that will work.

Examples

See the Reagent example tutorial in the wiki.

Tooling Integration

See the wiki.

Contributing

Currently Krell is only taking bug reports. If you find a bug or would like to see an enhancement that aligns with the following design principles please file a Github issue!

Design Principles

  • No ClojureScript React library integration templating. The documentation should make it pretty clear how to integrate with any particular ClojureScript React library.

  • Basic React Native only, we're not interested in Expo or any other similar tooling

License

Copyright (c) Vouch, Inc. All rights reserved. The use and
distribution terms for this software are covered by the Eclipse
Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php)
which can be found in the file epl-v10.html at the root of this
distribution. By using this software in any fashion, you are
agreeing to be bound by the terms of this license. You must
not remove this notice, or any other, from this software.

krell's People

Contributors

swannodette avatar mfikes avatar sskorokhodov avatar eemshi avatar

Watchers

James Cloos 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.