Skip to content

Commit 84c0d2f

Browse files
committed
Big patch
1 parent 105d3fe commit 84c0d2f

File tree

29 files changed

+1651
-266
lines changed

29 files changed

+1651
-266
lines changed

.github/workflows/test.yaml

Lines changed: 60 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ jobs:
8686
shell: powershell
8787

8888
# Self-host Tests
89+
8990
self-host-test:
9091
name: Self-host Tests
9192
runs-on: macos-14
@@ -121,15 +122,16 @@ jobs:
121122
restore-keys: |
122123
${{ runner.os }}-${{ env.cache-name }}-
123124
124-
- name: Build tests
125-
run: clojure -M:selfhost.test.build
125+
# - name: Build tests
126+
# run: clojure -M:selfhost.test.build
126127

127-
- name: Run tests
128-
run: |
129-
node builds/out-self/core-self-test.js | tee test-out.txt
130-
grep -qxF '0 failures, 0 errors.' test-out.txt
128+
# - name: Run tests
129+
# run: |
130+
# node builds/out-self/core-self-test.js | tee test-out.txt
131+
# grep -qxF '0 failures, 0 errors.' test-out.txt
131132

132133
# Self-parity Tests
134+
133135
self-parity-test:
134136
name: Self-parity Tests
135137
runs-on: macos-14
@@ -163,15 +165,15 @@ jobs:
163165
path: ~/.gitlibs
164166
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('**/deps.edn') }}
165167
restore-keys: |
166-
${{ runner.os }}-${{ env.cache-name }}-
168+
${{ runner.os }}-${{ env.cache-name }}-
167169
168-
- name: Build tests
169-
run: clojure -M:selfparity.test.build
170+
# - name: Build tests
171+
# run: clojure -M:selfparity.test.build
170172

171-
- name: Run tests
172-
run: |
173-
node builds/out-self-parity/main.js | tee test-out.txt
174-
grep -qxF '0 failures, 0 errors.' test-out.txt
173+
# - name: Run tests
174+
# run: |
175+
# node builds/out-self-parity/main.js | tee test-out.txt
176+
# grep -qxF '0 failures, 0 errors.' test-out.txt
175177

176178
# Compiler Tests
177179
compiler-test:
@@ -233,6 +235,7 @@ jobs:
233235
shell: powershell
234236

235237
# CLI Tests
238+
<<<<<<< HEAD
236239
cli-test:
237240
name: CLI Tests
238241
runs-on: macos-14
@@ -269,12 +272,47 @@ jobs:
269272
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('**/deps.edn') }}
270273
restore-keys: |
271274
${{ runner.os }}-${{ env.cache-name }}-
272-
273-
- name: Build Uberjar
274-
run: ./script/uberjar
275-
276-
- name: Run tests
277-
run: |
278-
unset JAVA_TOOL_OPTIONS
279-
clojure -M:cli.test.run | tee test-out.txt
280-
grep -qxF '0 failures, 0 errors.' test-out.txt
275+
=======
276+
277+
# cli-test:
278+
# name: CLI Tests
279+
# runs-on: macos-12
280+
# steps:
281+
# - uses: actions/checkout@v2
282+
# with:
283+
# fetch-depth: 0
284+
285+
# - uses: DeLaGuardo/[email protected]
286+
# with:
287+
# tools-deps: '1.10.1.763'
288+
289+
# - name: Cache maven
290+
# uses: actions/cache@v2
291+
# env:
292+
# cache-name: cache-maven
293+
# with:
294+
# path: ~/.m2
295+
# key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('**/deps.edn') }}
296+
# restore-keys: |
297+
# ${{ runner.os }}-${{ env.cache-name }}-
298+
>>>>>>> ede01ae7 (Big patch)
299+
300+
# - name: Cache gitlibs
301+
# uses: actions/cache@v2
302+
# env:
303+
# cache-name: cache-gitlibs
304+
# with:
305+
# path: ~/.gitlibs
306+
# key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('**/deps.edn') }}
307+
# restore-keys: |
308+
# ${{ runner.os }}-${{ env.cache-name }}-
309+
310+
# - name: Build Uberjar
311+
# run: ./script/uberjar
312+
313+
# - name: Run tests
314+
# run: |
315+
# unset JAVA_TOOL_OPTIONS
316+
# clojure -M:cli.test.run | tee test-out.txt
317+
# grep -qxF '0 failures, 0 errors.' test-out.txt
318+

CHANGELOG.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# Changelog
2+
3+
## master (unreleased)
4+
5+
### New Features
6+
7+
### Changes
8+
9+
### Bugs fixed
10+
11+
## 1.11.132-9 (13-03-2024)
12+
13+
### New Features
14+
15+
### Changes
16+
17+
### Bugs fixed
18+
19+
- Fix functions with docstrings evaluated via the shadow repl not compiling
20+
21+
## 1.11.132-8 (12-12-2024)
22+
23+
### New Features
24+
25+
### Changes
26+
27+
- Add debugger and bookmark macros for FlowStorm ergonomics
28+
29+
### Bugs fixed
30+
31+
## 1.11.132-7 (30-10-2024)
32+
33+
### New Features
34+
35+
### Changes
36+
37+
- Add cljs.storm.utils to compiler cljs path to get rid of a weird warning
38+
39+
### Bugs fixed
40+
41+
## 1.11.132-6 (22-08-2024)
42+
43+
### New Features
44+
45+
- Add :emitted-coords to trace-form-init-fn form-data
46+
47+
### Changes
48+
49+
### Bugs fixed
50+
51+
## 1.11.132-5 ()
52+
53+
### New Features
54+
55+
### Changes
56+
57+
### Bugs fixed
58+
59+
- Fix for working with shadow-cljs >= 2.28.10
60+
61+
## 1.11.132-3 (06-04-2024)
62+
63+
### New Features
64+
65+
- Add support for instr skip regex management
66+
67+
### Changes
68+
69+
### 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 ClojureStorm
812

9-
Latest stable release: 1.12.35
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 ClojureStorm
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.35"}
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.35"]
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.35</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)

0 commit comments

Comments
 (0)