Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
@vlaaad Cool project!
In evaluating
cljfx
I played around with yourcljfx/hn
reference project and ended fixing up a few things along the way. I'm happy to factor out any of these into a separate PR if you'd like any of these changes a la carte:When I started the app, it seems it fanned out too many network requests at once and I hit the (in)famous "Too many open files" issue on my mac.
HTTP exceptions were emitted and dispatched to event/handle but the emitted exceptions did not have an
::event/type
so there were Clojure errors about trying to do a multi-method dispatch onnil
. To fix this, I changed the emitted exceptions to include an::event/type ::event/exception
and I added a simple(defmethod handle ::exception ...)
to put the recent error into the:state
so that the view would render any such errors in red.Incidentally I thought this might be a common issue for others so to eliminate the actual HTTP exceptions, I limited the number of stories rendered (i.e.,
(take 100 ...
).Additionally I was curious about achieving an AOT build, so I added AOT as part of the uberjar build -- it involves leveraging the
(Platform/exit)
'trick' you describe here (seebuild/..
). This also required upgradingdeps.edn
to be compatible with recentclojure
tooling as well as updating and using the latestseancornfield/depstar
capabilities. This demo of AOT build may be interesting to othercljfx
users!I've tested all of this and updated the README to reflect these changes. If any of this is useful to you, great, just wanted to share these changes just in case. Thanks for the cool framework!