Skip to content

Commit 2b390e1

Browse files
authored
docs: note on exposed dependencies (#428)
1 parent 1169230 commit 2b390e1

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

website/docs/automation/add-new-language.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,18 @@ Algolia for Java (5.0.0); Search (5.0.0); JVM (11.0.14); experimental
109109

110110
You can take a look at the Java implementation [here](https://github.com/algolia/api-clients-automation/pull/347).
111111

112+
### Dependencies
113+
114+
You can use any dependency you want to create the client, it can be Json parser or HTTP client, but it's important to never expose those dependencies through the client, meaning:
115+
- a function cannot return an object from a dependency
116+
- a function cannot accept an object from a dependency as a parameter
117+
- and so on
118+
119+
It matters because when a dependency is exposed, a breaking change from our deps can affect the user code while the API client is still working correctly (because they have to use the dependency in their code),
120+
and that prevent us from upgrading our deps. In some languages it also requires the user to add our internal dependencies to his build system, which is very inconvenient and our clients should always be standalone.
121+
122+
To achieve this you can create interfaces that can be exposed, and wrap the method you want to be exposed, for an HTTP client for example.
123+
112124
### Requesters
113125

114126
> TODO: informations

0 commit comments

Comments
 (0)