This blog post series has moved here.
You might also be interested in the 2016 version.
#!/bin/bash | |
rm *.jks 2> /dev/null | |
rm *.pem 2> /dev/null | |
echo "====================================================" | |
echo "Creating fake third-party chain root -> ca" | |
echo "====================================================" | |
# generate private keys (for root and ca) |
This blog post series has moved here.
You might also be interested in the 2016 version.
macro $do { | |
case { $y:expr } => { | |
$y | |
} | |
case { $x:ident <- $y:expr $rest ... } => { | |
λ['>=']($y, function($x) { | |
return $do { $rest ... } | |
}); | |
} | |
} |
Start cljs.main
with rebel-readline
:
clojure -Sdeps '{:deps {github-mfikes/cljs-main-rebel-readline {:git/url "https://gist.github.com/mfikes/9f13a8e3766d51dcacd352ad9e7b3d1f" :sha "27b82ef4b86a70afdc1a2eea3f53ed1562575519"}}}' -i @setup.clj -m cljs.main
Run the test.clj
below in a Clojure REPL, adjusting the cmd
vector as needed to launch things.
It will launch the browser REPL and imitate a user typing forms into it. (If you don't have Safari set as your default browser, you can splice ["-ro" "{:launch-browser false}" "-r"]
into the end of the cmd
vector and launch Safari manually, pointing it at http://localhost:9000
In your browser open the JavaScript console to see progress.
A faster verzion, zippy.clj
eliminates the JavaScript console logging and the Thread/sleep
calls, evaluating the sequence of integer forms as quickly as possible.
To instead compare with Figwheel, do
(require 'tubular.core) | |
(tubular.core/connect "127.0.0.1" REPL_PORT) |
/** | |
* ReactJS: JavaScript like you've always done it. | |
* | |
* This example renders your top ten most followed friends/followers, `filter`ing | |
* only your favorites, and putting a star on all verified accounts. | |
* | |
* With ReactJS, any time your data changes, the UI is always brought up to date | |
* automatically. If friends length changes, or followCount - it always shows what | |
* `render` describes. | |
*/ |
(ns frontend.editor-plugin | |
(:require-macros [frontend.goog-extend :refer [goog-extend]]) | |
(:import [goog.editor Plugin])) | |
; 4. Now the code should work with advanced compilation but Closure Compiler | |
; will display few warnings about using "this" in static functions. | |
; To fix this, the constuctor should have proper JSDoc comments: | |
(goog-extend ^{:jsdoc ["@constructor" "@extends {goog.editor.Plugin}"]} FooPlugin Plugin | |
([] | |
; 1. This doesn't work with advanced compilation as Closure compiler checks that first |
It would be interesting if Figwheel could essentially decorate any implementation of IJavaScriptEnv
, taking on the responsibility of watching the filesystem (perhaps even delegating that to ClojureScript :watch
, and expanded :watch-fn
, and perhaps minimally calling IJavaScriptEnv -load
when Figwheel determines it is needed.
Then, for those REPLs that can participate, if IFigwheelSupport
can be extended to them, they can do further cool stuff. (Perhaps IFigwheelSupport
is actually necessary while IJavaScriptEnv
as described in the previous paragraph is insufficient, and a more fancy impl of -load
is needed?)
That way, things like the existing Node REPL could be minimally supported by Figwheel, as well as Ambly, the Browser REPL, etc.
What does IFigwheelSupport
do?
Perhaps somewhere there is a HUD interface and Figwheel can ask a REPL to display things on its HUD? An iOS or Android-specific REPL could delegate to Objective-C or Java that implement a HUD using platform-specific UI widgets