This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-11-15
Channels
- # announcements (11)
- # beginners (66)
- # boot (6)
- # clara (25)
- # cljdoc (4)
- # cljs-dev (22)
- # clojure (261)
- # clojure-dev (1)
- # clojure-europe (2)
- # clojure-italy (15)
- # clojure-losangeles (1)
- # clojure-nl (19)
- # clojure-spec (62)
- # clojure-uk (50)
- # clojurescript (12)
- # community-development (6)
- # cursive (60)
- # datomic (21)
- # emacs (2)
- # figwheel (2)
- # figwheel-main (3)
- # fulcro (2)
- # graphql (11)
- # hyperfiddle (11)
- # javascript (1)
- # jobs (6)
- # juxt (1)
- # kaocha (5)
- # keechma (2)
- # off-topic (4)
- # onyx (10)
- # pathom (7)
- # re-frame (15)
- # reagent (8)
- # remote-jobs (2)
- # ring-swagger (14)
- # shadow-cljs (35)
- # sql (22)
- # testing (9)
- # tools-deps (62)
- # vim (12)
Hopefully this question is in the right channel but what is WildFly? From their site > WildFly is a flexible, lightweight, managed application runtime that helps you build amazing applications. Which I am not entirely sure what that is. Do I need it to run my Clojure application?
So Wildfly, Jetty, Undertow, TomCat, Apache, Nginx all more or less do the same thing?
A person writes a API in Clojure that then becomes a Java application which runs on the JVM which runs along side (Wildfly, Jetty, Undertow...) which runs on a machine?
the Wildfly server runs clojure.main to run your code, more likely
I haven't seen app servers themselves used a lot with clojure, but older clojure code bases often end up looking kind of like an app server
a lot of app servers come with a webserver as part of the environment, and sometimes you can use that webserver without the appserver as well (jetty, undertow)
I think the most common way to run Clojure web applications is with the embedded Jetty server (followed by http-kit and Aleph perhaps?)... Since the Jetty adapter has been bundled with Ring for a long time. I gather Immutant is now available as an embedded server library for Ring as well...
Not just the HTTP server, but the caching, scheduling, and transactions libraries as well.
Yeah, it was only the 1.x version of Immutant that required a JBoss app server in order to run. I remember trying the library version a while back http://immutant.org/documentation/2.1.10/apidoc/guide-web.html
Got it. Its just starts getting difficult to understand when I see terms like web server/app server used interchangeably. Then seeing that an app is deployed to Wildfly using JBoss and i start to get scambled
(Immutant uses Undertow?)
@mario.cordova.862 In the Java world, you'll hear folks talk about Servlet containers, app servers, web servers... but in the Clojure world we can ignore most of that.
You can create a WAR file for container-based deployment but you don't need to.
As someone who was wondering exactly what Mario was wondering very recently, I wish there was some guide on what benefits an application server provides
This page talks about why http://immutant.org/documentation/2.1.10/apidoc/guide-wildfly.html
I think people use eg. Docker with java inside to get most of the benefits
monitoring, automatic restarts or recovery of some sort, log aggregation, etc.
with Docker it's the same tooling / setup you used with Ruby or whatever (a common case)
right - but if you didn't have Docker or Wildfly, you would have to do some goofy things to ensure your process was running, check logs, etc.
In java-land, in the past 5 years, people have also been embedding an 'appserver' into their application instead of deploying their app to some container. See Spring Boot.
What are options for Streaming of text. I don't want to slurp everything into memory at once. is there any way for streaming in Clojure?
Sure, check out line-seq
Is there any obvious way to one incorporate version string into clojurescript build artifacts? (leiningen & cljsbuild)
@marcin.k.chmiel One way is to use :closure-defines
@mfikes thanks. I was unclear, what I meant was to produce files named like when generating jars (i.e. artifact-$projectVersion.js)
@marcin.k.chmiel There is a new feature that will put a fingerprint in the filename (not a version, but a hash)
Ok, got it. I knew it was possible, but forgot everything inside defproject
is quoted. I defined version before and unquotted it in compiler options
(def version "0.1.0-SNAPSHOT")
(def output (str "resources/public/js/main-" version ".js"))
...
:compiler {:optimizations :advanced
:output-to ~output
}
Hmm. Is there some clojury-thing I'm missing here... I'm surprised https://github.com/weavejester/ragtime exists
Why not just use https://flywaydb.org ?
So what I'm asking is: does ragtime offer something that flyway can't, simply because it was written in Clojure?
Hi, I'm trying to add a set of default styles on (for example) a material-ui button. In the code below, I'd like styles
to be applied to the button
- but I'm not sure where/when/how to apply it.
(ns ui.buttons.basic
(:require [reagent.core :as r]
[stylefy.core :as s]
["@material-ui/core/Button" :default Button]))
(def styles {:background-color "red"})
(def button (r/adapt-react-class Button))
I want to be able to (require [ui.buttons.basic :as b])
and use the button with the red background. Am I missing something obvious? I'm using shadow-cljs to have access to material-ui like that...Thanks!Hello everyone. I am wondering if I should place [hiccup "1.0.5"]
under {:dev {:dependencies
or :dependencies [
when is hiccup used?
@somedude314 It depends on how you're using Hiccup -- as part of your dev workflow only, or as part of your intended (production) runtime?
if anything in your running app uses hiccup, don't put it under :dev
The :dev
profile is intended for development-time tooling, not "normal" runtime.
the question is whether any code path compiles hiccup data to html - doing that as a build step would be valid, but not how most people do things
I have a java project with some clojure code that is called from java. For testing I use an in memory h2 database. What is the correct way to test my clojure methods that call a database? My clojure code currently creates a connection pool to whatever database(s) I need to connect to on startup, and I am not sure how to test the methods? How do I connect to the h2 db? How do I setup the code so that it builds the connection pool when running in production but can connect to the h2 db when running tests?
for connecting to the DB you can use https://github.com/clojure/java.jdbc