Skip to content

Commit 8ee364c

Browse files
committed
Big patch
1 parent cdf7d45 commit 8ee364c

File tree

29 files changed

+1717
-283
lines changed

29 files changed

+1717
-283
lines changed

.github/workflows/test.yaml

Lines changed: 34 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ jobs:
117117
shell: powershell
118118

119119
# Self-host Tests
120+
120121
self-host-test:
121122
name: Self-host Tests
122123
runs-on: ubuntu-latest
@@ -152,15 +153,16 @@ jobs:
152153
restore-keys: |
153154
${{ runner.os }}-${{ env.cache-name }}-
154155
155-
- name: Build tests
156-
run: clojure -M:selfhost.test.build
156+
# - name: Build tests
157+
# run: clojure -M:selfhost.test.build
157158

158-
- name: Run tests
159-
run: |
160-
node builds/out-self/core-self-test.js | tee test-out.txt
161-
grep -qxF '0 failures, 0 errors.' test-out.txt
159+
# - name: Run tests
160+
# run: |
161+
# node builds/out-self/core-self-test.js | tee test-out.txt
162+
# grep -qxF '0 failures, 0 errors.' test-out.txt
162163

163164
# Self-parity Tests
165+
164166
self-parity-test:
165167
name: Self-parity Tests
166168
runs-on: ubuntu-latest
@@ -194,15 +196,15 @@ jobs:
194196
path: ~/.gitlibs
195197
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('deps.edn', '*/deps.edn') }}
196198
restore-keys: |
197-
${{ runner.os }}-${{ env.cache-name }}-
199+
${{ runner.os }}-${{ env.cache-name }}-
198200
199-
- name: Build tests
200-
run: clojure -M:selfparity.test.build
201+
# - name: Build tests
202+
# run: clojure -M:selfparity.test.build
201203

202-
- name: Run tests
203-
run: |
204-
node builds/out-self-parity/main.js | tee test-out.txt
205-
grep -qxF '0 failures, 0 errors.' test-out.txt
204+
# - name: Run tests
205+
# run: |
206+
# node builds/out-self-parity/main.js | tee test-out.txt
207+
# grep -qxF '0 failures, 0 errors.' test-out.txt
206208

207209
# Compiler Tests
208210
compiler-test:
@@ -301,11 +303,22 @@ jobs:
301303
restore-keys: |
302304
${{ runner.os }}-${{ env.cache-name }}-
303305
304-
- name: Build Uberjar
305-
run: ./script/uberjar
306-
307-
- name: Run tests
308-
run: |
309-
unset JAVA_TOOL_OPTIONS
310-
clojure -M:cli.test.run | tee test-out.txt
311-
grep -qxF '0 failures, 0 errors.' test-out.txt
306+
# - name: Cache gitlibs
307+
# uses: actions/cache@v2
308+
# env:
309+
# cache-name: cache-gitlibs
310+
# with:
311+
# path: ~/.gitlibs
312+
# key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('**/deps.edn') }}
313+
# restore-keys: |
314+
# ${{ runner.os }}-${{ env.cache-name }}-
315+
316+
# - name: Build Uberjar
317+
# run: ./script/uberjar
318+
319+
# - name: Run tests
320+
# run: |
321+
# unset JAVA_TOOL_OPTIONS
322+
# clojure -M:cli.test.run | tee test-out.txt
323+
# grep -qxF '0 failures, 0 errors.' test-out.txt
324+

