Skip to content

Commit

Permalink
Initial support for Fulcro
Browse files Browse the repository at this point in the history
Only few namespaces are exposed so far, but it is already
possible to render a trivial defsc component to a dom element.

FIXME: Tests currently don't run due to problems with accessing `js/ReactDOMServer`
  • Loading branch information
holyjak committed Sep 28, 2023
1 parent 0817bbb commit 0e0ca4a
Show file tree
Hide file tree
Showing 23 changed files with 829 additions and 0 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,15 @@ Public API:
- `js-interop-namespace`
- `namespaces`

### [com.fulcrologic/fulcro](https://github.com/fulcro/fulcro)

Namespace: `sci.configs.fulcro.fulcro`

Public API:

- `config`
- `namespaces`

### [funcool/promesa](https://github.com/funcool/promesa)

Namespace: `sci.configs.funcool.promesa`
Expand Down
1 change: 1 addition & 0 deletions deps.edn
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
:git/sha "987910fb38fdd166865458c3fd4b468a22fb9992"}
org.clojure/clojurescript {:mvn/version "1.11.51"}
applied-science/js-interop {:mvn/version "0.3.3"}
com.fulcrologic/fulcro {:mvn/version "3.6.10"}
funcool/promesa {:git/url "https://github.com/funcool/promesa"
:git/sha "e503874b154224ce85b223144e80b697df91d18e"}
reagent/reagent {:mvn/version "1.1.0"}
Expand Down
8 changes: 8 additions & 0 deletions src/sci/configs/fulcro/algorithms/data_targeting.cljs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
(ns sci.configs.fulcro.algorithms.data-targeting
(:require [sci.core :as sci]
[com.fulcrologic.fulcro.algorithms.data-targeting]))

(def sci-ns (sci/create-ns 'com.fulcrologic.fulcro.algorithms.data-targeting))
(def ns-def (sci/copy-ns com.fulcrologic.fulcro.algorithms.data-targeting sci-ns))

(def namespaces {'com.fulcrologic.fulcro.algorithms.data-targeting ns-def})
9 changes: 9 additions & 0 deletions src/sci/configs/fulcro/algorithms/denormalize.cljs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
(ns sci.configs.fulcro.algorithms.denormalize
(:require
[sci.core :as sci]
com.fulcrologic.fulcro.algorithms.denormalize))

(def sci-ns (sci/create-ns 'com.fulcrologic.fulcro.algorithms.denormalize))
(def ns-def (sci/copy-ns com.fulcrologic.fulcro.algorithms.denormalize sci-ns))

(def namespaces {'com.fulcrologic.fulcro.algorithms.denormalize ns-def})
8 changes: 8 additions & 0 deletions src/sci/configs/fulcro/algorithms/form_state.cljs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
(ns sci.configs.fulcro.algorithms.form-state
(:require [sci.core :as sci]
com.fulcrologic.fulcro.algorithms.form-state))

(def sci-ns (sci/create-ns 'com.fulcrologic.fulcro.algorithms.form-state))
(def ns-def (sci/copy-ns com.fulcrologic.fulcro.algorithms.form-state sci-ns))

(def namespaces {'com.fulcrologic.fulcro.algorithms.form-state ns-def})
9 changes: 9 additions & 0 deletions src/sci/configs/fulcro/algorithms/lookup.cljs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
(ns sci.configs.fulcro.algorithms.lookup
(:require [sci.core :as sci]
com.fulcrologic.fulcro.algorithms.lookup))


(def sci-ns (sci/create-ns 'com.fulcrologic.fulcro.algorithms.lookup))
(def ns-def (sci/copy-ns com.fulcrologic.fulcro.algorithms.lookup sci-ns))

(def namespaces {'com.fulcrologic.fulcro.algorithms.lookup ns-def})
9 changes: 9 additions & 0 deletions src/sci/configs/fulcro/algorithms/merge.cljs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
(ns sci.configs.fulcro.algorithms.merge
(:require
[sci.core :as sci]
com.fulcrologic.fulcro.algorithms.merge))

(def sci-ns (sci/create-ns 'com.fulcrologic.fulcro.algorithms.merge))
(def ns-def (sci/copy-ns com.fulcrologic.fulcro.algorithms.merge sci-ns))

(def namespaces {'com.fulcrologic.fulcro.algorithms.merge ns-def})
9 changes: 9 additions & 0 deletions src/sci/configs/fulcro/algorithms/normalize.cljs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
(ns sci.configs.fulcro.algorithms.normalize
(:require [sci.core :as sci]
com.fulcrologic.fulcro.algorithms.normalize))


(def sci-ns (sci/create-ns 'com.fulcrologic.fulcro.algorithms.normalize))
(def ns-def (sci/copy-ns com.fulcrologic.fulcro.algorithms.normalize sci-ns))

(def namespaces {'com.fulcrologic.fulcro.algorithms.normalize ns-def})
8 changes: 8 additions & 0 deletions src/sci/configs/fulcro/algorithms/react_interop.cljs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
(ns sci.configs.fulcro.algorithms.react-interop
(:require [sci.core :as sci]
com.fulcrologic.fulcro.algorithms.react-interop))

(def sci-ns (sci/create-ns 'com.fulcrologic.fulcro.algorithms.react-interop))
(def ns-def (sci/copy-ns com.fulcrologic.fulcro.algorithms.react-interop sci-ns))

(def namespaces {'com.fulcrologic.fulcro.algorithms.react-interop ns-def})
8 changes: 8 additions & 0 deletions src/sci/configs/fulcro/algorithms/tempid.cljs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
(ns sci.configs.fulcro.algorithms.tempid
(:require [sci.core :as sci]
com.fulcrologic.fulcro.algorithms.tempid))

(def sci-ns (sci/create-ns 'com.fulcrologic.fulcro.algorithms.tempid))
(def ns-def (sci/copy-ns com.fulcrologic.fulcro.algorithms.tempid sci-ns))

(def namespaces {'com.fulcrologic.fulcro.algorithms.tempid ns-def})
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
(ns sci.configs.fulcro.algorithms.tx-processing.synchronous-tx-processing
(:require [sci.core :as sci]
[com.fulcrologic.fulcro.algorithms.tx-processing.synchronous-tx-processing :as stx]))

(defn ^:sci/macro in-transaction [_&form _&env app-sym & body]
`(let [id# (:com.fulcrologic.fulcro.application/id ~app-sym)]
(swap! stx/apps-in-tx update id# conj (stx/current-thread-id))
(try
~@body
(finally
(swap! apps-in-tx update id# pop)))))

(def sci-ns (sci/create-ns 'com.fulcrologic.fulcro.algorithms.tx-processing.synchronous-tx-processing))
(def ns-def (assoc (sci/copy-ns com.fulcrologic.fulcro.algorithms.tx-processing.synchronous-tx-processing sci-ns
{:exclude [in-transaction]})
'in-transaction (sci/copy-var in-transaction sci-ns)))

(def namespaces {'com.fulcrologic.fulcro.algorithms.tx-processing.synchronous-tx-processing ns-def})
9 changes: 9 additions & 0 deletions src/sci/configs/fulcro/application.cljs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
(ns sci.configs.fulcro.application
(:require
[sci.core :as sci]
[com.fulcrologic.fulcro.application]))

(def sci-ns (sci/create-ns 'com.fulcrologic.fulcro.application))
(def ns-def (sci/copy-ns com.fulcrologic.fulcro.application sci-ns))

(def namespaces {'com.fulcrologic.fulcro.application ns-def})
Loading

0 comments on commit 0e0ca4a

Please sign in to comment.