What problem does it solve?
This Skill addresses the complexity of writing ClojureScript code that needs to run seamlessly on both the JVM and in the browser, ensuring consistency and testability across platforms.
Core Features & Use Cases
- Cross-Platform Development: Write code that functions identically whether compiled for the JVM or JavaScript environments.
- File Extension Guidance: Provides a clear decision tree for choosing between
.clj, .cljs, and .cljc file extensions.
- Reader Conditionals: Demonstrates best practices for using
#?(:cljs ...) and #?(:clj ...) for platform-specific code blocks.
- JVM Testing: Enables robust unit testing of frontend logic on the JVM, leveraging faster execution and standard tooling.
- Use Case: Develop a shared library of data transformation functions that can be used both in your backend Clojure API and your frontend ClojureScript application without duplication.
Quick Start
Use the clojurescript-cross-platform-code skill to write a function that logs a message to the console in ClojureScript and to standard output in Clojure.