CHANGELOG.md

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# Changelog
2+
3+
## master (unreleased)
4+
5+
### New Features
6+
7+
- Add support for auto-prefixes via cljs.storm.instrumentAutoPrefixes
8+
9+
### Changes
10+
11+
- Instrumentation is enable by default unless cljs.storm.instrumentEnable is set to false
12+
13+
### Bugs fixed
14+
15+
## 1.12.42-1 (25-09-2025)
16+
17+
### New Features
18+
19+
- Allow for multiple instrumentation prefixes properties useful for plugins
20+
21+
### Changes
22+
23+
### Bugs fixed
24+
25+
## 1.11.132-9 (13-03-2024)
26+
27+
### New Features
28+
29+
### Changes
30+
31+
### Bugs fixed
32+
33+
- Fix functions with docstrings evaluated via the shadow repl not compiling
34+
35+
## 1.11.132-8 (12-12-2024)
36+
37+
### New Features
38+
39+
### Changes
40+
41+
- Add debugger and bookmark macros for FlowStorm ergonomics
42+
43+
### Bugs fixed
44+
45+
## 1.11.132-7 (30-10-2024)
46+
47+
### New Features
48+
49+
### Changes
50+
51+
- Add cljs.storm.utils to compiler cljs path to get rid of a weird warning
52+
53+
### Bugs fixed
54+
55+
## 1.11.132-6 (22-08-2024)
56+
57+
### New Features
58+
59+
- Add :emitted-coords to trace-form-init-fn form-data
60+
61+
### Changes
62+
63+
### Bugs fixed
64+
65+
## 1.11.132-5 ()
66+
67+
### New Features
68+
69+
### Changes
70+
71+
### Bugs fixed
72+
73+
- Fix for working with shadow-cljs >= 2.28.10
74+
75+
## 1.11.132-3 (06-04-2024)
76+
77+
### New Features
78+
79+
- Add support for instr skip regex management
80+
81+
### Changes
82+
83+
### Bugs fixed

README.md

Lines changed: 81 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -1,87 +1,95 @@
1-
## What is ClojureScript? ##
1+
# ClojureScriptStorm
22

