opral / inlang-message-sdk

0 stars 0 forks source link

get rid of versioned interface packages #46

Open samuelstroschein opened 1 month ago

samuelstroschein commented 1 month ago

Context

We define interfaces of the inlang sdk in dedicated packages. The idea was to decrease the impact of breaking changes of interfaces on the ecosystem. However:

Proposal

Remove the versioned interfaces and put them in the SDK.

Video

https://www.loom.com/share/ca91189f093940c38ae0f2927725b06c?sid=93b4ddf6-ce84-4581-91f3-97987224652d

samuelstroschein commented 1 month ago

cc @jldec (because the sdk is your baby), @loris.sigrist @martin.lysk1 (because you worked on the interfaces lately)

LorisSigrist commented 1 month ago

The reasoning behind moving the Data-Model into the SDK makes sense.

A concern I have is that this might cause large parts of the SDK to be bundled into the lint-rules / plugins. Everything but the types should be treeshaken but that's just one mistake away from silently breaking.

Apart from that concern I agree with the proposal

jldec commented 1 month ago

In cases where you just want the types, but not the whole sdk, you should still be able to import those from the sdk package without bundling the whole sdk, right?

jldec commented 1 month ago

regarding the package separation, I thought the main potential benefit of that would be separate releases with separate version numbers, but I don't believe we are making use of the version numbers to do auto-migration or to ship with support for multiple versions.

jldec commented 1 month ago

==> I agree with this proposal :)

samuelstroschein commented 1 month ago

@loris.sigrist the SDK is tree-shakable except for the large loadProject function but using the function in a module (plugin, lint rule) serves no purpose :)