
Rewriting the Slack Python SDK - reinhardt
https://slack.engineering/rewriting-the-slack-python-sdk-ea000f587de7
======
MobileVet
It still amazes me that Slack, with its infinite resources, hasn’t built
native clients. One code base is nice and all, but man I loathe the Electron
app.

~~~
paxys
What are some examples of well-written UI-heavy native desktop apps? I'm
curious because I see the usual complaints whenever Slack (or another Electron
app) is mentioned, and largely agree with them, but what's an app that has
actually done native well across Windows/macOS/Linux?

~~~
Nextgrid
Adobe Photoshop & its friends? Microsoft Office? Just a few examples, I'm sure
there's plenty more.

~~~
sansnomme
Those either are not single-codebase-crossplatform or are architectured like a
game engine. Yes Electron is not optimal but if you want a "rich" UI with
fancy animations and custom interfaces for everything instead of a generic
winforms-style UX then the browser is a good compromise. That or feel free to
manually build everything using OpenGL/Godot/Unity. (Using a browser means you
are shifting all the game-engine-level graphics requirement to a billion
dollar company. The problem doesn't actually magically go away.

(And to be fair, UI development in XAML on Windows is not too different from
HTML/CSS/JS i.e. no Drag and Drop absolute positioning, everything is relative
with a constraint system bolted on top.)

------
underyx
I was trying to update my all-in-one duct tape Docker image[0] yesterday and
was surprised to see that they ramped up the complexity so much for this
release, I had to install a new C library just to be able to compile a
dependency of a dependency they added.[1]

[0]: [https://github.com/underyx/url](https://github.com/underyx/url)

[1]:
[https://github.com/underyx/url#5-2019-05-31](https://github.com/underyx/url#5-2019-05-31)

~~~
omni
C extensions are a pretty common thing in the Python ecosystem, you're making
this sound a lot more drastic than it is

~~~
underyx
They are, but not for an API wrapper.

------
maxdo
I've done the integration with 10+ different chat API's, Slack is one of the
most complicated ones and the one that ignored the whole industry at all. The
way it is done is totally alien to any experience you might have with other
chat sdk's before.

------
zild3d
Happy about this, writing a slack app/bot with the old SDK was often opaque

sc.api_call() with strings for the specific API (there are dozens, each with
different inputs) always felt like a temporary ducttape SDK

------
kissgyorgy
Don't bother, I have my own based on asyncio with Real Time API support,
pagination and everything. If people interested separating this to it's own
package, let me know!

[https://github.com/kissgyorgy/gerrit-slack-
bot/blob/master/s...](https://github.com/kissgyorgy/gerrit-slack-
bot/blob/master/slack.py)

~~~
marcinzm
>Don't bother

Why not? Theirs has better support behind it and supports everything you
listed (RTM api, pagination, async, etc.).

~~~
kissgyorgy
It's API is actually terrible and has bugs which mine don't.

~~~
orf
yours just has a bunch of print statements, several FIXME's, some weird
choices (throwing an ApiError in one case but just printing the error in
another), random things like a half baked Emoji enum (make this dynamic) and
isn't a library you can pip install.

The code is quite clean though.

------
dijit
They're rewriting with py3 in mind?

Excellent, unlike removing a headphone jack; I consider this truly courageous.