3-
[ClojureScript](https://clojurescript.org) is a compiler for [Clojure](https://clojure.org) that targets JavaScript. It is designed to emit JavaScript code which is compatible with the advanced compilation mode of the [Google Closure](https://developers.google.com/closure/compiler/) optimizing compiler.
3+
## Intro
4+
Welcome to the ClojureScriptStorm repository. ClojureScriptStorm is a fork of the [official ClojureScript
5+
compiler](https://github.com/clojure/clojurescript), with some extra code added to make it a dev compiler.
6+
This means a compiler with some extra capabilities tailored for development.
47

5-
Official web site: https://clojurescript.org
8+
ClojureScriptStorm will add instrumentation (extra javascript) to trace everything that is happening as your programs
9+
execute. You use it by providing a bunch of callbacks that ClojureScriptStorm will call as code runs.
610

7-
## Releases and dependency information ##
11+
## Starting a repl with ClojureScriptStorm
812

9-
Latest stable release: 1.12.116
1013

11-
* [All released versions](https://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22org.clojure%22%20AND%20a%3A%22clojurescript%22)
14+
```bash
15+
clj -J-Dcljs.storm.instrumentOnlyPrefixes=dev -J-Dcljs.storm.instrumentEnable=true -Sdeps '{:paths ["src"] :deps {com.github.flow-storm/clojurescript {:mvn/version "RELEASE"}}}' -M -m cljs.main --repl
16+
```
1217

13-
[Clojure deps.edn](http://clojure.org/guides/deps_and_cli) dependency information:
18+
The important bits here are :
19+
20+
- add the ClojureScriptStorm dependency
21+
- tell ClojureScriptStorm what namespaces to instrument via `instrumentOnlyPrefixes` in this case `dev`
22+
23+
## Hooking into ClojureScriptStorm
24+
25+
```clojure
26+
(set! cljs.storm.tracer/trace-fn-call-fn
27+
(fn [_ fn-ns fn-name fn-args-vec form-id]
28+
(prn "fn-call " fn-ns fn-name fn-args-vec form-id)))
29+
(set! cljs.storm.tracer/trace-fn-return-fn
30+
(fn [_ ret coord form-id]
31+
(prn "fn-return" ret coord form-id)))
32+
(set! cljs.storm.tracer/trace-fn-unwind-fn
33+
(fn [_ error coord form-id]
34+
(prn "fn-unwind" error coord form-id)))
35+
(set! cljs.storm.tracer/trace-expr-fn
36+
(fn [_ val coord form-id]
37+
(prn "expr" val coord form-id)))
38+
(set! cljs.storm.tracer/trace-bind-fn
39+
(fn [_ coord sym-name bind-val]
40+
(prn "bind" coord sym-name bind-val)))
41+
(set! cljs.storm.tracer/trace-form-init-fn
42+
(fn [form-data]
43+
(prn "form-data" form-data)))
44+
```
1445

15-
```
16-
org.clojure/clojurescript {:mvn/version "1.12.116"}
17-
```
46+
Once that is set, you could try something like this :
1847

19-
[Leiningen](https://github.com/technomancy/leiningen/) dependency information:
48+
```clojure
49+
user=> (ns dev)
50+
...
51+
dev=> (defn sum [a b] (+ a b))
2052

21-
```
22-
[org.clojure/clojurescript "1.12.116"]
23-
```
53+
"form-data" {:form-id -133716645, :ns "dev", :form (defn sum [a b] (+ a b)), :file nil, :line nil}
2454

25-
[Maven](https://maven.apache.org) dependency information:
55+
dev=> (sum 4 5)
56+
57+
"fn-call " "dev" "sum" #js {"0" 4, "1" 5} -133716645
58+
"bind" "" "a" 4
59+
"bind" "" "b" 5
60+
"expr" 4 "3,1" -133716645
61+
"expr" 5 "3,2" -133716645
62+
"fn-return" 9 "3" -133716645
63+
"expr" 9 "" -1067876745
64+
"form-data" {:form-id -1067876745, :ns "dev", :form (sum 4 5), :file nil, :line nil}
65+
"expr" "9" "" nil
66+
9
2667

2768
```
28-
<dependency>
29-
<groupId>org.clojure</groupId>
30-
<artifactId>clojurescript</artifactId>
31-
<version>1.12.116</version>
32-
</dependency>
69+
70+
## Forms and coordinates
71+
72+
The example above shows your callbacks receiving form ids and coordinates, let's see how you can use them.
73+
74+
The form-id on each fn-call, fn-return and expr corresponds with the data received by on `trace-form-init-fn`.
75+
This function will be called once, when the form is defined in the runtime.
76+
77+
Coords are strings with the coordinates inside the form tree.
78+
In the case of our sum form, "2,1" means the third element (the `[a b]` vector), and then the first one `a`.
79+
Coordinates also work with unordered literals like sets, and maps with more than 8 keys.
80+
81+
If you want utility funcitons to work with forms and coordinates take a look at
82+
[get-form-at-coord](https://github.com/flow-storm/hansel/blob/master/src/hansel/utils.cljc#L74-L78) for example.
83+
84+
## Controlling instrumentation without restarting the repl
85+
86+
You can add/remove instrumentation prefixes without restarting the repl by calling :
87+
88+
```clojure
89+
(cljs.storm.api/add-instr-prefix "my-app")
90+
(cljs.storm.api/rm-instr-prefix "my-app")
3391
```
3492

35-
## Getting Started ##
36-
37-
* Read the [Quick Start](https://clojurescript.org/guides/quick-start) guide.
38-
* Read the [Documentation](https://clojurescript.org).
39-
* Try a [tutorial](https://clojurescript.org/guides).
40-
* [Companies using ClojureScript](https://clojurescript.org/community/companies)
41-
42-
## Questions, Feedback? ##
43-
44-
Please point all of your questions and feedback to the
45-
[Clojure mailing list](https://groups.google.com/group/clojure). There
46-
is a community run
47-
[ClojureScript user mailing list](https://groups.google.com/group/clojurescript) and
48-
the IRC channel, `#clojurescript` on [freenode.net](https://freenode.net/), is quite active.
49-
There is also a community run [Slack channel](https://clojurians.slack.com). The
50-
Jira bug/feature tracking application is located at
51-
<https://clojure.atlassian.net/browse/CLJS>. Before submitting issues
52-
please read the
53-
[Reporting Issues](https://github.com/clojure/clojurescript/wiki/Reporting-Issues)
54-
page first.
55-
56-
## Developers Welcome ##
57-
58-
ClojureScript operates under the same license as Clojure. All
59-
contributors must have a signed CA (Contributor's Agreement) and
60-
submit their patch via the appropriate channels. If you're interested
61-
in contributing to the project, please see the
62-
[contributing](https://clojure.org/dev/contributing) page on
63-
[clojure.org](https://clojure.org). For more information about working
64-
on the compiler and testing check the
65-
[Developer section of the wiki](https://github.com/clojure/clojurescript/wiki/Developers).
66-
67-
YourKit
68-
----
69-
70-
<img src="https://www.yourkit.com/images/yklogo.png"></img>
71-
72-
YourKit has given an open source license for their profiler, greatly simplifying the profiling of ClojureScript performance.
73-
74-
YourKit supports open source projects with its full-featured Java Profiler.
75-
YourKit, LLC is the creator of <a href="https://www.yourkit.com/java/profiler/index.jsp">YourKit Java Profiler</a>
76-
and <a href="https://www.yourkit.com/.net/profiler/index.jsp">YourKit .NET Profiler</a>,
77-
innovative and intelligent tools for profiling Java and .NET applications.
78-
79-
## License ##
80-
81-
Copyright (c) Rich Hickey. All rights reserved. The use and
82-
distribution terms for this software are covered by the Eclipse
83-
Public License 1.0 (https://opensource.org/license/epl-1-0/)
84-
which can be found in the file epl-v10.html at the root of this
85-
distribution. By using this software in any fashion, you are
86-
agreeing to be bound by the terms of this license. You must
87-
not remove this notice, or any other, from this software.
93+
## Applications using ClojureScriptStorm
94+
95+
* [FlowStorm debugger](http://www.flow-storm.org)

deps.edn

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
:deps
33
{com.google.javascript/closure-compiler {:mvn/version "v20250820"}
44
com.cognitect/transit-java {:mvn/version "1.0.362"}
5-
org.clojure/clojure {:mvn/version "1.10.0"}
65
org.clojure/core.specs.alpha {:mvn/version "0.1.24"}
76
org.clojure/google-closure-library {:mvn/version "0.0-20250515-f04e4c0e"}
87
org.clojure/spec.alpha {:mvn/version "0.1.143"}
@@ -23,14 +22,38 @@
2322
"-e" "(cljs.test-runner/-main)"]}
2423
:runtime.test.build {:extra-paths ["src/test/cljs"]
2524
:main-opts ["-m" "cljs.main" "-co" "resources/test.edn" "-c"]}
25+
2626
:lite.test.build {:extra-paths ["src/test/cljs"]
2727
:main-opts ["-m" "cljs.main" "-co" "resources/lite_test.edn" "-c"]}
28+
29+
30+
:runtime.storm.test.build {:extra-paths ["src/test/cljs"]
31+
:jvm-opts ["-Dcljs.storm.instrumentOnlyPrefixes=cljs.storm.tests-code"
32+
"-Dcljs.storm.instrumentEnable=true"]
33+
:main-opts ["-m" "cljs.main" "-co" "resources/storm_test.edn" "-c"]}
34+
2835
:selfhost.test.build {:extra-paths ["src/test/self"]
2936
:main-opts ["-m" "cljs.main" "-co" "resources/self_host_test.edn" "-c"]}
3037
:selfparity.test.build {:extra-paths ["src/test/self"]
3138
:main-opts ["-i" "src/test/self/self_parity/setup.clj"
3239
"-e" "(self-parity.setup/-main)"
3340
"-m" "cljs.main" "-co" "resources/self_parity_test.edn" "-c"]}
41+
:shadow-test-storm {:extra-paths ["src/test/cljs"]
42+
:jvm-opts ["-Dcljs.storm.instrumentOnlyPrefixes=cljs.storm.tests-code"
43+
"-Dcljs.storm.instrumentEnable=true"]
44+
:classpath-overrides {org.clojure/clojurescript nil}
45+
:extra-deps {thheller/shadow-cljs {:mvn/version "2.25.6"
46+
:exclusions [org.clojure/clojurescript]}
47+
com.github.jpmonettas/clojurescript {:local/root "./"}}}
3448
:uberjar {:extra-deps {com.github.seancorfield/depstar {:mvn/version "2.0.193"}}
3549
:exec-fn hf.depstar/uberjar
36-
:exec-args {:aot true}}}}
50+
:exec-args {:aot true}}
51+
:storm {:classpath-overrides {org.clojure/clojure nil}
52+
:extra-deps {com.github.jpmonettas/clojure {:mvn/version "1.11.1-8"}
53+
com.github.jpmonettas/flow-storm-dbg {:mvn/version "3.7.1"}}
54+
:jvm-opts ["-Dproject-name=CLJSCompiler"
55+
"-Xmx20000m" "-Xms20000m"
56+
"-Dflowstorm.startRecording=false"
57+
"-Dflowstorm.theme=dark"
58+
"-Dclojure.storm.instrumentEnable=true"
59+
"-Dclojure.storm.instrumentOnlyPrefixes=cljs."]}}}

pom.template.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
22
<modelVersion>4.0.0</modelVersion>
3-
<groupId>org.clojure</groupId>
3+
<groupId>com.github.flow-storm</groupId>
44
<artifactId>clojurescript</artifactId>
55
<!-- Version number will be replaced by script/build -->
66
<version>CLOJURESCRIPT_VERSION</version>

0 commit comments

Comments
 (0)