Extending JavaScript Libraries from ClojureScript
summary
Claims that ClojureScript simplifies JavaScript interop and that building facade shims lets the same visualization code run in browser and JVM. Uses D3 and ClojureScript macros, threading macros, and clj->js / js->clj coercions to extend jQuery-style chains; team ports parts of D3 to Clojure on the JVM and the dashboard works in both places. Notes a practical pitfall: extracting JS methods and calling them with apply breaks their this binding bug, causing breakage after a D3 upgrade.
AI-written summary · about
chapters (40)
- 0:00Intro
- 1:23Overview
- 1:59Why ClojureScript
- 2:29Cousin Henry
- 3:34Imperial and Metric
- 4:50JavaScript
- 6:00Brendan Eich
- 6:49Variable Scope
- 8:00Variable Scope vs Closure
- 8:23No namespace system
- 9:07jQuery example
- 9:54This is crazy
- 10:11CoffeeScript
- 11:30namespace
- 11:57Hacker News
- 12:36Why Clojure is simpler
- 12:52Only geniuses use functional languages
- 14:22ClojureScript from the start
- 14:34Interop with host system
- 15:14Handling method calls with no arguments
- 15:54Scalar types
- 16:28Rea function
- 16:39Objects
- 16:54Reader literal support
- 17:22Chain call style libraries
- 18:53Breaking the chain
- 19:45Building facades
- 20:25Decoupled code
- 21:56Recap
- 22:20One Story
- 22:43Conceptual Thinking Issues
- 23:52Dynamic Variable
- 24:25Object Properties
- 25:00Library Internals
- 25:10Apply
- 25:52Closure in Java
- 26:36Summary
- 27:22Free unsolicited advice
- 27:34Tools dont make the artists
- 28:07Slide rules
related talks
27mBuilding functional Front-ends with ClojureScript
24mUsing backend languages for frontends: Why ClojureScript is an awesome idea!
34mClojureScript: The Essence of Alchemy
29mAn adequate intro to ClojureScript
49mClojureScript: Fun and productive web development with next level tooling
32mClojureScript: Lisp's Revenge
18mClojureScript Has It All! Except Maybe for Types
38mcljs All The Things: Full Stack Apps with ClojureScript
