This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-02-02
Channels
- # announcements (26)
- # architecture (29)
- # babashka (8)
- # beginners (91)
- # calva (70)
- # cider (7)
- # circleci (2)
- # cljs-dev (1)
- # clojure (79)
- # clojure-australia (2)
- # clojure-dev (3)
- # clojure-europe (40)
- # clojure-italy (2)
- # clojure-losangeles (4)
- # clojure-nl (4)
- # clojure-uk (4)
- # clojurescript (34)
- # cursive (13)
- # datomic (16)
- # defnpodcast (2)
- # emacs (11)
- # events (1)
- # fulcro (13)
- # graalvm (17)
- # gratitude (3)
- # instaparse (10)
- # introduce-yourself (2)
- # jobs (1)
- # jobs-discuss (5)
- # juxt (3)
- # kaocha (5)
- # meander (5)
- # membrane (2)
- # nextjournal (43)
- # off-topic (42)
- # pathom (52)
- # pedestal (8)
- # portal (3)
- # rdf (2)
- # re-frame (10)
- # reveal (21)
- # shadow-cljs (56)
- # slack-help (7)
- # vim (33)
- # xtdb (43)
What would be a good set of beginner materials for someone looking to make a simple clojure/script client and server for a small webapp? Are the old modern-cljs tutorials still relevant? I feel like cljs moves fast enough that 4 years out of date is likely pretty old by now.
(I'm looking to make a simple blog, but in order to stretch my skillset a little bit I've decided I want to do full stack with it and go above and beyond on features compared to a static site, like allowing comments via oauth connected applications or something similar)
Ideally something that uses deps.edn/the clojure cli, but that's not a requirement
@suskeyhose you can try to read https://pragprog.com/titles/dswdcloj3/web-development-with-clojure-third-edition/ is pretty new
Thanks!
@suskeyhose also if you're not going to reach for modern JS stuff and want to keep it really simple - lots of old content is quite accurate
a Ring server + plain ClojureScript can go a long way especially if you're not building anything complicated UI-wise
That's fair, and is likely what I'd like to do. I've had a friend help out with getting shadow set up, and I know enough about reagent to get by.
yes just Google Closure Library if you're doing something simple to avoid JS ecosystem complications
I was initially wanting something more complex with some SSR going on so that the client wouldn't have to render an md file to html with cybermonday, but could still use reagent to represent the rest of the UI, but at this stage that just seems infeasible unless I made it server-side components, which is a big thing I don't really want to get into yet.
Sometimes I find that after a :whitespace
, :simple
, or :advanced
compilation, I get browser console errors like the following:
main.js:47 goog.require could not find: goog.Disposable
main.js:47 goog.require could not find: goog.asserts
main.js:47 goog.require could not find: goog.debug.EntryPointMonitor
main.js:47 goog.require could not find: goog.debug.Error
I have pretty minimal compiler options, and no node dependencies. Why might a few Google Closure namespaces be missing?
(cljs.build.api/build {:output-dir "compiled"
:output-to "compiled/js/main.js"
:asset-path "/js"
:main "main.core"
:optimizations :whitespace
:target :browser})
I am trying to open a PDF file inside Modal. I tried to use embed
in clojurescript but it is showing me blank. How can we use embed
in cljs?
> Keep in mind that most modern browsers have deprecated and removed support for browser plug-ins, so relying upon `<embed>` is generally not wise if you want your site to be operable on the average user's browser.
With that being said, CLJS has nothing to do with this. <embed>
tag is a standard functionality - if it works, it should work everywhere. You'd use it in CLJS the same exact way you'd use it anywhere else.
If something doesn't work here, then the problem is elsewhere. Maybe React (assuming you're using it - you haven't specified) doesn't like <embed>
, maybe your resource is not available, maybe your browser has some strange restrictions, maybe something else. It's 100% not about CLJS.
@neil.hansen.31 the REPL needs to be aware of changes to Google Closure Library - if Weasel hasn't been kept up-to-date this is going to be a problem
One idea - you copied only the main file from the dev build, instead of using the one from the optimized build.
Does anyone have a good example of how to include css from an npm lib when using the bundle cljs target? Usually this could be done in the entry js file but the bundle target automatically creates that (by default which removes a lot of boilerplate otherwise)
AFAICT people usually do it using a more manual approach. Your build step copies the relevant CSS files to the location from which your web server serves them, and you includes those files in your HTML.