Shadow CLJS User’s Guide

Thomas Heller and Tony Kay
version 1.0, Jan 10, 2018
Table of Contents
  • 1. Introduction
    • 1.1. High-Level Overview
    • 1.2. Basic Workflow
      • 1.2.1. Development Mode
      • 1.2.2. Release Mode
    • 1.3. Important Concepts
      • 1.3.1. The Classpath
      • 1.3.2. Server Mode
      • 1.3.3. REPL
    • 1.4. About this Book
      • 1.4.1. Work in Progress
      • 1.4.2. Contributing
      • 1.4.3. Conventions Used
  • 2. Installation
    • 2.1. Standalone via npm
    • 2.2. Library
  • 3. Usage
    • 3.1. Command Line
      • 3.1.1. Server Mode
    • 3.2. Build Tool Integration
      • 3.2.1. Leiningen
      • 3.2.2. tools.deps / deps.edn
      • 3.2.3. Boot
    • 3.3. Running Clojure Code
      • 3.3.1. Calling watch via clj-run
  • 4. REPL
    • 4.1. ClojureScript REPL
      • 4.1.1. Node REPL
      • 4.1.2. Browser REPL
      • 4.1.3. Build-specific REPL
    • 4.2. Clojure REPL
      • 4.2.1. Embedded
  • 5. Configuration
    • 5.1. Source Paths
    • 5.2. Dependencies
      • 5.2.1. Clojure(Script)
      • 5.2.2. JavaScript
    • 5.3. User Configuration
    • 5.4. Server Options
      • 5.4.1. nREPL
      • 5.4.2. Socket REPL
      • 5.4.3. SSL
      • 5.4.4. Primary HTTP(S)
      • 5.4.5. Development HTTP(S)
    • 5.5. JVM Configuration
  • 6. Build Configuration
    • 6.1. Build Target
    • 6.2. Development Options
      • 6.2.1. REPL
      • 6.2.2. Preloads
      • 6.2.3. Hot Code Reload
      • 6.2.4. Lifecycle Hooks
    • 6.3. Build Hooks
      • 6.3.1. Compilation Stages
    • 6.4. Compiler Cache
    • 6.5. Closure Defines
    • 6.6. Compiler Options
      • 6.6.1. Warnings as Errors
    • 6.7. Output Language Options
    • 6.8. Conditional Reading
    • 6.9. Overriding from the CLI
    • 6.10. Using Environment Variables
    • 6.11. Build and Target defaults
  • 7. Targeting the Browser
    • 7.1. Output Settings
    • 7.2. Modules
    • 7.3. Code Splitting
      • 7.3.1. Loading code dynamically
    • 7.4. Output Wrapper
    • 7.5. Web Workers
    • 7.6. Cacheable Output
      • 7.6.1. Release Versions
      • 7.6.2. Filenames with Fingerprint-Hash
    • 7.7. Output Manifest
    • 7.8. Development Support
      • 7.8.1. Heads-Up Display (HUD)
      • 7.8.2. CSS Reloading
      • 7.8.3. Proxy Support
    • 7.9. Using External JS Bundlers
      • 7.9.1. JS Tree Shaking
  • 8. Targeting JavaScript Modules
    • 8.1. Module Configuration
      • 8.1.1. Module Exports
    • 8.2. Module Splitting
    • 8.3. Dynamic Module Import
    • 8.4. Third Party Tool Integration
  • 9. Targeting React Native
    • 9.1. React Native
    • 9.2. Expo
    • 9.3. Hot Code Reload
  • 10. Targeting node.js
    • 10.1. node.js Scripts
      • 10.1.1. Build Options
      • 10.1.2. Hot Code Reload
    • 10.2. node.js Libraries
      • 10.2.1. Single static "default" export
      • 10.2.2. Multiple static named exports
      • 10.2.3. "Dynamic" exports
      • 10.2.4. Full Example
    • 10.3. Creating npm packages
  • 11. Embedding in the JS Ecosystem — The :npm-module Target
    • 11.1. Working with Optimizations
  • 12. Testing
    • 12.1. Testing in node.js
    • 12.2. Testing in the Browser
      • 12.2.1. Generated output in :test-dir
    • 12.3. Targeting Tests to Karma for Continuous Integration