Skip to content

Commit

Permalink
Merge branch 'release/de'
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/hyperfiddle/electric/impl/expand.clj
#	test/hyperfiddle/electric/impl/expand_test.cljc
  • Loading branch information
dustingetz committed Sep 3, 2024
2 parents 7e3400f + aa10424 commit 1972c90
Show file tree
Hide file tree
Showing 152 changed files with 14,319 additions and 12,202 deletions.
13 changes: 5 additions & 8 deletions .clj-kondo/config.edn
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
{:lint-as {hyperfiddle.electric/def clojure.core/def
hyperfiddle.electric/defn clojure.core/defn
hyperfiddle.electric/for clojure.core/for
hyperfiddle.electric/with-cycle clojure.core/let
hyperfiddle.electric/fn clojure.core/fn
hyperfiddle.electric/fn* clojure.core/fn*
hyperfiddle.electric.impl.array-fields/deffields clojure.core/declare
hyperfiddle.electric.impl.compiler/let-res clojure.core/let}
{:lint-as {hyperfiddle.electric3/defn clojure.core/defn
hyperfiddle.electric3/for clojure.core/let
hyperfiddle.electric3/cursor clojure.core/let
hyperfiddle.electric3/with-cycle clojure.core/let
hyperfiddle.electric3/fn clojure.core/fn}
:linters {:redundant-expression {:level :off}}}
2 changes: 2 additions & 0 deletions .clj-kondo/hyperfiddle/electric/config.edn
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{:lint-as {hyperfiddle.electric/def clojure.core/def
hyperfiddle.electric/defn clojure.core/defn
hyperfiddle.electric-de/defn clojure.core/defn
hyperfiddle.electric-de/cursor clojure.core/for
hyperfiddle.electric/for clojure.core/for
hyperfiddle.electric/with-cycle clojure.core/let
hyperfiddle.electric/fn clojure.core/fn}
Expand Down
2 changes: 1 addition & 1 deletion ci/run_tests_browser.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/sh -x

echo "Running Browser tests"
clojure -M:dev:test:browser-test:shadow-cljs compile :browser-test --force-spawn && \
clojure -M:test:shadow-cljs compile :browser-test --force-spawn && \
./node_modules/.bin/karma start --single-run $@ # --browsers Chrome
18 changes: 8 additions & 10 deletions ci/run_tests_jvm.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
#!/bin/bash

echo "Running JVM tests"

# All namespaces are tested by default to encourage tested code.
# Use :ns-regexp to blacklist specific namespaces.
# ^(?!foo.(bar|baz)).* : includes everything except foo.bar or foo.baz

clojure -X:test \
:dirs "[\"src\" \"src-docs\" \"test\"]" \
:patterns \
"[\"hyperfiddle.electric.impl.*\" \
\"hyperfiddle.electric-test\" \
\"hyperfiddle.zero\" \
\"hyperfiddle.missionary-test\" \
\"contrib.missionary-contrib-test\" \
\"contrib.ednish\" \
\"contrib.sexpr-router\" \
]"
:dirs "[\"src\" \"test\"]" \
:patterns "[\"^(?!hyperfiddle.(api|popover|txn|electric-fulcro|electric-httpkit|spool|spec)|contrib.(datomic|test.datomic)).*\"]"

2 changes: 1 addition & 1 deletion ci/run_tests_node.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/sh

echo "Running NodeJS tests"
clojure -M:test:shadow-cljs compile :test --force-spawn \
clojure -M:test:shadow-cljs compile :test --force-spawn "$@" \
&& node out/node-tests.js
19 changes: 10 additions & 9 deletions ci/running_dom_tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@
Run `./ci/run_tests_browser.sh`.

## Live reloading
1. Start a watch build for `:browser-test`, either:
- in Shadow UI
- at the REPL `(shadow/watch :browser-test)`
- from a shell `shadow-cljs -A:test watch :browser-test`
2. Run `./node_modules/.bin/karma start --browsers Chrome`
Karma will:
- use Chrome if installed
- fallback to Chromium if installed
- download and install Chromium for you otherwise
```
clojure -M:test:shadow-cljs watch :browser-test
# in another shell:
./node_modules/.bin/karma start
```

Karma will:
- use Chrome if installed
- fallback to Chromium if installed
- download and install Chromium for you otherwise
87 changes: 28 additions & 59 deletions deps.edn
Original file line number Diff line number Diff line change
@@ -1,63 +1,32 @@
{:paths ["src"]
:deps {com.cognitect/transit-clj {:mvn/version "1.0.333"}
com.cognitect/transit-cljs {:mvn/version "0.8.280"}
com.hyperfiddle/rcf {:mvn/version "20220926-202227"}
missionary/missionary {:mvn/version "b.33"}
org.clojure/clojure {:mvn/version "1.12.0-alpha5"}
org.clojure/clojurescript {:mvn/version "1.11.121"}
org.clojure/tools.analyzer.jvm {:mvn/version "1.2.3"} ;; used by Electric
org.clojure/tools.logging {:mvn/version "1.2.4"}
:deps {com.cognitect/transit-clj {:mvn/version "1.0.333"}
com.cognitect/transit-cljs {:mvn/version "0.8.280"}
com.hyperfiddle/rcf {:mvn/version "20220926-202227"}
missionary/missionary {:mvn/version "b.35"}
dom-top/dom-top {:mvn/version "1.0.9"} ; for loopr macro
fipp/fipp {:mvn/version "0.6.26"}
org.clojure/clojure {:mvn/version "1.12.0-alpha11"}
org.clojure/clojurescript {:mvn/version "1.11.121"}
org.clojure/tools.logging {:mvn/version "1.2.4"}
borkdude/edamame {:mvn/version "1.4.25"}
}

:aliases {:dev {:extra-paths ["src-dev" "src-docs" "test" "scratch" "resources-demo"] ; for clj command
:extra-deps {binaryage/devtools {:mvn/version "1.0.7"} ; for chrome devtools pretty printing
thheller/shadow-cljs {:mvn/version "2.26.2"}
;; reagent/reagent {:mvn/version "1.1.1"} ; for reagent interop demo
ch.qos.logback/logback-classic {:mvn/version "1.4.14"} ; logging implementation
info.sunng/ring-jetty9-adapter {:mvn/version "0.14.3"
;; "0.14.3" (Jetty 9) is Java 8 compatible;
;; "0.17.7" (Jetty 10) is NOT Java 8 compatible
:exclusions [org.slf4j/slf4j-api
info.sunng/ring-jetty9-adapter-http3]} ; no need
;; ring-basic-authentication/ring-basic-authentication {:mvn/version "1.2.0"}
com.datomic/peer {:mvn/version "1.0.7075" :exclusions [org.slf4j/slf4j-nop]} ; for demos TODO can this be removed?
datascript/datascript {:mvn/version "1.4.1"} ; for demos TODO can this be updated/removed?
}
:jvm-opts ["-XX:-OmitStackTraceInFastThrow" ;; RCF
]}
:test {:extra-paths [#_"src-dev" "test"]
:jvm-opts ["-Dhyperfiddle.rcf.generate-tests=true"
"-XX:-OmitStackTraceInFastThrow" ;; https://archive.md/NNt9r
]
:extra-deps {org.clojure/core.async {:mvn/version "1.6.681"} ; for interop helpers only
datascript/datascript {:mvn/version "1.4.1"}
ch.qos.logback/logback-classic {:mvn/version "1.4.14"}
io.github.cognitect-labs/test-runner {:git/url "https://github.com/cognitect-labs/test-runner.git"
:sha "cc75980b43011773162b485f46f939dc5fba91e4"}}
:exec-fn cognitect.test-runner.api/test}
:aliases {:shadow-cljs {:extra-deps {thheller/shadow-cljs {:mvn/version "2.26.2"}}
:main-opts ["-m" "shadow.cljs.devtools.cli"]}

:browser-test {:jvm-opts ["-Dhyperfiddle.electric.web-config-peers=client,cljs,server,cljs"]}

:build {:extra-paths ["src-build"]
:ns-default build
:extra-deps {io.github.clojure/tools.build {:mvn/version "0.9.6"}
slipset/deps-deploy {:mvn/version "0.2.2"}}}
:shadow-cljs {:extra-deps {thheller/shadow-cljs {:mvn/version "2.26.2"}}
:main-opts ["-m" "shadow.cljs.devtools.cli"]}
:prod {:extra-paths ["src-prod" "src-docs" "resources-demo"]
:extra-deps {ch.qos.logback/logback-classic {:mvn/version "1.4.14"} ; logging implementation
info.sunng/ring-jetty9-adapter {:mvn/version "0.14.3"
;; "0.14.3" (Jetty 9) is Java 8 compatible;
;; "0.17.7" (Jetty 10) is NOT Java 8 compatible
:exclusions [org.slf4j/slf4j-api
info.sunng/ring-jetty9-adapter-http3]} ; no need
ring-basic-authentication/ring-basic-authentication {:mvn/version "1.2.0"}
datascript/datascript {:mvn/version "1.4.1"} ; for demos TODO can this be updated/removed?
com.datomic/peer {:mvn/version "1.0.7075" :exclusions [org.slf4j/slf4j-nop]} ; for demos TODO can this be removed?
}}

:profile {:extra-deps {criterium/criterium {:mvn/version "0.4.6"}
com.clojure-goes-fast/clj-async-profiler {:mvn/version "1.1.1"}}
:jvm-opts ["-Djdk.attach.allowAttachSelf"
"-XX:+UnlockDiagnosticVMOptions"
"-XX:+DebugNonSafepoints"]}}}
:test {:extra-paths ["test"]
:exec-fn cognitect.test-runner.api/test
:jvm-opts ["-Dhyperfiddle.rcf.generate-tests=true" "-XX:-OmitStackTraceInFastThrow"] ;; https://archive.md/NNt9r
:extra-deps {org.clojure/core.async {:mvn/version "1.6.681"} ; for interop helpers only
ch.qos.logback/logback-classic {:mvn/version "1.4.14"}
io.github.cognitect-labs/test-runner {:git/url "https://github.com/cognitect-labs/test-runner.git" :sha "cc75980b43011773162b485f46f939dc5fba91e4"}
org.clojure/test.check {:mvn/version "1.1.1"}
com.datomic/local {:mvn/version "1.0.285"} ; for hyperfiddle.transaction-test
com.datomic/client-cloud {:mvn/version "1.0.130"} ; for hyperfiddle.transaction-test
thheller/shadow-cljs {:mvn/version "2.26.2"} ; for hooks tests
ring/ring-core {:mvn/version "1.11.0"}
}}
:build {:extra-paths ["src-build"]
:ns-default build
:extra-deps {io.github.clojure/tools.build {:mvn/version "0.9.6"}
slipset/deps-deploy {:mvn/version "0.2.2"}}}}}
2 changes: 0 additions & 2 deletions docs/clojure-compat-matrix.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ We target full Clojure/Script compatibility (say 99%). That means you can take a

Gaps:

- no variable e/fn arity yet
- no recursion yet - see workaround in [src-docs/user/electric/electric_recursion](https://github.com/hyperfiddle/electric/blob/master/src-docs/user/electric/electric_recursion.cljc)
- reactive multimethods
- reactive protocols
- ...
10 changes: 0 additions & 10 deletions scratch/.replit

This file was deleted.

72 changes: 0 additions & 72 deletions scratch/viz.clj

This file was deleted.

48 changes: 11 additions & 37 deletions shadow-cljs.edn
Original file line number Diff line number Diff line change
@@ -1,42 +1,16 @@
{:builds {:dev {:target :browser
:devtools {:watch-dir "resources-demo/public" ; live reload CSS
:hud #{:errors :progress}
:ignore-warnings true ; warnings don't prevent hot-reload
:loader-mode :default ; faster reload
}
:output-dir "resources-demo/public/js"
:asset-path "/js"
:modules {:main {:entries [user]
:init-fn user/start!}}
:build-hooks [(shadow.cljs.build-report/hook {:output-to "target/build_report.html"})
(user/rcf-shadow-hook)]}
:test {:target :node-test
;; All namespaces are tested by default to encourage tested code.
;; Use :ns-regexp to blacklist specific namespaces.
;; ^(?!foo.(bar|baz)).* : includes everything except foo.bar or foo.baz

{:builds {:test {:target :node-test
:output-to "out/node-tests.js"
:ns-regexp "^(hyperfiddle.electric-[^dom|fulcro]|contrib.(ednish|sexpr-router|missionary-contrib-test|stacktrace)).*$"
:ns-regexp "^(?!contrib.(electric-codemirror|datomic)|hyperfiddle.(api|popover|spool|spec|electric-fulcro|electric.impl.compiler-test|electric.impl.cljs-file-to-analyze)).*"
:build-options {:cache-level :off}
:modules {:main {:entries [hyperfiddle.zero
hyperfiddle.electric
hyperfiddle.electric-test
#_hyperfiddle.missionary-test
contrib.missionary-contrib-test
contrib.ednish
contrib.sexpr-router]}}
:compiler-options {:warnings {:redef-in-file false}}}
:compiler-options {:reader-features #{:node} ; allow #?(:node …, :cljs …), falls back to :cljs.
:warnings {:redef-in-file false}}}
:browser-test {:target :karma
:output-to "out/karma-tests.js"
:ns-regexp "^(hyperfiddle.electric-[^fulcro]|contrib.(ednish|sexpr-router|missionary-contrib-test|stacktrace)).*$"
:ns-regexp "^(?!contrib.(electric-codemirror|datomic)|hyperfiddle.(api|popover|spool|spec|electric-fulcro|electric.impl.compiler-test|electric.impl.cljs-file-to-analyze)).*"
:build-options {:cache-level :off}
:build-hooks [(hyperfiddle.browser-test-setup/blow-up-tests-on-warnings)]
:modules {:main {:entries [hyperfiddle.zero
hyperfiddle.electric
hyperfiddle.electric-test
#_hyperfiddle.missionary-test
contrib.missionary-contrib-test
contrib.ednish
contrib.sexpr-router]}}
:compiler-options {:warnings-as-errors {:warning-types #{:infer-warning}}}}
:prod {:target :browser
:output-dir "resources-demo/public/js"
:asset-path "/js"
:module-hash-names true
:modules {:main {:entries [prod] :init-fn prod/start!}}}}}
:build-hooks [(hyperfiddle.browser-test-setup/blow-up-tests-on-warnings)]
:compiler-options {:warnings-as-errors {:warning-types #{:infer-warning}}}}}}
Loading

0 comments on commit 1972c90

Please sign in to comment.