Skip to content

Commit

Permalink
Upgrade JavaFX to 21.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
jpmonettas committed Dec 7, 2023
1 parent 63a713e commit f813121
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 168 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
- Add navigation undo/redo system

### Changes

- Upgrade JavaFX to 21.0.1
- Push minimal supported JDK version to 17 with a path for using it with 11

### Bugs fixed

Expand Down
2 changes: 1 addition & 1 deletion Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ ClojureScriptStorm latest stable releases :

# Prerequisites

- jdk11+
- jdk17+ (if you still need to run it with jdk11 take a look at [here](https://flow-storm.github.io/flow-storm-debugger/user_guide.html#_run_with_jdk_11))
- clojure 1.11.0+
- clojure 1.10.* only supported if you use it from source, like `{:git/url "https://github.com/flow-storm/flow-storm-debugger" :git/sha "..."}`

Expand Down
9 changes: 5 additions & 4 deletions deps.edn
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@
io.github.clojure/tools.build {:mvn/version "0.9.4" :exclusions [com.google.guava/guava org.slf4j/slf4j-nop]}
com.github.flow-storm/hansel {:mvn/version "0.1.79"}

org.openjfx/javafx-controls {:mvn/version "19.0.2"}
org.openjfx/javafx-base {:mvn/version "19.0.2"}
org.openjfx/javafx-graphics {:mvn/version "19.0.2"}
org.openjfx/javafx-swing {:mvn/version "19.0.2"}
org.openjfx/javafx-controls {:mvn/version "21.0.1"}
org.openjfx/javafx-base {:mvn/version "21.0.1"}
org.openjfx/javafx-graphics {:mvn/version "21.0.1"}
org.openjfx/javafx-swing {:mvn/version "21.0.1"}

org.kordamp.ikonli/ikonli-javafx {:mvn/version "11.5.0"}
org.kordamp.ikonli/ikonli-materialdesign-pack {:mvn/version "11.5.0"}
com.github.jpmonettas/j-system-theme-detector {:mvn/version "3.8.1"}
Expand Down
65 changes: 8 additions & 57 deletions docs/user_guide.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Before you start check _FlowStorm_ minimum requirements.
[IMPORTANT]
.Minimum requirements
====
- jdk >= 11
- jdk >= 17 (if you still need to run it with jdk11 take a look at <<#_run_with_jdk_11,here>>)
- Clojure >= 1.10.0
====

Expand Down Expand Up @@ -65,14 +65,6 @@ but it will be cached unless you run with -Sforce.
It is much safer to just write the latest versions. Check out the https://github.com/flow-storm/flow-storm-debugger/[github page] for the latest stable releases.
====

[IMPORTANT]
.On using MacOS
====
There is a known issue that makes the UI crash when starting on some versions of MacOS, due to JavaFx/OpenJDK/MacOS incompatibilities.
Luckly there is a fix for it <<#_ui_doesnt_work_on_macos,here>>.
====


Pasting that command on your terminal will bring up a repl with _FlowStorm_ and the compiler swapped by _ClojureStorm_. When the repl comes up just
evaluate the `:tut/basics` keyword on it for a tour of the basics.

Expand Down Expand Up @@ -161,13 +153,6 @@ user> (require '[flow-storm.api :as fs-api]) ;; the only namespace you need to r
user> (fs-api/local-connect) ;; will run the debugger GUI and get everything ready
----

[IMPORTANT]
.On using MacOS
====
There is a known issue that makes the UI crash when starting on some versions of MacOS, due to JavaFx/OpenJDK/MacOS incompatibilities.
Luckly there is a fix for it <<#_ui_doesnt_work_on_macos,here>>.
====

You should now see a empty debugger window.

Lets debug something :
Expand Down Expand Up @@ -292,13 +277,6 @@ when your need it, run the debugger ui with your shadow-cljs.edn data :
clj -Sforce -Sdeps '{:deps {com.github.flow-storm/flow-storm-dbg {:mvn/version "RELEASE"}}}' -X flow-storm.debugger.main/start-debugger :port 9000 :repl-type :shadow :build-id :my-app
----

[IMPORTANT]
.On using MacOS
====
There is a known issue that makes the UI crash when starting on some versions of MacOS, due to JavaFx/OpenJDK/MacOS incompatibilities.
Luckly there is a fix for it <<#_ui_doesnt_work_on_macos,here>>.
====

Now since we started the app with `flowstorm.startRecording=false` you will have to click on the record button once to start recording.
Whenever recording is enable and something executes under an instrumented namespace you should see the recordings appear in the debugger
under the main thread.
Expand Down Expand Up @@ -1615,47 +1593,20 @@ The first argument is a options map, which accepts `:verbose? :true`, in which c

Is useful when you have instrumented a big application and wish to see tracing progress while running.

=== UI doesn't work on MacOs
=== Run with JDK 11

There are reports of people running into issues when trying to start the FlowStorm UI on Mac OS, that looks like this :
FlowStorm UI requires JDK >= 17. If you can't upgrade your JDK you can still use it by downgrading JavaFx.

----
user=> :dbg
2023-10-25 12:45:42.828 java[20967:14795350] WARNING: Secure coding is automatically enabled for restorable state! However, not on all supported macOS versions of this application.
Opt-in to secure coding explicitly by implementing NSApplicationDelegate.applicationSupportsSecureRestorableState:.
Oct 25, 2023 12:45:42 PM com.sun.javafx.application.PlatformImpl startup
WARNING: Unsupported JavaFX configuration: classes were loaded from 'unnamed module @5b2c883c'
Waiting for full system start before dispatching events
2023-10-25 12:45:43.526 java[20967:14795350] Assertion failure in -[_NSTrackingAreaAKViewHelper removeTrackingRect:], _NSTrackingAreaAKManager.m:1713
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '0x0 is an invalid NSTrackingRectTag.
Common possible reasons for this are: 1. already removed this trackingRectTag, 2. Truncated the NSTrackingRectTag to 32bit at some point.'
....
----

This is because of an incompatibility between some versions of Mac OS, JavaFX and openJDK.

Luckily there are a couple of solutions :

- moving to https://adoptium.net/installation/[temurin] seems to solve it
- or if you are on Jdk >= 17 you can add the following dependencies to your alias
If that is the case add this dependencies to your alias :

[,clojure]
----
org.openjfx/javafx-controls {:mvn/version "22-ea+11"}
org.openjfx/javafx-base {:mvn/version "22-ea+11"}
org.openjfx/javafx-graphics {:mvn/version "22-ea+11"}
org.openjfx/javafx-swing {:mvn/version "22-ea+11"}
org.openjfx/javafx-controls {:mvn/version "19.0.2"}
org.openjfx/javafx-base {:mvn/version "19.0.2"}
org.openjfx/javafx-graphics {:mvn/version "19.0.2"}
org.openjfx/javafx-swing {:mvn/version "19.0.2"}
----

So the issue seams to be fixed in the latest version of openjfx, the problem is that the latest version only
works with jdk >= 17, and I think we still have a bunch of people on jdk 11.

== Internals, diagrams and documentation

For people interested in enhancing, troubleshooting, fixing or just learning about FlowStorm internals take a look at here :
Expand Down
105 changes: 10 additions & 95 deletions docs/user_guide.html
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,7 @@ <h1>FlowStorm debugger User&#8217;s Guide</h1>
<ul class="sectlevel3">
<li><a href="#_instrument_verbose">25.1. Instrument verbose</a></li>
<li><a href="#_run_verbose">25.2. Run verbose</a></li>
<li><a href="#_ui_doesnt_work_on_macos">25.3. UI doesn&#8217;t work on MacOs</a></li>
<li><a href="#_run_with_jdk_11">25.3. Run with JDK 11</a></li>
</ul>
</li>
<li><a href="#_internals_diagrams_and_documentation">26. Internals, diagrams and documentation</a></li>
Expand Down Expand Up @@ -818,7 +818,7 @@ <h3 id="_quick_start"><a class="anchor" href="#_quick_start"></a><a class="link"
<div class="ulist">
<ul>
<li>
<p>jdk &gt;= 11</p>
<p>jdk &gt;= 17 (if you still need to run it with jdk11 take a look at <a href="#_run_with_jdk_11">here</a>)</p>
</li>
<li>
<p>Clojure &gt;= 1.10.0</p>
Expand Down Expand Up @@ -889,22 +889,6 @@ <h5 id="_clojurestorm"><a class="anchor" href="#_clojurestorm"></a><a class="lin
</tr>
</table>
</div>
<div class="admonitionblock important">
<table>
<tr>
<td class="icon">
<div class="title">Important</div>
</td>
<td class="content">
<div class="title">On using MacOS</div>
<div class="paragraph">
<p>There is a known issue that makes the UI crash when starting on some versions of MacOS, due to JavaFx/OpenJDK/MacOS incompatibilities.
Luckly there is a fix for it <a href="#_ui_doesnt_work_on_macos">here</a>.</p>
</div>
</td>
</tr>
</table>
</div>
<div class="paragraph">
<p>Pasting that command on your terminal will bring up a repl with <em>FlowStorm</em> and the compiler swapped by <em>ClojureStorm</em>. When the repl comes up just
evaluate the <code>:tut/basics</code> keyword on it for a tour of the basics.</p>
Expand Down Expand Up @@ -1035,22 +1019,6 @@ <h5 id="_vanilla_flowstorm"><a class="anchor" href="#_vanilla_flowstorm"></a><a
</span><span class="n">user&gt;</span><span class="w"> </span><span class="p">(</span><span class="nf">fs-api/local-connect</span><span class="p">)</span><span class="w"> </span><span class="c1">;; will run the debugger GUI and get everything ready</span></code></pre>
</div>
</div>
<div class="admonitionblock important">
<table>
<tr>
<td class="icon">
<div class="title">Important</div>
</td>
<td class="content">
<div class="title">On using MacOS</div>
<div class="paragraph">
<p>There is a known issue that makes the UI crash when starting on some versions of MacOS, due to JavaFx/OpenJDK/MacOS incompatibilities.
Luckly there is a fix for it <a href="#_ui_doesnt_work_on_macos">here</a>.</p>
</div>
</td>
</tr>
</table>
</div>
<div class="paragraph">
<p>You should now see a empty debugger window.</p>
</div>
Expand Down Expand Up @@ -1239,22 +1207,6 @@ <h5 id="_clojurescriptstorm_with_shadow_cljs"><a class="anchor" href="#_clojures
<pre class="rouge highlight"><code data-lang="bash">clj <span class="nt">-Sforce</span> <span class="nt">-Sdeps</span> <span class="s1">'{:deps {com.github.flow-storm/flow-storm-dbg {:mvn/version "RELEASE"}}}'</span> <span class="nt">-X</span> flow-storm.debugger.main/start-debugger :port 9000 :repl-type :shadow :build-id :my-app</code></pre>
</div>
</div>
<div class="admonitionblock important">
<table>
<tr>
<td class="icon">
<div class="title">Important</div>
</td>
<td class="content">
<div class="title">On using MacOS</div>
<div class="paragraph">
<p>There is a known issue that makes the UI crash when starting on some versions of MacOS, due to JavaFx/OpenJDK/MacOS incompatibilities.
Luckly there is a fix for it <a href="#_ui_doesnt_work_on_macos">here</a>.</p>
</div>
</td>
</tr>
</table>
</div>
<div class="paragraph">
<p>Now since we started the app with <code>flowstorm.startRecording=false</code> you will have to click on the record button once to start recording.
Whenever recording is enable and something executes under an instrumented namespace you should see the recordings appear in the debugger
Expand Down Expand Up @@ -3351,57 +3303,20 @@ <h4 id="_run_verbose"><a class="anchor" href="#_run_verbose"></a><a class="link"
</div>
</div>
<div class="sect3">
<h4 id="_ui_doesnt_work_on_macos"><a class="anchor" href="#_ui_doesnt_work_on_macos"></a><a class="link" href="#_ui_doesnt_work_on_macos">25.3. UI doesn&#8217;t work on MacOs</a></h4>
<div class="paragraph">
<p>There are reports of people running into issues when trying to start the FlowStorm UI on Mac OS, that looks like this :</p>
</div>
<div class="listingblock">
<div class="content">
<pre>user=&gt; :dbg

2023-10-25 12:45:42.828 java[20967:14795350] WARNING: Secure coding is automatically enabled for restorable state! However, not on all supported macOS versions of this application.
Opt-in to secure coding explicitly by implementing NSApplicationDelegate.applicationSupportsSecureRestorableState:.

Oct 25, 2023 12:45:42 PM com.sun.javafx.application.PlatformImpl startup

WARNING: Unsupported JavaFX configuration: classes were loaded from 'unnamed module @5b2c883c'

Waiting for full system start before dispatching events

2023-10-25 12:45:43.526 java[20967:14795350] Assertion failure in -[_NSTrackingAreaAKViewHelper removeTrackingRect:], _NSTrackingAreaAKManager.m:1713

Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '0x0 is an invalid NSTrackingRectTag.
Common possible reasons for this are: 1. already removed this trackingRectTag, 2. Truncated the NSTrackingRectTag to 32bit at some point.'
....</pre>
</div>
</div>
<h4 id="_run_with_jdk_11"><a class="anchor" href="#_run_with_jdk_11"></a><a class="link" href="#_run_with_jdk_11">25.3. Run with JDK 11</a></h4>
<div class="paragraph">
<p>This is because of an incompatibility between some versions of Mac OS, JavaFX and openJDK.</p>
<p>FlowStorm UI requires JDK &gt;= 17. If you can&#8217;t upgrade your JDK you can still use it by downgrading JavaFx.</p>
</div>
<div class="paragraph">
<p>Luckily there are a couple of solutions :</p>
</div>
<div class="ulist">
<ul>
<li>
<p>moving to <a href="https://adoptium.net/installation/">temurin</a> seems to solve it</p>
</li>
<li>
<p>or if you are on Jdk &gt;= 17 you can add the following dependencies to your alias</p>
</li>
</ul>
<p>If that is the case add this dependencies to your alias :</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="rouge highlight"><code data-lang="clojure"><span class="n">org.openjfx/javafx-controls</span><span class="w"> </span><span class="p">{</span><span class="no">:mvn/version</span><span class="w"> </span><span class="s">"22-ea+11"</span><span class="p">}</span><span class="w">
</span><span class="n">org.openjfx/javafx-base</span><span class="w"> </span><span class="p">{</span><span class="no">:mvn/version</span><span class="w"> </span><span class="s">"22-ea+11"</span><span class="p">}</span><span class="w">
</span><span class="n">org.openjfx/javafx-graphics</span><span class="w"> </span><span class="p">{</span><span class="no">:mvn/version</span><span class="w"> </span><span class="s">"22-ea+11"</span><span class="p">}</span><span class="w">
</span><span class="n">org.openjfx/javafx-swing</span><span class="w"> </span><span class="p">{</span><span class="no">:mvn/version</span><span class="w"> </span><span class="s">"22-ea+11"</span><span class="p">}</span></code></pre>
</div>
<pre class="rouge highlight"><code data-lang="clojure"><span class="n">org.openjfx/javafx-controls</span><span class="w"> </span><span class="p">{</span><span class="no">:mvn/version</span><span class="w"> </span><span class="s">"19.0.2"</span><span class="p">}</span><span class="w">
</span><span class="n">org.openjfx/javafx-base</span><span class="w"> </span><span class="p">{</span><span class="no">:mvn/version</span><span class="w"> </span><span class="s">"19.0.2"</span><span class="p">}</span><span class="w">
</span><span class="n">org.openjfx/javafx-graphics</span><span class="w"> </span><span class="p">{</span><span class="no">:mvn/version</span><span class="w"> </span><span class="s">"19.0.2"</span><span class="p">}</span><span class="w">
</span><span class="n">org.openjfx/javafx-swing</span><span class="w"> </span><span class="p">{</span><span class="no">:mvn/version</span><span class="w"> </span><span class="s">"19.0.2"</span><span class="p">}</span></code></pre>
</div>
<div class="paragraph">
<p>So the issue seams to be fixed in the latest version of openjfx, the problem is that the latest version only
works with jdk &gt;= 17, and I think we still have a bunch of people on jdk 11.</p>
</div>
</div>
</div>
Expand Down Expand Up @@ -3433,7 +3348,7 @@ <h3 id="_internals_diagrams_and_documentation"><a class="anchor" href="#_interna
</div>
<div id="footer">
<div id="footer-text">
Last updated 2023-11-30 14:50:05 -0300
Last updated 2023-12-07 10:54:44 -0300
</div>
</div>
</body>
Expand Down
37 changes: 26 additions & 11 deletions src-inst/flow_storm/storm_api.clj
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,29 @@
(println))

(defn maybe-execute-flow-storm-specials [input]
(case input
:dbg (do (start-debugger) true)
:ex (do (jump-to-last-exception) true)
:last (do (jump-to-last-expression) true)
:rec (do (dbg-api/set-recording true) true)
:stop (do (dbg-api/set-recording false) true)

:tut/basics (do ((requiring-resolve 'flow-storm.tutorials.basics/start)) true)
:tut/next (do ((requiring-resolve 'flow-storm.tutorials.basics/step-next)) true)
:tut/prev (do ((requiring-resolve 'flow-storm.tutorials.basics/step-prev)) true)
false))
(try
(case input
:dbg (do (start-debugger) true)
:ex (do (jump-to-last-exception) true)
:last (do (jump-to-last-expression) true)
:rec (do (dbg-api/set-recording true) true)
:stop (do (dbg-api/set-recording false) true)

:tut/basics (do ((requiring-resolve 'flow-storm.tutorials.basics/start)) true)
:tut/next (do ((requiring-resolve 'flow-storm.tutorials.basics/step-next)) true)
:tut/prev (do ((requiring-resolve 'flow-storm.tutorials.basics/step-prev)) true)
false)

(catch Exception e
(when (or (instance? UnsupportedClassVersionError e)
(and (.getCause e) (instance? UnsupportedClassVersionError (.getCause e))))
(println "\n\nFlowStorm UI requires JDK >= 17. If you can't upgrade your JDK you can still use it by downgrading JavaFx.")
(println "\nIf that is the case add this dependencies to your alias :\n")
(println " org.openjfx/javafx-controls {:mvn/version \"19.0.2\"}")
(println " org.openjfx/javafx-base {:mvn/version \"19.0.2\"}")
(println " org.openjfx/javafx-graphics {:mvn/version \"19.0.2\"}")
(println " org.openjfx/javafx-swing {:mvn/version \"19.0.2\"}")
(println)
)

false)))

0 comments on commit f813121

Please sign in to comment.