-
-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for more than one interface name #187
Comments
I'm not 100% sure about allowing a vector. Might lead to abuse, e.g. people specifying :interface-ns ["component-a" "component-b"] and then complaining because names clash (I can see that being an issue in larger polylith repos). As a polylith user, I would rather see a solution that works per component but I understand if that's too much effort. Could be a different key in workspace.edn too: :interface-nses {"component-a" "iface"
"component-b" "interface"} |
But in this case we could specify :interface-ns ["interface" "iface"] and it will be valid in any component, both component-a and component-b in your example (and any other component). |
Exactly. If you add a new item to the interface-ns vector it will also apply to existing bricks. What if one of the bricks already has an implementing namespace with |
Just a suggestion: :interface-ns ["interface" "ifc" ;; these apply to all components
{"iface" #{"component-a" "component-b"} ;; these only apply to selected components
"port" #{"component-c"}}] |
I kind of like the idea that an interface always starts with the string "interface" because then it's easy to find the interface from an IDE. An idea I have is to have a flag in Valid names could e.g. be What do you think @PavlosMelissinos @imrekoszo ? |
@tengstrand I'm usually pro-flexibility but I understand if you think my suggestion is overkill. My main problem with However, this is your project and I'd suggest you don't add something you dislike. |
My vote would be for making Like @imrekoszo I don't much care for |
A vector is the simplest solution indeed and I don't think any of the alternatives (including my suggestion) are elegant enough to justify the complexity right now. @tengstrand I'm still a bit skeptical but if a problem comes up it would still be possible to extend your original suggestion with something like what @imrekoszo proposed. |
One of the benefits of Polylith is that it establishes a common language for project teams. When team members discuss about the project, they are going to talk about interfaces and it is valuable to reflect that within the codebase by using the word interface. I feel like in this case adding flexibility reduces one of the benefits of Polylith and makes it hard to communicate. Think about a team member reading the Polylith documentation and sees interfaces everywhere but in their codebase they used 10 different namespace names for interface that do not include the word interface at all. Since the interface word creates issues in ClojureScript projects, I would suggest we pick another one (like ifc) and allow that one as well. This way, Polylith would allow both Another idea could be to allow users to only define one alternative interface name (something like |
Hi guys! I suggest that we keep the key In the documentation we could recommend people to use one of these two, but that would be their choice in the end. The value they put in the So if we for example start using We could continue to use It could even be possible to keep Internally we could keep |
I think @tengstrand latest suggestion is a good compromise: support |
Always allow 'ifc' and 'interface' as interface names. Issue #187.
I have merged this to master. Please check it out @PavlosMelissinos. |
Nice! Looks good to me @tengstrand 🙂 Do you plan to update the docs as well to mention ifc and custom interface names? |
Cool! You mean the Gitbook docs? |
The interface name to use is specified in
workspace.edn
in the key:interface-ns
where the value is stored as a string.When people want to share code between Clojure and ClojureScript, they cannot use
interface
as interface name, because it's a reserved word in ClojureScript. A solution to the problem is to allow more than one name for the interface by also allowing the namespaces to be stored as a vector, e.g.::interface-ns ["ifc" "interface"]
.The text was updated successfully, but these errors were encountered: