key
is pretty much crucial for state perservation in React. As of React 0.13 it can't do the following things:
- Clone state
<Comp key={1} /><Comp key={1} />
- Preserve component state across different parents:
(ns cljs.compiler-options-schema | |
(:require | |
[clojure.spec :as s] | |
[clojure.string :as string] | |
;; for initial dev | |
[clojure.test :refer [deftest is testing]])) | |
(defn non-blank-string? [x] (and (string? x) (not (string/blank? x)))) | |
(defonce ^:private registry-ref (atom {})) |
( | |
var notes, synths, on, off, mod, bend, touch; | |
~num_channels = 8; | |
~bend_range = 24; | |
MIDIIn.connectAll; | |
notes = Array.newClear(~num_channels); | |
synths = Array.newClear(~num_channels); |
(ns test.rec | |
(:require [om.next :as om :refer-macros [defui]] | |
[goog.dom :as gdom] | |
[om.dom :as dom])) | |
(enable-console-print!) | |
(def app-state | |
{:display/path [] | |
:tree/root |
;; 1 - The var associated to a def, (def my-var ...) - L1142 | |
(DefExpr. :def env form var-name | |
;; TODO: check if this map should be a VarExpr - Sebastian | |
(assoc (analyze (-> env (dissoc :locals) | |
(assoc :context :expr) | |
(assoc :def-var true)) | |
sym) | |
:op :var) | |
doc (:jsdoc sym-meta) init-expr |
key
is pretty much crucial for state perservation in React. As of React 0.13 it can't do the following things:
<Comp key={1} /><Comp key={1} />
This links:
platform :ios, '8.0'
pod 'Ambly', :git => 'https://github.com/mfikes/ambly', :branch => 'jsc-c-api'
pod 'Ejecta', :git => 'https://github.com/swannodette/Ejecta', :branch => 'podspec'
Below uses my fork of your Ejecta, and also links. I mucked with getting rid of the JavaScriptCore framework and renaming the static lib so it can be included. (This works, but it is not clear if needed over just using your fork).
In Ambly, created a new branch jsc-c-api
.
In that branch, switched everything over to use JSGlobalContextRef
, JSValueRef
, but actually commented out most of the implementation in each of the methods, except for one tiny bit in ABYServer
, where REPL-generated JavaScript is executed. I converted that over to a C-based approach:
// Evaluate the JavaScript
JSValueRef jsError = NULL;
JSStringRef javaScriptStringRef = JSStringCreateWithCFString((__bridge CFStringRef)javaScript);
JSValueRef result = JSEvaluateScript(_jsContext, javaScriptStringRef, NULL, NULL, 0, &jsError);
JSStringRelease(javaScriptStringRef);
Pod::Spec.new do |s| | |
s.name = 'Ejecta' | |
s.version = '1.5' | |
s.license = 'MIT' | |
s.summary = 'A Fast, Open Source JavaScript, Canvas & Audio Implementation for iOS.' | |
s.homepage = 'http://impactjs.com/ejecta' | |
s.author = { 'Dominic Szablewski' => '[email protected]' } | |
s.source = { :git => 'https://github.com/phoboslab/Ejecta.git', :tag => 'v1.5' } | |
s.description = 'A Fast, Open Source JavaScript, Canvas & Audio Implementation for iOS.' | |
s.platform = :ios |
;; Gamma (shader-generation): https://github.com/kovasb/gamma | |
;; Gamma Driver (WebGL resource management, aka "Om for WebGL"): https://github.com/kovasb/gamma-driver | |
;; Gamma examples: https://github.com/kovasb/gamma-examples | |
(ns gampg.learn-gamma.lesson-01 | |
(:require [clojure.string :as s] | |
[gamma.api :as g] | |
[gamma.program :as p] | |
[gamma.tools :as gt] | |
[gamma-driver.drivers.basic :as driver] |
(ns ptv.scratch | |
(:require | |
[om.core :as om :include-macros true] | |
[om.dom :as dom :include-macros true])) | |
(enable-console-print!) | |
(def app-state (atom {})) | |
(defn component-one [data owner opts] |