Skip to content

Version 0.3.0

Choose a tag to compare

@furkan3ayraktar furkan3ayraktar released this 03 Oct 06:27
e3ce9c3
clojure script

The biggest change in this 0.3.0 release is that the poly tool now supports ClojureScript!

The work of finding a good and simple solution has been a long journey, and many ideas have been rejected along the way. We are therefore happy and proud that the day has finally come where the tool handles cljs source code files as well as package.json configuration files!

This release is backwards compatible with 0.2.22.

If you’re using the standalone poly tool, you need at least Java 21

If you already have a workspace, we recommend making the following changes:

  • Set :dialects in workspace.edn, see example here and here.
  • Set :template-data in workspace.edn, see example here.
  • Add a :jvm-opts to your :poly alias in ./deps.edn if you want to remove warnings when starting a shell with clojure -M:poly, see example here.
  • To support ClojureScript:
    • Create a package.json file to your workspace root as well as to projects, components, and bases, see the RealWorld example app as an example.
    • Ensure to use the latest versions of the External and Kaocha test runners (if you use any of these). This is important if you start adding cljs source files, see example here.

Main changes:

  • The create workspace command:
    • If dialects:DIALECTS is provided, it will be used to set :dialects in workspace.edn to DIALECTS, e.g. ["clj"] or ["clj" "cljs"].
      • Only the dialects selected will be read from disk (+ cljc).
      • If no dialect is specified, ["clj"] will be used.
      • If any of the values are set to "cljs" (["cljs"] or ["clj" cljs"]) a package.json file will be created.
  • The create component, create base, and create project commands:
    • If DIALECT in dialect:DIALECT is set to cljs, a package.json file will be created.
    • Suggests the dialect argument in the shell, if cljs is listed among the :dialects in workspace.edn.
    • If dialect is not specified, clj will be used.
    • The new attribute :template-data can be used to add custom data, and to override the Clojure version and shadow cljs version used by Selmer templates.
  • The libs command:
    • NPM dependencies are now included in the list of library dependencies (read from package.json files).
    • The :outdated parameter also checks for outdated npm dependencies.
    • The :update parameter also updates npm dependencies in package.json files.
      • :keep-lib-versions also works for npm dependencies.
      • The libraries:LIBS filtering works as expected (outdated npm libraries are suggested when run from a shell).
    • The lag has been removed when retrieving outdated libraries with libraries:LIBS.
  • The info command:
    • If the :dialect argument is provided, a dialect column is added to the table, showing which source types are used by the bricks and projects (and their bricks), where:
      j-- = clj (Clojure)
      -c- = cljc (Clojure Common)
      --s = cljs (ClojureScript)
      The pattern here is that the last letter of the file extension is used, for example j for clj.

      RealWorld example
  • New attributes have been added to the workspace structure, and the version has been bumped to 5.0, see versions for details.

Issues and PRs:

  • Support for ClojureScript, issue 481 and PR 524
  • Fix typo in the documentation, PR 560
  • Fix reflection warnings, issue 563
  • Remove lag when retrieving outdated libraries in the libs command, issue 568

Other changes:

  • Ensure exported workspaces with symbols (e.g. a test runner namespace) are readable when used by ws-file:FILE (or switch-ws in a shell).
  • Suppress warning "WARNING: A restricted method in java.lang.System has been called" when starting a shell.
  • When parsing an invalid namespace, display Error 111 without printing the full namespace.

Doc updates

  • Changed the sha for Sean's External test runner to c97747aa2b1fdf03c46c7e435cca7c2608740a2a in this section.
    This version ignores cljs namespaces, which would otherwise have caused errors when running the test command.
  • Mention that tests should be run with Deps here.
  • Updated links to use the cljs-frontend branch of the Realworld example app.
  • Added Clojure Script section to the Source Code page.

Special thanks go to Furkan Bayraktar, whose help in supporting ClojureScript has been invaluable, and for his work with the RealWorld example app. Thanks also to Sean Corfield for continuously testing this delivery and providing good feedback as always.

Finally, I would like to thank everyone who contributed to the discussions around ClojureScript support!

/Joakim Tengstrand