Squint: Light-weight ClojureScript dialect
- Fix #799: forgot to add
squint.mathfile topackage.json
- Fix emitting negative zero value (
-0.0) - Add
squint.math, also available asclojure.mathnamespace (a direct port of the original)
- #779: Added
compare-and-swap!,swap-vals!andreset-vals!(@tonsky) - #788: Fixed compilation of
dotimeswith_binding (@tonsky) - #790: Fixed
shufflenot working on lazy sequences (@tonsky) - Multiple
:require-macroswith:refernow accumulate instead of overwriting (@willcohen)
- Allow macro namespaces to load
"node:fs", etc.to read config files for conditional compilation - Don't emit IIFE for top-level let so you can write
letoverdefnto capture values.
- Fix
js-yieldandjs-yield*in expression position - Implement
some?as macro
- Fix #758:
volatile!,vswap!,vreset! pr-str,prnetc now print EDN (with the idea that you can paste it back into your program)- new
#js/Mapreader that reads a JavaScriptMapfrom a Clojure map (maps are printed like this withpr-strtoo)
- Support passing keyword to
mapv - #759:
doseqcan't be used in expression context - Fix #753: optimize output of dotimes
alengthas macro
- Inline
identical?calls - Clean up emissiong of paren wrapping
- Add
nat-int?,neg-int?,pos-int?(@eNotchy) - Add
rand
- Fix rendering of
nullandundefinedin#html
- #747:
#htmlescape fix
- Optimize nested
assoccalls, e.g. produced with-> - Avoid object spread when object isn't shared (
auto-transient)
- Optimize
streven more
Remove debug output from compilation
- Optimize
=,and, andnot=even more
not=on undefined and false should returntrue
- Optimize code produced for
assoc,assoc!andgetwhen object argument can be inferred or is type hinted with^object - Optimize
strusing macro that compiles into template strings +?? ''for null/undefined - Fix #732:
take-lastshould returnnilor empty seq for negative numbers
- #725:
keysandvalsshould work onjs/Map
- Make
map-indexedandkeep-indexedlazy
- Compile time optimization for
=when using it on numbers, strings or keyword literals
Cljdoc chose squint for its small bundle sizes and easy migration off of TypeScript towards CLJS
- Switch
=to a deep-equals implementation that works on primitives, objects,Arrays,MapsandSets
- Fix #710: add
parse-double - Fix #714:
assoc-inonnilorundefined - Fix #714:
dissoconnilorundefined
- Basic
:import-mapssupport insquint.edn(just literal replacements, prefixes not supported yet)
- Fix #704:
whiledidn't compile correctly - Add
clojure.string/includes? - Emit less code for varargs functions
- Fix solidJS example
- Documentation improvements (@lread)
- Fix #697:
ClassCastExceptionin statement function when passed Code records
- Fix #680: support import attributes using
:withoption in require, e.g.:with {:type :json}
- Implement
not=as function - Fix #684: JSX output
- #678: Implement
random-uuid(@rafaeldelboni) - Fix #681: support unsafe HTML via
[:$ ...]tag
- #671: Implement
trampoline(@rafaeldelboni) - Fix #673: remove experimental atom as promise option since it causes unexpected behavior
- Fix #672: alias may contain dots
- Fix #669: munge refer-ed + renamed var
- Fix #661: support
throwin expression position - Fix #662: Fix extending protocol from other namespace to
nil - Better solution for multiple expressions in return context in combination with pragmas
- Add an ajv example
- #653: respect
:context exprincompile-string - #657: respect
:context exprinset!expression - #659: fix invalid code produced for REPL mode with respect to
return
- #651 Support
:require+:rename+ allow renamed value to be used in other :require clause
- Fix #649: reset ns when compiling file and fix initial global object
- Fix #647: emit explicit
nullwhen written in else branch ofif
- Fix #640: don't emit anonymous function if it is a statement (@jonasseglare)
- Fix #643: Support lexicographic compare of arrays (@jonasseglare)
- Fix #602: support hiccup-style shorthand for id and class attributes in
#jsxand#html
defclass: elide constructor when not provided
- Fix #603: don't emit multiple returns
- Drop constructor requirement for
defclass
- Fix #626: Implement
take-last - Fix #615:
(zero? "0")should returnfalse - Fix #617:
deftypefield name munging problem - Fix #618: Named multi-arity
fnargs don't get munged (@grayrest) - Fix #622: operator precendence issue with
|andif - Add
clojure.stringfunctionslower-case,upper-case,capitalize(@plexus)
- Fix #609: make
removereturn a transducer when no collection is provided - Fix #611: Implement the
set?function (@jonasseglare) - Fix #613: Optimize
aset
- Fix #605: merge command line
--pathswithsquint.ednconfig properly - Fix #607: make
mapcatreturn a transducer if no collections are provided (@jonasseglare)
- Fix #255: fn literal with rest args
- #596: fix unary division to produce reciprocal
- #592: fix
clj->jsto not process custom classes
- #585: fix
clj->jsto realize lazy seqs into arrays
- #586: support extending protocol to
nil
- Fix #572: prevent vite page reload
- Fix watcher and compiler not overriding
squint.ednconfigurations with command line options, take 2
- Fix watcher and compiler not overriding
squint.ednconfigurations with command line options.
- Fix watcher not being called
- Allow passing
--extensionand--pathsvia CLI
- Fix #563: prioritize refer over core built-in
- Update
chokidarto v4 which reduces the number of dependencies
- BREAKING: Dynamic CSS in
#htmlmust now be explicitly passed as map literal:(let [m {:color :green}] #html [:div {:style {:& m}}]). Fixes issue when usinglit-htmlin combination withclassMap. See demo
- #556: fix referring to var in other namespace via global object in REPL mode
- Pass
--replopts towatchsubcommand in CLI
- #552: fix REPL output with hyphen in ns name
- #542: fix
runon Windows
- #536: HTML is not escaped in dynamic expression
- #537: Fix
not: wrap argument in parens - Return interop expression in function body
- Prefer value from props map over explicit value
#htmlimprovements, support:&for spreading props
- #517: Preserve state over REPL evals
- #513: Fix
shufflecore function random distribution and performances - #517: Fix re-definition of class with
defclassin REPL - #522: fix
nil#htmlrendering issue
- #509: Optimization: use arrow fn for implicit IIFE when possible
- Optimization: emit
constin let expressions, which esbuild optimizes better
- Don't wrap arrow function in parens, see this issue
- Fix #499: add support for emitting arrow functions with
^:=>metadata
- Fix #505: Support
:renamein:require
- Fix #490: render css maps in html mode
- Fix #502: allow method names in
defclassto override squint built-ins
- Fix #496: don't wrap strings in another set of quotes
- Fix rendering of attribute expressions in HTML (should be wrapped in quotes)
- Compile destructured function args to JS destructuring when annotated with
^:js. This benefits working with vitest and playwright.
- #481: BREAKING, squint no longer automatically copies all non-compiled files to the
:output-dir. This behavior is now explicit with:copy-resources, see docs.
- Add new
#htmlreader for producing HTML literals using hiccup. See docs and playground example. - #483: Fix operator precedence problem
- Add
simple-benchmark
- #468: Keywords in JSX should render with hyphens
- #466: Fix
doseqexpression withset!in function return position
- #458: don't emit
nullin statement position
- #455: don't export non-public vars
- Fix infix operator in return position
- Allow playground to use JSX in non-REPL mode
- Add transducer arity to all existing core functions
- Support
^:gen+js-yield+js-yield*to write JS generator functions. See playground - Add
update-keysandupdate-vals - Add
=as reified function
- #449: fix issue with
:refer
- Add
memoize,filtertransducer arity,peek,pop - Export classes defined with
defclass - Support
^:asyncObject method indefclass
- Better support for pragmas and JSDoc via
js*+//and/* */ - Add
rem,nnext,str/end-with?,str/index-ofandstr/last-index-of - Fix alias with hypen in REPL mode
- Keep top level strings and comments (via
js*) before imports (for JSDoc, Next.js"use client", etc)
- Fix
compileStringin JS API
- Optimization: sort largest set first for
set/union, and smallest first forset/intersection - Add
sorted-set,long,abs,keep-indexedtransducer arity
- The
childrenfunction intree-seqmay returnnil
- Add
clojure.set/join - Add
tree-seq,flatten,seq?andsequential?
- Add
clojure.setfunctionsselect,rename-keys,rename,project, andmap-invert(@PEZ) - Fix
reduce-kvwithjs/Mapinput
- Add more
clojure.setfunctions:difference,union,subset?, andsuperset?(@PEZ)
- Let any object that has
Symbol.iterablebe destructureable even if it is notinstance of Object
- Initial version of
clojure.set - #418: Add
reductions - Add
bit-shift-leftand morebit-related macros - Fix
notwith respect to truthiness - Fix
reducewithout initial value + empty coll, it should callf() - Add serve-playground bb task
- Update playground with button for creating a blank AOC playground
- #407: fix conditional rendering
- Add
not-empty - Fix
into+ set + xform
- More helpful error from JS when using unresolved symbol in REPL mode
- Allow
>,<etc to be used as HOFs - Fix
str/splitwith respect to trailing empty split elements
- Fix vararg functions in REPL mode
- #394: add
int - #393:
Mathcan be used withoutjs/prefix - Expose compiler state via
compileStringExfor playground, preserves namespace transitions
- Restore backward compatibility with code that is compiled with older versions of squint
- Optimize various outputs for smaller size
- Add
js-in
- Support
into+xform
- Support
sorton strings
- #386: allow expression in value position in map literal
- Improvements with respect to laziness in
mapcatandconcat - Do not array mutate argument in
reverse
- Escape JSX attribute vector value (and more)
map+transducesupport- Fix
forin REPL mode - Throw when object is not iterable in
for - Make next lazy when input is lazy
- Fix playground shim (fixes issue in older versions of Safari)
- Add
js-modandquot
- #380: Don't emit space in between
#jsxtags - Add
re-find
- Add
condpmacro
- Use
compareas default compare function insort(which fixes numerical sorting)
- Allow
assoc!to be called on arbitrary classes (regression)
- Improve
getto callgetmethod when present.
- False alarm, I was playing the pinball game in low power mode on my mobile 🤦
- Revert truthiness checks via funcall, negative impact on performance with pinball game on mobile
- Allow keywords and collections to be used as functions in HOFs
- Make filter, etc aware of truthiness
- Reduce code size for truthiness checks
- Add
str/split-lines - Add
partition-by - Add
parse-long - Add
sort-by
- Fix top level await
- Support multiple dimensions in
aset - Add
coercive-=as alias for== - Add
js-delete
- Fix
min-keyandmax-keyand improve tests
- Add
min-keyandmax-key - Fix
defoncein REPL-mode
- Fix
doseqandforwhen binding name clashes with core var
- No-op release to hopefully fix caching issue with jspm
- Several REPL improvements
- Improve https://squint-cljs.github.io/squint/
- Allow alias name to be used as object in REPL mode
- Copy resources when using
squint compileorsquint watch
- Return map when
select-keysis called withnil - nREPL server: print values through
cljs.pprint(@PEZ)
- Initial (incomplete!) nREPL server on Node.js:
npx squint nrepl-server :port 1888 - Update/refactor threejs example
- #360:
assoc-in!should not mutate objects in the middle if they already exist - Evaluate
lazy-seqbody just once - Avoid stackoverflow with
minandmax - #360: fix assoc-in! with immutable objects in the middle
- Add
mod,object? - Optimize
get - Add threejs example
- #357: fix version in help text
- Fix iterating over objects
- Add
clojure.string'striml,trimr,replace - Fix
examples/vite-reactby addingpublic/index.html - Add
find,bounded-count,boolean?,merge-with,meta,with-meta,int?,ex-message,ex-cause,ex-info - Fix munging of reserved symbols in function arguments
- #347: Add
:preand:postsupport infn - Add
number? - Support
docstringindef
- Handle multipe source
:pathsin a more robust fashion
- #344: macros can't be used via aliases
- Add
squint.ednsupport, see docs - Add
watchsubcommand to watch:pathsfromsquint.edn - Make generated
letvariable names in JS more deterministic, which helps hot reloading in React - Added a vite + react example project.
- Resolve symbolic namespaces
(:require [foo.bar])from:paths
- Add
bit-andandbit-or
- Include
lib/squint.core.umd.jswhich defines a globalsquint.coreobject (easy to use in browsers, see docs)
- Add
subs,fn?,re-seq - Add
squint.ednwith:pathsto resolve macros from (via:require-macros)
- Fix
andandorwith respect to CLJS truthiness
- Respect CLJS truth semantics: only
null,undefinedandfalseare non-truthy,0and""are truthy. - Fix
dotimes
squint replimprovements
- Do not resolve binding in
catchto core var - Fix reading
.cljcfiles - Allow passing JS object as opts in JavaScript API's
compileString
- Fix
instance?in return position to-array,str/starts-with?
- Support next on non-arrays
- Add
compare
- Fix
into-array
- Add
into-array,some-fn,keep-indexed - Fix for
lazy-seqwhen body returnsnil
- Add
max,min,every-pred
- Add
reduce-kv
- #320: fix overriding core vars
- Add
rand-nth,aclone,add-watch,remove-watch
- #288: support
defclass. See doc/defclass.md. - #312: implement doall and dorun
- Drop cherry core from NPM package (cruft from porting cherry to squint)
- Fix compilation of empty list
- Fix
andandorwithout arguments - #308:
doseqin return position emits invalid code
- Add
js-obj
- Add
foranddoseq(@lilactown)
- #289: support
:asalias with hyphen in namespace require libspec
- #286: make dissoc work with multiple keys
- #284: fix undefined keys/values when passing objects and maps to conj
- #274: fix logic precedence by wrapping in parens
Add preliminary Node.js API in node.js
- Support
{:& more :foo :bar}syntax in JSX to spread the more map into the props, inspired by helix
- Add
zero?pos?andneg?core functions
- Fix
booleancore function export
- Escape boolean in JSX attribute
- Add
booleancore function
- Fix
+symbol import by bumping shadow-cljs - Move
@babel/preset-reactdependency to dev dependency
- Fix async/await + variadiac arguments
- Fix namespaced component in JSX
- Change default extension back to
.mjs. Use--extension jsto change this to.js.
- Fix rendering of number attributes in JSX
- Support
--extensionoption to set extension for JS files - Change default extension from
.mjsto.js