Urgent.News

What's breaking now, across thousands of outlets.

Tech

I built plugins for three editors. Everywhere, you're a guest in someone else's house

Over the last while I've built integrations for three places where people work with text and images: Obsidian , VS Code, and Figma. Doing a few of them back to back, I noticed something you don't see from a single one. They're all desktop apps. For your integration to exist at all, the person first installs a program on their machine, and then, inside it, your plugin. You're not writing for the…

During a recent project, I developed plugins for three different text and image editing applications - Obsidian, VS Code, and Figma. It quickly became apparent that despite all being desktop apps, each had its own unique approach and restrictions.

To create an integration, users must first install a program on their machine, after which the plugin runs within that program's environment. This runtime, along with its own set of rules, presents challenges for developers. The web, in contrast, typically allows for straightforward HTTP requests, but working within someone else's sandbox requires earning access to these resources.

Figma proved to be the most restrictive host among the three. Despite the task seeming simple at first glance - select a frame, write a caption, choose social accounts, and publish without exporting the image - there were several complexities involved.

Figma provided raw PNG bytes instead of a file, necessitating additional steps to upload it. The plugin first creates a post, obtains an upload URL, PUTs the PNG, completes the media, and then updates the post. This sequence ensures the image is correctly uploaded and processed.

Additionally, the plugin UI runs in a sandboxed iframe with Origin: null, making it impossible for the plugin to directly communicate with the API. A Cloudflare Worker was implemented to forward requests and add the necessary CORS headers.

Other considerations include handling character limits across different social media platforms - LinkedIn allows more text than X, so the plugin uses the strictest limit among the selected networks. The plugin also prevents users from scheduling posts if the image fails to upload, ensuring a smooth user experience.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

# Redundant Links, İzleme Araçları ve Bir Affinity Kilitlenmesi (Modül 5)

Seri: Proxmox VE Cluster ve Corosync | Hafta 5 Serinin adı "Cluster ve Corosync"; ama dört modüldür ağırlık HA Manager, resource affinity ve CRS'teydi, Corosync'in kendisine (redundant link'ler…

  • Redundant Corosync links caused issues due to incorrect priority parameter usage
  • Author discovered pmxcfs mechanism automatically propagating cluster-wide changes
  • pmxcfs and corosync daemon read different configuration files for consistent view

Portfolio Update, I Guess

This isn't my main piece for the week, it's more of a "contributes nothing to knowledge" kind of post. Last week I took another look at my portfolio and thought, "Hey, why not make this feel a bit…

More from Wednesday 26 August →