Fork me on GitHub
#polylith
<
2024-02-02
>
tengstrand05:02:19

Hi everyone! I think we have some functionality that can be removed, to reduce complexity. If you have good arguments to keep them, please tell! ā€¢ Today we can pass in :: when we execute a command from the command line. I think most people run the poly command from the workspace root, or start a shell with clojure -M:poly. In those cases we don't need :: (I for example never use it). ā€¢ Today we can type both poly create component name:mycomp and poly create c name:mycomp . We don't create bases/components/projects/workspaces very often, so my suggestion is to drop the support for the shorter variants (b/c/p/w). If you execute your commands from a shell, then the autocomplete will help you with the typing.

šŸ‘ 5
Teemu Kaukoranta09:02:28

I don't oppose removing the shorthands, but I'm curious to hear your thoughts about breaking changes.. this is another breaking change, and it seems breaking changes are introduced quite often? I doubt that everyone who uses polylith follows this channel actively or at all I don't have an example of another breaking change right now, so maybe it's just a false impression that I have

Teemu Kaukoranta09:02:51

but if I were maintaining the tool, I probably would not remove it, in case someone has built their own scripts around those shorthands or whatever

tengstrand10:02:09

We could have avoided the breaking change in the test runner (in 0.2.19-SNAPSHOT) but we decided to go for it, because it was cleaner to have the test config where it belongs, in the projects, instead of in the settings. I accidentally broke the code (in the first snapshot version of 0.2.19) but then we realized it was probably better to change the external and Kaocha test runners to support the changes in the internal workspace structure. But I totally agree that we should be restrictive when it comes to introducing breaking changes. I have an idea. We could deprecate these two suggested changes, and print out warnings when users use them + info about the deprecation in the documentation and in the release. When we introduce support for sharing bricks between workspaces, this will most likely introduce breaking changes, so that could be the time to clean up things, like these two suggested breaking changes. The deprecation will give people time to adjust their code. My guess is that both of these forms are rarely used in production code/scripts.

šŸ‘ 1
Teemu Kaukoranta10:02:55

Thank you for listening to my feedback!

tengstrand10:02:36

No problemo, I like feedback!

Nik06:02:23

Hey, I'm creating my new project using polylith. For some reason my one component has issues when I run test :dev from poly shell (installed as standalone in macbook using brew) Error log - https://pastebin.com/g7QkMU1J Main line from log java.io.FileNotFoundException: Could not locate in/arthya/hledger/core__init.class, in/arthya/hledger/core.clj or in/arthya/hledger/core.cljc on classpath. My deps file

{:aliases  {:dev {:extra-paths ["development/src"]

                  :extra-deps {; Components
                               poly/icici-parser {:local/root "components/icici-parser"}
                               poly/file-reader {:local/root "components/file-reader"}
                               poly/util {:local/root "components/util"}
                               poly/hledger {:local/root "components/hledger"}

                               org.clojure/clojure {:mvn/version "1.11.1"}

                               ; Development Deps
                               djblue/portal {:mvn/version "0.51.1"}}}

            :test {:extra-paths ["components/icici-parser/test"
                                 "components/file-reader/test"
                                 "components/util/test"
                                 "components/hledger/test"]}

            :poly {:main-opts ["-m" "polylith.clj.core.poly-cli.core"]
                   :extra-deps {polylith/clj-poly {:mvn/version "0.2.18"}}}}}
Interface File
(ns in.arthya.hledger.interface 
  (:require [in.arthya.hledger.core :as core]))

(defn ->hledger-record
  [record]
  (core/->hledger-record record))
Core file
(ns in.arthya.hledger.core
  (:require [clojure.string :as str]))

(defn ->hledger-record
  [transaction]
  (str "hi")

tengstrand06:02:52

Is it possible to send the whole workspace to me (if it's not production code)? If not, then you can export the workspace with poly ws out:nikhil.edn and post the file to me (on Slack) and I will have a look.

Nik06:02:53

Sending you edn file first. If it doesn't work I'll share whole workspace It has some personal data that i'll need to delete first.

Nik06:02:30

FYI i'm using vscode and calva extension

tengstrand06:02:19

thanks. Will have a look.

1
tengstrand07:02:07

@U029PC2K1HV The poly tool doesn't recognize the core namespace in hledger , it only finds its interface namespace:

file:arthya$ ws get:components:hledger:namespaces:src
[{:file-path "components/hledger/src/in/arthya/hledger/interface.clj",
  :imports ["in.arthya.hledger.core"],
  :name "interface",
  :namespace "in.arthya.hledger.interface"}]
You need to change its suffix from: components/hledger/src/in/arthya/hledger/core.cljs to: components/hledger/src/in/arthya/hledger/core.clj

Nik08:02:56

oh!! This is my first time doing clojure project (I was building webapp using cljs until now) so muscle memory caused it šŸ™ˆ thanks a lot for finding it out!