ClojuTRE - Build tooling with Boot

Juho Teperi
Juho TeperiOhjelmoija at Metosin Oy
Build tooling with Boot 
Juho Teperi / Metosin 
ClojuTRE 
25.11.2014
Contents 
• Example project 
• Challenges with Leiningen 
• Solutions using Boot 
• Summary
Example project 
• “(Typical) full-stack Clojure project” 
• src/clj, backend code 
• src/cljs 
• src/cljx, shared code 
• src/less (or sccs, garden etc.)
Leiningen 
• Configuration over code 
• Great with pure Clojure 
projects 
• Plugins provide additional 
tasks
Example project using Lein 
• Uses multiple lein plugins 
• lein cljx auto 
• lein cljsbuild auto (or figwheel) 
• lein less auto 
• lein repl 
• + unit tests 
• Several of these plugins watch for file changes 
• There are ways to combine all into one 
command
Lein, problem #1 
• Each lein command starts a JVM 
• Most commands fork another for the task 
• 7 JVMs 
• much GB 
• Slow start up
Lein, problem #2 
• Plugins are not composable 
• Descriptive configuration doesn’t help 
• Each lein plugin implements the file watching 
themselves 
• Each implementation works differently…
Lein, problem #3 
• Target directory is in effect a temporary 
directory 
• Lein uberjar 
• Uses different cljs compiler options 
• Probably uses same target path 
• First thing to try if you have problems: lein 
clean
:source-paths ["src/clj" "target/generated/clj"] 
:test-paths ["test/clj"] 
:cljsbuild {:builds {:app {:source-paths ["src/cljs" "target/generated/cljs"] 
:compiler {:output-to "resources/public/js/bootcamp.js" 
:output-dir "resources/public/js/out" 
:source-map "resources/public/js/out.js.map" 
:preamble ["react/react.min.js"] 
:externs ["react/externs/react.js"] 
:optimizations :none 
:pretty-print true}}}} 
:profiles {:dev {:plugins [[lein-figwheel "0.1.5-SNAPSHOT"] 
[lein-cljsbuild "1.0.3"] 
[com.keminglabs/cljx "0.4.0" :exclusions [org.clojure/clojure]]] 
:figwheel {:http-server-root "public" 
:port 3449 
:css-dirs ["resources/public/css"]} 
:cljx {:builds [{:rules :clj 
:source-paths ["src/cljx"] 
:output-path "target/generated/clj"} 
{:rules :cljs 
:source-paths ["src/cljx"] 
:output-path "target/generated/cljs"}]} 
:cljsbuild {:builds {:app {:source-paths ["dev-src/cljs"]}}}} 
+ This is missing e.g. uberjar 
settings for optimized cljs build
Boot (2) 
• Alternative build tool 
• Boot 1 is the old version 
• Boot 2 is the new one. It’s a significantly 
different as the old one. 
• Alpha 
• API changes are imminent etc. 
• Active development
Boot, solution #1 
• “Lein launches multiple JVMs and uses lots of memory” 
• All tasks run in the same JVM 
• Separate classloaders to prevent deps leaking 
• Btw. this is the same technique which is used by the app servers 
• Disclaimer: I have not tested the memory consumption.
Boot, solution #2 
• “Lein tasks are not composable, each plugin implements 
e.g. file watching themselves” 
• Tasks are functions 
• New tasks are composed from existing tasks 
using regular methods: comp 
• File watching is a task 
• Which can be composed together with other tasks
Boot, solution #3 
• “Dev and production tasks interfere because they use 
same directories” 
• Tasks create temporary directories as needed 
• Tasks use Boot API to find sources and publish their results 
• Cljx uses API to create temp dir, writes results to the dir... 
• Cljs asks for source files using the API -> sources include those 
written by cljx task 
• Processes don’t interfere with each other 
• running boot package to create production jar shouldn’t leave 
around files which break dev build 
• No need for clean-task
(set-env! 
:src-paths #{"src/clj" "src/cljs" "src/cljx"} 
:rsc-paths #{"resources"} 
:dependencies '[[adzerk/boot-cljs "0.0-2371-27"] 
[adzerk/boot-cljs-repl "0.1.6"] 
[adzerk/boot-reload "0.1.6"] 
[deraen/boot-cljx "0.1.0-SNAPSHOT"] 
… project deps … ]) 
(task-options! 
cljs [:output-to "public/main.js" 
:source-map true 
:unified true]) 
(deftask dev 
"Start the dev env..." 
[] 
(comp 
Global options 
● Watch: all following tasks run whenever there is file 
change. 
● cljs-repl, start-app are implemented so that they 
only run once. 
● (start-app is specific to the project) 
● cljs, cljx no-op if no file changes for them 
● Reload: Like figwheel. Sends websocket 
(watch) 
(cljs-repl) 
(cljx) 
(start-app) 
(cljs :optimizations :none) 
(reload :on-jsload 'saapas.core/main))) 
notifications to browser. 
(deftask dev-repl 
"Connect to the repl started by the dev task." 
[] 
(repl :client true))
Challenges with Boot 
• IDE Support 
• Editors using nrepl work (fireplace, cider) 
• Keep project.clj around for Cursive (and 
maybe others) 
• Missing tasks (less, unit testing…) 
• boot-cljx was easy to create, so should be 
the others
Summary 
Lein Boot 
Task envs Forks new JVMs Multiple classloaders in 
one JVM 
Configuration Configuration over 
code 
Composable functions 
Files Static classpath 
(target, resources) 
Tasks create temp dirs 
Equivalent JS tool Grunt Gulp, Broccoli
Questions?
Links 
• http://boot-clj.com/ 
• https://github.com/Deraen/saapas 
• #hoplon @ Freenode
1 of 18

Recommended

Webbisauna - ClojureScript for Javascript Developers by
Webbisauna - ClojureScript for Javascript DevelopersWebbisauna - ClojureScript for Javascript Developers
Webbisauna - ClojureScript for Javascript DevelopersJuho Teperi
751 views26 slides
HelsinkiJS - Clojurescript for Javascript Developers by
HelsinkiJS - Clojurescript for Javascript DevelopersHelsinkiJS - Clojurescript for Javascript Developers
HelsinkiJS - Clojurescript for Javascript DevelopersJuho Teperi
827 views29 slides
ChatGPT and the Future of Work - Clark Boyd by
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
28.7K views69 slides
Getting into the tech field. what next by
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
6.7K views22 slides
Google's Just Not That Into You: Understanding Core Updates & Search Intent by
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
7K views99 slides
How to have difficult conversations by
How to have difficult conversations How to have difficult conversations
How to have difficult conversations Rajiv Jayarajah, MAppComm, ACC
5.7K views19 slides

More Related Content

Recently uploaded

Business Analyst Series 2023 - Week 4 Session 8 by
Business Analyst Series 2023 -  Week 4 Session 8Business Analyst Series 2023 -  Week 4 Session 8
Business Analyst Series 2023 - Week 4 Session 8DianaGray10
145 views13 slides
Why and How CloudStack at weSystems - Stephan Bienek - weSystems by
Why and How CloudStack at weSystems - Stephan Bienek - weSystemsWhy and How CloudStack at weSystems - Stephan Bienek - weSystems
Why and How CloudStack at weSystems - Stephan Bienek - weSystemsShapeBlue
247 views13 slides
Transitioning from VMware vCloud to Apache CloudStack: A Path to Profitabilit... by
Transitioning from VMware vCloud to Apache CloudStack: A Path to Profitabilit...Transitioning from VMware vCloud to Apache CloudStack: A Path to Profitabilit...
Transitioning from VMware vCloud to Apache CloudStack: A Path to Profitabilit...ShapeBlue
162 views25 slides
Initiating and Advancing Your Strategic GIS Governance Strategy by
Initiating and Advancing Your Strategic GIS Governance StrategyInitiating and Advancing Your Strategic GIS Governance Strategy
Initiating and Advancing Your Strategic GIS Governance StrategySafe Software
184 views68 slides
Enabling DPU Hardware Accelerators in XCP-ng Cloud Platform Environment - And... by
Enabling DPU Hardware Accelerators in XCP-ng Cloud Platform Environment - And...Enabling DPU Hardware Accelerators in XCP-ng Cloud Platform Environment - And...
Enabling DPU Hardware Accelerators in XCP-ng Cloud Platform Environment - And...ShapeBlue
108 views12 slides
Don’t Make A Human Do A Robot’s Job! : 6 Reasons Why AI Will Save Us & Not De... by
Don’t Make A Human Do A Robot’s Job! : 6 Reasons Why AI Will Save Us & Not De...Don’t Make A Human Do A Robot’s Job! : 6 Reasons Why AI Will Save Us & Not De...
Don’t Make A Human Do A Robot’s Job! : 6 Reasons Why AI Will Save Us & Not De...Moses Kemibaro
35 views38 slides

Recently uploaded(20)

Business Analyst Series 2023 - Week 4 Session 8 by DianaGray10
Business Analyst Series 2023 -  Week 4 Session 8Business Analyst Series 2023 -  Week 4 Session 8
Business Analyst Series 2023 - Week 4 Session 8
DianaGray10145 views
Why and How CloudStack at weSystems - Stephan Bienek - weSystems by ShapeBlue
Why and How CloudStack at weSystems - Stephan Bienek - weSystemsWhy and How CloudStack at weSystems - Stephan Bienek - weSystems
Why and How CloudStack at weSystems - Stephan Bienek - weSystems
ShapeBlue247 views
Transitioning from VMware vCloud to Apache CloudStack: A Path to Profitabilit... by ShapeBlue
Transitioning from VMware vCloud to Apache CloudStack: A Path to Profitabilit...Transitioning from VMware vCloud to Apache CloudStack: A Path to Profitabilit...
Transitioning from VMware vCloud to Apache CloudStack: A Path to Profitabilit...
ShapeBlue162 views
Initiating and Advancing Your Strategic GIS Governance Strategy by Safe Software
Initiating and Advancing Your Strategic GIS Governance StrategyInitiating and Advancing Your Strategic GIS Governance Strategy
Initiating and Advancing Your Strategic GIS Governance Strategy
Safe Software184 views
Enabling DPU Hardware Accelerators in XCP-ng Cloud Platform Environment - And... by ShapeBlue
Enabling DPU Hardware Accelerators in XCP-ng Cloud Platform Environment - And...Enabling DPU Hardware Accelerators in XCP-ng Cloud Platform Environment - And...
Enabling DPU Hardware Accelerators in XCP-ng Cloud Platform Environment - And...
ShapeBlue108 views
Don’t Make A Human Do A Robot’s Job! : 6 Reasons Why AI Will Save Us & Not De... by Moses Kemibaro
Don’t Make A Human Do A Robot’s Job! : 6 Reasons Why AI Will Save Us & Not De...Don’t Make A Human Do A Robot’s Job! : 6 Reasons Why AI Will Save Us & Not De...
Don’t Make A Human Do A Robot’s Job! : 6 Reasons Why AI Will Save Us & Not De...
Moses Kemibaro35 views
Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or... by ShapeBlue
Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or...Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or...
Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or...
ShapeBlue199 views
Hypervisor Agnostic DRS in CloudStack - Brief overview & demo - Vishesh Jinda... by ShapeBlue
Hypervisor Agnostic DRS in CloudStack - Brief overview & demo - Vishesh Jinda...Hypervisor Agnostic DRS in CloudStack - Brief overview & demo - Vishesh Jinda...
Hypervisor Agnostic DRS in CloudStack - Brief overview & demo - Vishesh Jinda...
ShapeBlue164 views
The Power of Generative AI in Accelerating No Code Adoption.pdf by Saeed Al Dhaheri
The Power of Generative AI in Accelerating No Code Adoption.pdfThe Power of Generative AI in Accelerating No Code Adoption.pdf
The Power of Generative AI in Accelerating No Code Adoption.pdf
Saeed Al Dhaheri39 views
"Node.js Development in 2024: trends and tools", Nikita Galkin by Fwdays
"Node.js Development in 2024: trends and tools", Nikita Galkin "Node.js Development in 2024: trends and tools", Nikita Galkin
"Node.js Development in 2024: trends and tools", Nikita Galkin
Fwdays33 views
Live Demo Showcase: Unveiling Dell PowerFlex’s IaaS Capabilities with Apache ... by ShapeBlue
Live Demo Showcase: Unveiling Dell PowerFlex’s IaaS Capabilities with Apache ...Live Demo Showcase: Unveiling Dell PowerFlex’s IaaS Capabilities with Apache ...
Live Demo Showcase: Unveiling Dell PowerFlex’s IaaS Capabilities with Apache ...
ShapeBlue129 views
"Running students' code in isolation. The hard way", Yurii Holiuk by Fwdays
"Running students' code in isolation. The hard way", Yurii Holiuk "Running students' code in isolation. The hard way", Yurii Holiuk
"Running students' code in isolation. The hard way", Yurii Holiuk
Fwdays36 views
ESPC 2023 - Protect and Govern your Sensitive Data with Microsoft Purview in ... by Jasper Oosterveld
ESPC 2023 - Protect and Govern your Sensitive Data with Microsoft Purview in ...ESPC 2023 - Protect and Govern your Sensitive Data with Microsoft Purview in ...
ESPC 2023 - Protect and Govern your Sensitive Data with Microsoft Purview in ...
Developments to CloudStack’s SDN ecosystem: Integration with VMWare NSX 4 - P... by ShapeBlue
Developments to CloudStack’s SDN ecosystem: Integration with VMWare NSX 4 - P...Developments to CloudStack’s SDN ecosystem: Integration with VMWare NSX 4 - P...
Developments to CloudStack’s SDN ecosystem: Integration with VMWare NSX 4 - P...
ShapeBlue196 views
Future of AR - Facebook Presentation by Rob McCarty
Future of AR - Facebook PresentationFuture of AR - Facebook Presentation
Future of AR - Facebook Presentation
Rob McCarty65 views
CloudStack Managed User Data and Demo - Harikrishna Patnala - ShapeBlue by ShapeBlue
CloudStack Managed User Data and Demo - Harikrishna Patnala - ShapeBlueCloudStack Managed User Data and Demo - Harikrishna Patnala - ShapeBlue
CloudStack Managed User Data and Demo - Harikrishna Patnala - ShapeBlue
ShapeBlue137 views
"Surviving highload with Node.js", Andrii Shumada by Fwdays
"Surviving highload with Node.js", Andrii Shumada "Surviving highload with Node.js", Andrii Shumada
"Surviving highload with Node.js", Andrii Shumada
Fwdays58 views
TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f... by TrustArc
TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f...TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f...
TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f...
TrustArc176 views
"Package management in monorepos", Zoltan Kochan by Fwdays
"Package management in monorepos", Zoltan Kochan"Package management in monorepos", Zoltan Kochan
"Package management in monorepos", Zoltan Kochan
Fwdays34 views

Featured

The six step guide to practical project management by
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
36.7K views27 slides
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright... by
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
12.8K views21 slides
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present... by
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
55.5K views138 slides
12 Ways to Increase Your Influence at Work by
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
401.7K views64 slides
ChatGPT webinar slides by
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slidesAlireza Esmikhani
30.5K views36 slides

Featured(20)

The six step guide to practical project management by MindGenius
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
MindGenius36.7K views
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright... by RachelPearson36
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
RachelPearson3612.8K views
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present... by Applitools
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Applitools55.5K views
12 Ways to Increase Your Influence at Work by GetSmarter
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
GetSmarter401.7K views
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G... by DevGAMM Conference
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
DevGAMM Conference3.6K views
Barbie - Brand Strategy Presentation by Erica Santiago
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy Presentation
Erica Santiago25.1K views
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well by Saba Software
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellGood Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Saba Software25.3K views
Introduction to C Programming Language by Simplilearn
Introduction to C Programming LanguageIntroduction to C Programming Language
Introduction to C Programming Language
Simplilearn8.5K views
The Pixar Way: 37 Quotes on Developing and Maintaining a Creative Company (fr... by Palo Alto Software
The Pixar Way: 37 Quotes on Developing and Maintaining a Creative Company (fr...The Pixar Way: 37 Quotes on Developing and Maintaining a Creative Company (fr...
The Pixar Way: 37 Quotes on Developing and Maintaining a Creative Company (fr...
Palo Alto Software88.4K views
9 Tips for a Work-free Vacation by Weekdone.com
9 Tips for a Work-free Vacation9 Tips for a Work-free Vacation
9 Tips for a Work-free Vacation
Weekdone.com7.2K views
How to Map Your Future by SlideShop.com
How to Map Your FutureHow to Map Your Future
How to Map Your Future
SlideShop.com275.1K views
Beyond Pride: Making Digital Marketing & SEO Authentically LGBTQ+ Inclusive -... by AccuraCast
Beyond Pride: Making Digital Marketing & SEO Authentically LGBTQ+ Inclusive -...Beyond Pride: Making Digital Marketing & SEO Authentically LGBTQ+ Inclusive -...
Beyond Pride: Making Digital Marketing & SEO Authentically LGBTQ+ Inclusive -...
AccuraCast3.4K views
Exploring ChatGPT for Effective Teaching and Learning.pptx by Stan Skrabut, Ed.D.
Exploring ChatGPT for Effective Teaching and Learning.pptxExploring ChatGPT for Effective Teaching and Learning.pptx
Exploring ChatGPT for Effective Teaching and Learning.pptx
Stan Skrabut, Ed.D.57.7K views
How to train your robot (with Deep Reinforcement Learning) by Lucas García, PhD
How to train your robot (with Deep Reinforcement Learning)How to train your robot (with Deep Reinforcement Learning)
How to train your robot (with Deep Reinforcement Learning)
Lucas García, PhD42.5K views
4 Strategies to Renew Your Career Passion by Daniel Goleman
4 Strategies to Renew Your Career Passion4 Strategies to Renew Your Career Passion
4 Strategies to Renew Your Career Passion
Daniel Goleman122K views
The Student's Guide to LinkedIn by LinkedIn
The Student's Guide to LinkedInThe Student's Guide to LinkedIn
The Student's Guide to LinkedIn
LinkedIn88.1K views

ClojuTRE - Build tooling with Boot

  • 1. Build tooling with Boot Juho Teperi / Metosin ClojuTRE 25.11.2014
  • 2. Contents • Example project • Challenges with Leiningen • Solutions using Boot • Summary
  • 3. Example project • “(Typical) full-stack Clojure project” • src/clj, backend code • src/cljs • src/cljx, shared code • src/less (or sccs, garden etc.)
  • 4. Leiningen • Configuration over code • Great with pure Clojure projects • Plugins provide additional tasks
  • 5. Example project using Lein • Uses multiple lein plugins • lein cljx auto • lein cljsbuild auto (or figwheel) • lein less auto • lein repl • + unit tests • Several of these plugins watch for file changes • There are ways to combine all into one command
  • 6. Lein, problem #1 • Each lein command starts a JVM • Most commands fork another for the task • 7 JVMs • much GB • Slow start up
  • 7. Lein, problem #2 • Plugins are not composable • Descriptive configuration doesn’t help • Each lein plugin implements the file watching themselves • Each implementation works differently…
  • 8. Lein, problem #3 • Target directory is in effect a temporary directory • Lein uberjar • Uses different cljs compiler options • Probably uses same target path • First thing to try if you have problems: lein clean
  • 9. :source-paths ["src/clj" "target/generated/clj"] :test-paths ["test/clj"] :cljsbuild {:builds {:app {:source-paths ["src/cljs" "target/generated/cljs"] :compiler {:output-to "resources/public/js/bootcamp.js" :output-dir "resources/public/js/out" :source-map "resources/public/js/out.js.map" :preamble ["react/react.min.js"] :externs ["react/externs/react.js"] :optimizations :none :pretty-print true}}}} :profiles {:dev {:plugins [[lein-figwheel "0.1.5-SNAPSHOT"] [lein-cljsbuild "1.0.3"] [com.keminglabs/cljx "0.4.0" :exclusions [org.clojure/clojure]]] :figwheel {:http-server-root "public" :port 3449 :css-dirs ["resources/public/css"]} :cljx {:builds [{:rules :clj :source-paths ["src/cljx"] :output-path "target/generated/clj"} {:rules :cljs :source-paths ["src/cljx"] :output-path "target/generated/cljs"}]} :cljsbuild {:builds {:app {:source-paths ["dev-src/cljs"]}}}} + This is missing e.g. uberjar settings for optimized cljs build
  • 10. Boot (2) • Alternative build tool • Boot 1 is the old version • Boot 2 is the new one. It’s a significantly different as the old one. • Alpha • API changes are imminent etc. • Active development
  • 11. Boot, solution #1 • “Lein launches multiple JVMs and uses lots of memory” • All tasks run in the same JVM • Separate classloaders to prevent deps leaking • Btw. this is the same technique which is used by the app servers • Disclaimer: I have not tested the memory consumption.
  • 12. Boot, solution #2 • “Lein tasks are not composable, each plugin implements e.g. file watching themselves” • Tasks are functions • New tasks are composed from existing tasks using regular methods: comp • File watching is a task • Which can be composed together with other tasks
  • 13. Boot, solution #3 • “Dev and production tasks interfere because they use same directories” • Tasks create temporary directories as needed • Tasks use Boot API to find sources and publish their results • Cljx uses API to create temp dir, writes results to the dir... • Cljs asks for source files using the API -> sources include those written by cljx task • Processes don’t interfere with each other • running boot package to create production jar shouldn’t leave around files which break dev build • No need for clean-task
  • 14. (set-env! :src-paths #{"src/clj" "src/cljs" "src/cljx"} :rsc-paths #{"resources"} :dependencies '[[adzerk/boot-cljs "0.0-2371-27"] [adzerk/boot-cljs-repl "0.1.6"] [adzerk/boot-reload "0.1.6"] [deraen/boot-cljx "0.1.0-SNAPSHOT"] … project deps … ]) (task-options! cljs [:output-to "public/main.js" :source-map true :unified true]) (deftask dev "Start the dev env..." [] (comp Global options ● Watch: all following tasks run whenever there is file change. ● cljs-repl, start-app are implemented so that they only run once. ● (start-app is specific to the project) ● cljs, cljx no-op if no file changes for them ● Reload: Like figwheel. Sends websocket (watch) (cljs-repl) (cljx) (start-app) (cljs :optimizations :none) (reload :on-jsload 'saapas.core/main))) notifications to browser. (deftask dev-repl "Connect to the repl started by the dev task." [] (repl :client true))
  • 15. Challenges with Boot • IDE Support • Editors using nrepl work (fireplace, cider) • Keep project.clj around for Cursive (and maybe others) • Missing tasks (less, unit testing…) • boot-cljx was easy to create, so should be the others
  • 16. Summary Lein Boot Task envs Forks new JVMs Multiple classloaders in one JVM Configuration Configuration over code Composable functions Files Static classpath (target, resources) Tasks create temp dirs Equivalent JS tool Grunt Gulp, Broccoli
  • 18. Links • http://boot-clj.com/ • https://github.com/Deraen/saapas • #hoplon @ Freenode